-
Notifications
You must be signed in to change notification settings - Fork 101
Home
Welcome to the android-maps-extensions wiki!
Google Maps Android API v2 is one small step for Google, a giant leap for Android developers. Even though some said it carries a lot of limitations and is not extensible, Android Maps Extensions brings a few very useful features, most notably: Marker Clustering and ability to carry model data within markers (and other visual objects) to be retrieved as needed.
Currently implemented extensions include:
- Marker Clustering with
GoogleMap.setClustering(ClusteringSettings)
-
ClusteringSettings.clusterOptionsProvider(ClusterOptionsProvider)
is required for it all to work -
ClusteringSettings.addMarkersDynamically
when having too many markers -
ClusteringSettings.clusterSize
to control... cluster size -
Object getData()
andsetData(Object)
onMarker
,Circle
,GroundOverlay
,Polygon
,Polyline
orTileOverlay
-
List<Marker> GoogleMap.getMarkers()
and List<Circle> GoogleMap.getCircles()
-
List<GroundOverlay> GoogleMap.getGroundOverlays()
etc. boolean Circle.contains(LatLng)
Marker GoogleMap.getMarkerShowingInfoWindow()
List<Marker> GoogleMap.getDisplayedMarkers()
float GoogleMap.getMinZoomLevelNotClustered(Marker)
Marker.animatePosition(LatLng target, AnimationSettings settings)
Marker.setClusterGroup(int)
Focusing on:
- keeping up with the latest release
- performance
- bugfixing (especially clustering engine)
- please post any issues you notice
- adding more APIs not available in the original library
When migrating to Extensions, all you have to change is:
a couple of import statements,
SupportMapFragment (or MapView) full class names in xml and
call getExtendedMap
instead of getMap
on SupportMapFragment
(or MapView
).
Note for versions 2.x: also add google-play-services-lib (or keep it if you were already using it). Since 2.0 this library is decoupled from Google Play Services and you may use any version from 3.2.65 (the last working on Android API 8) or above. Note for versions 1.x (deprecated): you will have to remove original google-play-services-lib from your workspace, as this library replaces it.
See reference commit for how it was done in Google Play Services maps samples.
To build and run using maven:
mvn install (this also installs dependencies missing from the central repo)
cd android-maps-extensions-demo
mvn android:deploy android:run
Eclipse-maven-android integration seems to be buggy. You will have to delete libs folder after installing dependencies with mvn install and maybe do strange things like Maven->Update project or closing and reopening demos.
If you know how to work around these problems, please contact me. Here are issues that seem relevant:
While you don't need to reference this library inside your project in any way you may still need to add Google Play Services attribution text as described under Attribution Requirements.
Check out wiki on GitHub.
The best way to resolve any problems (that are not bugs or feature requests) is by asking a question on StackOverflow with a tag android-maps-extensions.
This project is also available on GitHub and Bitbucket.