Android Maps Extensions is a library extending capabilities of Google Maps Android API v2.

Overview

Build Status

Android Maps Extensions

Join the chat at https://gitter.im/mg6maciej/android-maps-extensions

Library extending capabilities of Google Maps Android API v2.
While Google Maps Android API v2 is a huge leap forward comapared to its predecessor, it lacks commonly used patterns like marker clustering. This library aims to fill this gap by adding many useful features and improving on the responsiveness issues of the official Google library.
See wiki for more details.

Usage

You may use any version of Google Play Services from 3.2.65 (the last working on Android API 8) or above.

Gradle

dependencies {
    compile 'com.androidmapsextensions:android-maps-extensions:2.4.0'
    compile 'com.google.android.gms:play-services-maps:10.2.0'
}

Developed by

Contributing

Contributions are welcome and much appreciated. Just fork, create a feature branch, do your things and send a pull request.
You may also contribute by creating or commenting on issues, edititing or adding wiki or even do cool things like creating a YouTube video.

License

Copyright (C) 2013 Maciej Górski

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • Added minZoomLevelVisible to MarkerOptions

    Added minZoomLevelVisible to MarkerOptions

    Added minZoomLevelVisible to MarkerOptions, which works as follows: For Markers with ClusterGroup.NOT_CLUSTERED, MarkerOptions.minZoomLevelVisible(float) can be set to hide markers when map is below the specified zoom level and show markers when map is above the specified zoom level.

    opened by vit001 15
  • Added support for Marker zIndex

    Added support for Marker zIndex

    Added support for Marker zIndex, introduced in Google play services maps 9.2.0.

    Breaking changes

    • Removed getExtendedMap() as getMap() is not any more available in Google play services sdk
    • minSdkVersion is now 9
    opened by hannta 13
  • Publish your artifacts to the central repository

    Publish your artifacts to the central repository

    Hi!

    Now your project is mavenized, it would be great to publish your artifacts to the central repository! This would allow us to use your library more easily :)

    What do you think about that ?

    opened by ThomasFondrillon 11
  • java.lang.AbstractMethodError with latest Google Maps library

    java.lang.AbstractMethodError with latest Google Maps library

    If I use 'com.google.android.gms:play-services:9.4.0' the project will not run. The following exception will be thrown:

    java.lang.AbstractMethodError: abstract method "com.google.android.gms.maps.GoogleMap com.androidmapsextensions.MapHolder$Delegate.getMap()"
                at com.androidmapsextensions.MapHolder.getExtendedMap(MapHolder.java:27)
                at com.androidmapsextensions.SupportMapFragment.getExtendedMap(SupportMapFragment.java:44)
    

    Using an older version like 'com.google.android.gms:play-services:3.2.65' it runs fine.

    opened by ultimate-tester 9
  • Crash : ConcurrentModificationException

    Crash : ConcurrentModificationException

    Hi,

    First, thank you for your library, it's really useful !

    Since 2.3.0, I'm receiving some crashes from this library on Crashlytics :

    Fatal Exception: java.util.ConcurrentModificationException
           at java.util.HashMap$HashIterator.nextEntry(HashMap.java:788)
           at java.util.HashMap$KeyIterator.next(HashMap.java:815)
           at com.androidmapsextensions.impl.ClusterRefresher.refreshAll(ClusterRefresher.java:51)
           at com.androidmapsextensions.impl.ClusterRefresher$1.handleMessage(ClusterRefresher.java:31)
           at android.os.Handler.dispatchMessage(Handler.java:98)
           at android.os.Looper.loop(Looper.java:158)
           at android.app.ActivityThread.main(ActivityThread.java:7229)
           at java.lang.reflect.Method.invoke(Method.java)
           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
    

    I'm using version 10.0.1 from play-services-maps

    opened by fleficher 7
  • Tombstoned clusters

    Tombstoned clusters

    Great library, much quicker than the Google one.

    Slight problem though - I'm adding ~16,000 markers relatively slowly while moving around the map, zooming etc.

    After not very long some of the clusters will remain with a very high number of markers but zooming in all the way it will stay the same. If I tap one of these clusters it fires the method to get the info window: public View getInfoContents(Marker marker) {}

    However the marker that is passed is null.

    At the very least is there a way to force the map to re-group all the markers to remove these wrong ones?

    David

    opened by daveeeh 6
  • Doesn't work with google play services 6.5.+

    Doesn't work with google play services 6.5.+

    Hi Maciej,

    I tried to update my google play services to 6.5.+ to use granular dependency management. But I get this error:

    java.lang.NoSuchFieldError: No static field MapAttrs of type [I in class Lcom/google/android/gms/R$styleable; or its superclasses (declaration of 'com.google.android.gms.R$styleable' appears in /data/app/...)
            at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
            at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
            at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2158)
            at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:377)
            at android.app.Activity.setContentView(Activity.java:2144)
            at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:216)
            at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:110)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:76)
            at ....onCreate(ActivityOffices.java:80)
            at android.app.Activity.performCreate(Activity.java:5933)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
            at android.app.ActivityThread.access$800(ActivityThread.java:144)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5221)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    

    It appears when trying to inflate com.androidmapsextensions.SupportMapFragment. Any ideas?

    Btw, it's a great library. Are you planning to develop it further in spite of native support for clustering?

    opened by micHar 6
  • Update play service

    Update play service

    • update Google play service to most recent
    • update Gradle tools version With this commit, developer are no more forced to change AME when we use it as git submodule and want update libraries
    opened by hannesa2 5
  • Custom ClusteringStrategy

    Custom ClusteringStrategy

    Great job with this library - it works great!

    I've found a need to extend the GridClusteringStrategy and was hoping to somehow configure the library to use the subclass without modifying the library, Perhaps through the ClusterOptions interface.

    So first, is it correct that it is not possible currently to provide a custom ClusteringStrategy through the client interface. And second, if not then would this be a reasonable approach (through the ClusterOptions)?

    The reason I've found to extend GridClusteringStrategy is programmatic showInfoWindow does not work as expected - keeps getting ignore in onShowInfoWindow in GridClusteringStrategy.

    Comments welcome.

    opened by andysbliss 5
  • Demo Running Issues When Android API is below 4.1.2(API 16)

    Demo Running Issues When Android API is below 4.1.2(API 16)

    It is very happy to find Android-Maps-Extensions,which is the thing I need to use in my project.However, I found some issues during running.

    When I have try to use Android-Maps-Extensions-Demo from version 1.0 to 1.6 on handphone debugging model, it can run on the Android device that Android version is 4.1.2(Android API 16) or above ,but it can not be run on Android device that Android Version is below 4.1.2(API level 16) like Android 4.0.4, Android 4.0.3 and so on.

    Moreover, I try to run on AVD ,and result is same as debugging model.

    Hence, I want to confirm whether Android-Maps-Extension library and demo only can run on Android 4.1.2 & above? If not, do you know what happen?

    Thank you very much

    opened by LancetRunner 5
  • Project dead ? RIP

    Project dead ? RIP

    It looks like the maintainer has lost his interest at all, because all my pull requests are unmerged.

    But helping myself, I made my fork up do date.

    It contains Android X, most recent build tools Android Studio 3.5 and several additional improvements.

    You can use it with

    allprojects {
    	repositories {
    		...
    		maven { url 'https://jitpack.io' }
    	}
    }
    
    dependencies {
        implementation 'com.github.hannesa2:android-maps-extensions:$latest'
    }
    
    opened by hannesa2 4
  • Allow to get original GoogleMap

    Allow to get original GoogleMap

    • This PR adds getOriginalMap() getter to this lib GoogleMap interface, which returns original GoogleMap (com.google.android.gms.maps.GoogleMap)
    • With help of this new function, you can use this library with other Google Maps libraries which requires original Google map like android-maps-utils
    opened by hannta 0
  • Cluster markers get stuck if marker animation in use

    Cluster markers get stuck if marker animation in use

    If I use clustering together with marker animation - I often encounter an issue where I zoom enough for cluster to split but it doesn't. When that happens - no matter how close I zoom or pan, clusters keep just stuck in their latest positions

    I've tried calling map.setClustering(null) after having this happening to see if clusters at least get cleared, but it doesn't help.

    If I don't use marker animation - this doesn't happen.

    Looks like timing issue / race condition to me.

    opened by secretwpn 3
  • Outdated play services version

    Outdated play services version

    Google APIs has been updated on April 10th to version 15.0.0 and, as stated in release note :

    All references to com.google.android.gms.R classes have been replaced by component specific references; for example, com.google.android.gms.ads.R. If you use these classes directly in your code, you may need to update your code to be compatible. (Source)

    Could you please update references to meet these requirements ? Thanks

    opened by saugs 3
  • Memory leak class DelegatingOnCameraChangeListener i

    Memory leak class DelegatingOnCameraChangeListener i

    First of all thank you for this library. I have been able to flawlessly add more than 5000 markers on the map. Yet, when I rotate the device, I have a memory leak. I changed the code to use only the googlemaps one without the elements of AME and I didn't have any memory leak while rotating the screen (yet I can't add that more markers with such fluidity). Here is the Java Heap Dump capture: tvjzlzv1pp5x_android_studio_trace

    When I make a right click and jump to source it brings me here:

    private class DelegatingOnCameraChangeListener implements com.google.android.gms.maps.GoogleMap.OnCameraChangeListener {
    
            @Override
            public void onCameraChange(CameraPosition cameraPosition) {
                markerManager.onCameraChange(cameraPosition);
                if (onCameraChangeListener != null) {
                    onCameraChangeListener.onCameraChange(cameraPosition);
                }
            }
        }
    

    Keep in mind that in the destroy view of the mapview I use this (to make sure every thing is cleaned) :

    if(googleMap != null) {
                googleMap.setOnMapClickListener(null);
                googleMap.setOnMarkerClickListener(null);
                googleMap.setInfoWindowAdapter(null);
                googleMap.setOnCameraChangeListener(null); // <--
                googleMap.setOnGroundOverlayClickListener(null);
                googleMap.setOnCameraMoveCanceledListener(null);
                googleMap.setOnCameraMoveListener(null);
                googleMap.setOnCameraMoveStartedListener(null);
                googleMap.setOnCircleClickListener(null);
                googleMap.setOnMyLocationChangeListener(null);
                googleMap.setOnMapLongClickListener(null);
                googleMap.setOnInfoWindowClickListener(null);
                googleMap.setOnInfoWindowCloseListener(null);
                googleMap.setOnInfoWindowLongClickListener(null);
                googleMap.setOnPoiClickListener(null);
                googleMap.setOnPolygonClickListener(null);
                googleMap.setOnPolylineClickListener(null);
                googleMap.setClustering(null);
            }
    

    Here is the version that I currently use:

    compile 'com.google.android.gms:play-services-maps:9.8.0' compile 'com.androidmapsextensions:android-maps-extensions:2.4.0'

    1- Is there anyway to fix that memory leak from the library side? 2- For all your handlers, can you use this, that uses weak references for its handlers to avoid any memory leak?

    opened by maxime-kouemo 4
Owner
Maciej Górski
I write tests and make them pass
Maciej Górski
Scale bar for Android Maps (Google Maps, OSM, MapBox, Yandex)

Map Scale View Scale view for any Android Maps SDK (not only Google Maps) Contributing I encourage you to participate in this project. Feel free to op

Stas Parshin 109 Nov 18, 2022
malik dawar 87 Sep 18, 2022
Maps application in Android Studio using the Maps SDK for android

Google-Maps-Application Maps application in Android Studio using the Maps SDK for android. This app was initially developed in Java, but then was conv

Kyle McInnis 0 Nov 30, 2021
🍃 Organic Maps is an Android & iOS offline maps app for travelers, tourists, hikers, and cyclists based on top of crowd-sourced OpenStreetMap data and curated with love by MapsWithMe founders.

?? Organic Maps is an Android & iOS offline maps app for travelers, tourists, hikers, and cyclists based on top of crowd-sourced OpenStreetMap data and curated with love by MapsWithMe founders. No ads, no tracking, no data collection, no crapware.

Organic Maps 4.3k Dec 31, 2022
An android app that uses Google Maps API and SDK to track a user's location and calculate the total distance travelled

Bike Rush is an android app that uses Google Maps API and SDK to track a user's location and calculate the total distance travelled by him or her along with time and average speed.

Ishant Chauhan 21 Nov 14, 2022
Google Maps Api test using marker rotation and routes.

Google Maps Api test using marker rotation and routes. Features ✔️ Kotlin ✔️ DI: Hilt ✔️ Retrofit ✔️ Gson ✔️ View binding ✔️ Coroutines ✔️ AndroidX ✔️

Carlos Adan 39 Jul 15, 2022
EasyRoutes allows you to easily draw routes through the google maps address api.

EasyRoutes EasyRoutes allows you to easily draw routes through the google maps address api. Note: You need to generate an API key from the google cons

Antonio Huerta Reyes 7 Jul 26, 2022
Curve-Fit is an Android library for drawing curves on Google Maps

Curve-Fit Android library for drawing curves on Google Maps. This library uses Bezier cubic equation in order to compute all intermediate points of a

Sarweshkumar C R 63 Mar 7, 2021
Demo de uso de google maps en Android, charla para el GDG Chimbote

mapasbasico Demo de uso de google maps en Android, charla para el GDG Chimbote Puedes usar este proyecto como base para trabajar con mapas en Android.

Whiston Kendrick Borja Reyna 4 Sep 17, 2021
Membuat Custom Tooltip Marker Google Maps

Custom-Tooltip-Marker Membuat Custom Tooltip Marker Google Maps Tutorial Build with Android Studio https://youtu.be/E8ND0YThNiU Tutorial Build with St

Azhar Rivaldi 5 Feb 17, 2022
An app to search nearby businesses on Google Maps & Add Grocery Items to List!

GoStore: Internship Program Project A mobile app is built where the user can search for his nearby locations based on his requirement. Whenever the us

null 7 Nov 28, 2022
Maps SDK for Android Utility Library

Maps SDK for Android Utility Library Description This open-source library contains utilities that are useful for a wide range of applications using th

Google Maps 3.4k Dec 30, 2022
Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.

Mapbox 247 Dec 27, 2022
TileOverlay component for react-native-maps

TileOverlay component for react-native-maps

Joe Julik 1 Apr 10, 2022
App usage tracker which maps your app usage to geo location.

Guilt Guilt is an inspiration from Meta (pun intended), it tracks the apps usage and maps it with geo location data where the app was last used. The a

null 6 Dec 28, 2022
This is a repo for implementing Map pan or drag (up, down, right ,left) to load more places on the Google Map for Android

Challenge Display restaurants around the user’s current location on a map ○ Use the FourSquare Search API to query for restaurants: https://developer.

Mahmoud Ramadan 7 Jul 30, 2022
Android library project that lets you manage the location updates to be as painless as possible

Smart Location Library Android library project that intends to simplify the usage of location providers and activity recognition with a nice fluid API

Nacho Lopez 1.6k Dec 29, 2022
Android library that allows you to determine your location in a few of lines

locsimple Android library that allows you to determine your location in some lines! Benefits: automatic processing of permissions processing of enabli

Dmitry 7 Aug 31, 2022
A library for reverse geocoding coordinates in Android

?? AndroidReverseGeocoder A library for reverse geocoding coordinates in Android. The library is built on top of android's Geocoder library. AndroidRe

ShimShim27 1 Jun 24, 2022