Bringing your data to life with data-driven styling in Google Maps
Data-driven styling in short
The existing Geocoding API can be used to acquire place IDs of interest. As an alternative the new Region Lookup API can also be used to find matching placeID’s related to your business data.
While the use cases are very broad, here are a few potential use cases:
Highlighting the area of interest: When your users search for an address or location, such as nearby shops, building information or POIs, you can highlight the surrounding or containing administrative boundary, giving your search results more context and value.
Creating Chloropleth Maps: Combine tabular data with Google’s administrative boundaries to create chloropleth maps showing fluctuations in data across different geographic regions. Different administrative boundaries can be used to aggregate your data, such as postal code, city, state and countries polygons.
Apply dynamic map styling: Change the way your maps look based on dynamic data or user collected input. You can directly respond to user click events to update the map styles.
Demo with public data from the Netherlands
For this Localyse demo data from the CBS is used, summarizing the average value of houses sold per municipality in the Netherlands. First, let’s explore which administrative boundaries are available for the area of interest. For the Netherlands there are currently 3 options (we will use the administrative area level 2 boundaries, i.e. municipalities). New options are added by the Google team on a frequent basis.
Next, a few things need to be prepared, alternatively you may be given these when you are a Localyse customer. This way you can forget about the hassle of setting up your own maps and styles.
First a map style is required that will be added to the custom map.
Adding the Public dataset to the code
With data-driven styling the Administrative Area Level 2 feature layer from Google can be styled with data from the Dutch government. Several classes are defined to control the fill color of the polygons. This will be your legend. In this example municipalities with house prices beneath 300.000 euros are colored green, while the most expensive municipalities are colored purple (such as Amsterdam).
The resulting map shows a chloropleth showing the data fluctuations across the Netherlands.
Check out our live demo:
Source: CBS 2022
Data-driven styling is a great way to enrich your existing data, tabular or spatial. The combination with existing Google Maps data opens up new possibilities to share key insights with your customers at no additional cost, all while speeding up the development process and keeping supporting infrastructure at a minimum.
Launch your own maps
At Localyse we are interested in what this new Google Maps capability brings for our customers. Talk to us about how you are using this feature, or get in touch to find out how to get started with your data today.