-
- All Implemented Interfaces:
-
com.google.maps.android.data.renderer.DataRenderer
public final class MapViewRenderer implements DataRenderer
A concrete implementation of the DataRenderer interface that renders a DataScene onto a GoogleMap.
This class is responsible for translating the platform-agnostic DataScene and Feature models into specific Google Maps SDK objects (e.g., Markers, Polylines, Polygons).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMapViewRenderer.Companion
-
Field Summary
Fields Modifier and Type Field Description private BooleanuseAdvancedMarkers
-
Constructor Summary
Constructors Constructor Description MapViewRenderer(GoogleMap map, IconProvider iconProvider)
-
Method Summary
Modifier and Type Method Description final BooleangetUseAdvancedMarkers()Controls whether to use the new Advanced Markers API (if available) or legacy Markers. final UnitsetUseAdvancedMarkers(Boolean useAdvancedMarkers)Controls whether to use the new Advanced Markers API (if available) or legacy Markers. final UnitcacheImageData(String url, Bitmap bitmap)Caches an image for a specific URL. Unitrender(DataScene scene)Renders an entire DataScene to the map. UnitaddLayer(DataLayer layer)Adds a DataLayer to the map. UnitremoveLayer(DataLayer layer)Removes a DataLayer from the map. UnitaddFeature(Feature feature)Adds a single Feature to the map. UnitremoveFeature(Feature feature)Removes a single Feature from the map. final FeaturegetFeatureForMapObject(Object mapObject)Finds the model Feature associated with a specific rendered Google Map object. Unitclear()Clears all currently rendered features from the map. -
-
Constructor Detail
-
MapViewRenderer
MapViewRenderer(GoogleMap map, IconProvider iconProvider)
-
-
Method Detail
-
getUseAdvancedMarkers
final Boolean getUseAdvancedMarkers()
Controls whether to use the new Advanced Markers API (if available) or legacy Markers. Default is false (legacy Markers).
-
setUseAdvancedMarkers
final Unit setUseAdvancedMarkers(Boolean useAdvancedMarkers)
Controls whether to use the new Advanced Markers API (if available) or legacy Markers. Default is false (legacy Markers).
-
cacheImageData
final Unit cacheImageData(String url, Bitmap bitmap)
Caches an image for a specific URL. This is useful for KMZ files or other scenarios where images are loaded locally and should be used instead of fetching from the network.
- Parameters:
url- The URL associated with the image.bitmap- The bitmap to cache.
-
render
Unit render(DataScene scene)
Renders an entire DataScene to the map.
- Parameters:
scene- The scene to render.
-
addLayer
Unit addLayer(DataLayer layer)
Adds a DataLayer to the map.
- Parameters:
layer- The DataLayer to add.
-
removeLayer
Unit removeLayer(DataLayer layer)
Removes a DataLayer from the map.
- Parameters:
layer- The DataLayer to remove.
-
addFeature
Unit addFeature(Feature feature)
Adds a single Feature to the map.
- Parameters:
feature- The Feature to add.
-
removeFeature
Unit removeFeature(Feature feature)
Removes a single Feature from the map.
- Parameters:
feature- The Feature to remove.
-
getFeatureForMapObject
final Feature getFeatureForMapObject(Object mapObject)
Finds the model Feature associated with a specific rendered Google Map object.
-
-
-
-