Google Maps Platform supports adding data layers to a dynamic map and customizing data display based on use case. Here are some best practices for enriching the map with fresh content.
1. Choose the right data layer based on use case.
Use as container for arbitrary geospatial data.
Depict intensity of data at geographical points (earthquake, weather, population density, etc.).
Display geographic information.
Render traffic and modal specific paths/routes on map.
2. Group and prioritize data.
- Use Cloud-based styling or JSON styling to group and differentiate Google-owned content on map (differentiating and contrasting label and fill colors for roads, streets, buildings, terrain, water; show/hide POIs etc.).
Important: Using Cloud-based styling to customize dynamic map in mobile applications will incur charges similar to web application usage.
- Ensure that Google logo and map controls (map/satellite toggle, zoom slider, full screen) are always visible and unobstructed on the map.
- When plotting location data with Markers, consider implementing Marker Clustering and Managing Markers, Labels, and POI collisions by setting marker prioritizations (z-index property).
- Build zoom level-responsive layers and stack multiple layers in proper order. Show layers depending on zoom level and each layer's order of priority.
3. Optionally display a Legend.
If a legend is required to describe groups of data layers, markers, and labels on the map, refer to Customizing a Google Map: Custom Legends for guidance on proper positioning and content population (contains sample code).
4. Improve performance with code optimizations.
- Data Layer: Consider Declarative Style Rules when updating large number of overlays (multiple markers, polylines). This way, styling rules are applied on the entire data set eliminating the need to apply style individually for each data overlay.
- Heatmap Layer: Use WeightedLocation object in place of a LatLng when adding large amounts of data at a single location. Rendering a single
WeightedLocationobject with a weight of 1000 will be faster than rendering 1000
- KML Layer: Please refer to Performance and caching considerations for more information.
5. Display content with accessibility in mind
- W3 Accessibility Overview: High level web content accessibility reference from W3.org.
- Web Content Accessibility Guidelines (WCAG) 2.0: More detailed reference of web content accessibility guidelines from W3.org.