The “Satellite” map layer has been suspended for Looker releases 3.46+, because our provider discontinued service. We’re working on a path to bring these back, but for versions without the layer, visualizations saved with the satellite map style will automatically switch to the default map layer.
As of Looker 3.34, we have introduced interactive map visualizations that allow zooming and panning. These visualizations depend on having latitude and longitude data in a field of type: location.
First, we will talk about the different options for plotting your data. Then we will go through some of the visualization settings available, so you can customize your chart!
Plotting Your Data
There are four options for plotting your data: Points, Automagic Heatmap, Lines, and Areas.
The Points option allows you to plot individual geographic points using latitude and longitude. You can plot these points as circles, icons, or both.
Let’s say I have taxi data, with pickup locations and fare amounts. I can query the total fare amount by location like so:
I can then plot this data using either circles or icons to show which locations have the highest total fare amounts:
You can also use pivoted data in map visualizations. Pivoting a dimension will allow you to plot those values as separate colors on the map.
If I have airport data, and want to look at airports by elevation, I can do so by querying airport location, elevation, and count like so:
I can then plot this data on a map like below, where each pivot value is denoted with a different color:
Pivoting also works with Lines and Areas plot types. Try it out!
The Automagic Heatmap mode plots your data as a heatmap grid. It modifies the query in order to plot the most detailed grid size possible. It will automatically adjust the query so 5000 grid units fit in the visible map area. This is particularly useful for queries that return more than 5000 data points, since the heatmap enables you to group these points and plot them all.
Let’s say I have airport location data. I can query the number of airports per location like so:
This will undoubtedly return many more than 5000 rows (since there are way more than 5000 airports in the US), making it difficult to plot all the data. This is where the heatmap comes in. With the heatmap, Looker will automatically group the airports into buckets and plot the entire US:
Note that this will automatically add filters and change the location column in your query:
The Lines options can be used to plot lines between any number of locations. This can be used to plot lines between multiple location fields, or between sequential locations within the same field.
Multiple Location Fields
If you have multiple location columns in your query, you can chart lines connecting these points.
Let’s say I have flight data, with an origin location and a destination location. I can create a Look like below, which shows the number of flights originating from DEN or JFK and their resulting destinations:
I can then chart this data using the Lines plot, where each line represents a flight, and the colors represent the number of flights on that path:
Series of Locations
You can also chart locations over time using the Line option. Let’s say I have driving data, with timestamps, locations, and speed. I can query these three fields like so:
I can then select the Lines plot mode and see the path this car took, including color changes for the speed:
The Areas plot can be used to chart location points that can be connected to create a shape.
Let’s say you have data marking the perimeter of a zoning area. Each location row indicates a point along the perimeter of that area. Query the location field along with another field used to sort it, like so:
You can hide the ID field from the visualization (read about how to do this here), and plot the shape like this:
Modifying Your Visualization
Once you have plotted your data in the format you’d like, there are lots of ways to modify how the chart appears. I’ll highlight a few key options in the visualization menu.
Map Style lets you choose what type of map you’d like to use. There are five options: Light, Dark, Toner Dark, Toner Light, and Satellite (left to right, top to bottom).
Map Position allows you to set the zoom and position the map appears upon load. There are two options:
- Fit to Data: This will adjust the zoom and position of the map so that it fits all the data returned in the query (not available for Automagic Heatmap).
- Custom: This allows you to manually set where you want the map zoomed and positioned. The values of Longitude, Latitude, and Zoom Level will be automatically set based on where you move the map. You can also set these values manually.
Your chart can appear very differently, depending on how you set the Map Position. For example:
Allow Panning and Allow Zooming
These options determine whether a user can change the zoom and position of the map when viewing it. This is particularly relevant when you add the visualization to a dashboard.
When set to ON, a user can move the map around as they please. This will not change the saved configuration of the map, but it will allow them to see other parts of the map.
When set to OFF, a user cannot move the map at all. This is useful for ensuring that users only view the area of the map you want them to see.
When you have points turned on (available for Points, Lines, and Areas plot types), you can show circles, icons, or both.
When you set point Type to circle, it will place circles at each location in the query. The size and color of the circles are determined by the following options:
- Radius lets you set whether you want the size of the circles to be proportional to the location’s value in the query, equal to that value, or a fixed radius. When you select Proportional, you have the option to select the minimum and maximum radius size.
- Scale lets you select if you would like a Linear or Logarithmic scale when you have a Proportional to Value radius.
- Radius Units lets you set whether you’d like the radius value to be in Pixels or Meters.
- Marker Color Mode lets you set whether you’d like the color of the circles to be based on its value in the query (see below for more options), or based on a fixed value.
For example, you can use these settings to create the chart below:
With point Type set to Icon, you can select which icon you would like the marker to display, as well as the Marker Color Mode.
You can create a chart similar to the one above, except with icons instead of circles like this:
When you have your Marker Color Mode set to Based on Value, or when you have your plot set to Lines, you can change how the colors appear, based on their value in the query.
- Value Colors lets you change what colors appear on the map. The defaults are green, yellow, and red.
- Quantize Colors sets whether the colors blend as they transition, or if they are set chunks. When set to OFF it will display the colors as a gradient. When set to ON, it will display them as fixed buckets.
Minimum and Maximum Value let you see the upper and lower ranges of the colors. When you set the Minimum to be more than the lowest possible value, it will display the lower range as that number or less in the legend. Similarly with Maximum, it will display the upper range as that number or more.
Note that these settings also change how the chart appears. For example, in the first chart below, there are no min or max values set. The legend show exact upper and lower bounds. In the second chart below, min and max values are set, and the legend reflects that. Notably, the colors of the markers also change due to the new boundaries.