Documentation

Map visualization

The Map visualization displays geo-temporal data on a geographic map.

Map data visualization

Set up the Map visualization

To view geo-temporal data on a geographic map, set up a Map visualization.

Set up the Map visualization

  1. Do one of the following:

    • Click Data Explorer in the navigation bar.

    • Click Dashboards in the navigation bar:

      Click the name of the dashboard to update and then do one of the following:

      • To edit an existing cell, click the icon on the cell and then Configure.
      • To create a new cell, click Add Cell.
  2. Use the Query Builder or the Script Editor to enter your query. To determine the location of points on a geographic map, query results must include the following fields:

    • lat: latitude in decimal degrees (WGS 84)
    • lon: longitude in decimal degrees (WGS 84)

    Or the s2_cell_id tag (S2 Cell ID as a token)

    If query results include lat and lon fields and an s2_cell_id tag, the map uses the lat and lon fields to determine point locations. If results only include the s2_cell_id, the map uses the center of the S2 cell as the point location.

    See Example queries.

Example queries

View a bird’s migration path

The following query uses the Bird migration sample data to display the migration path of a specific bird.

from(bucket: "migration")
    |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
    |> filter(fn: (r) => r._measurement == "migration")
    |> filter(fn: (r) => r._field == "lat" or r._field == "lon")
    |> filter(fn: (r) => r.id == "91864A")  
    |> aggregateWindow(every: v.windowPeriod, fn: last)

View earthquakes reported by USGS

The following query uses the United States Geological Survey (USGS) earthquake data to display the locations of earthquakes.

from(bucket: "usgs")
    |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
    |> filter(fn: (r) => r._measurement == "earthquakes")
    |> filter(fn: (r) => r._field == "lat" or r._field == "lon")

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Flux is going into maintenance mode and will not be supported in InfluxDB 3.0. This was a decision based on the broad demand for SQL and the continued growth and adoption of InfluxQL. We are continuing to support Flux for users in 1.x and 2.x so you can continue using it with no changes to your code. If you are interested in transitioning to InfluxDB 3.0 and want to future-proof your code, we suggest using InfluxQL.

For information about the future of Flux, see the following:

InfluxDB Cloud powered by TSM