Android - Regroup Google Map Markers - android

On my Android App, I've got a map with a lot of markers.
But when the user is zooming out, it hard the see the differents markers.
So I want to regroup then in one when there are a two much markers.
Could you help me please ?
Thanks

Try one of the open source clustering libraries for Google Maps Android API v2: Android Maps Extensions (demo here) or Clusterkraf (demo here).

For who is having troubles with Clusterkraf (I can't make it work!) and for who can't use android-maps-extension cause it's shipped with a custom build of Play Services lib, I want to suggest this other library, that is tiny, well written and works out of the box:
Clusterer: https://github.com/mrmans0n/clusterer
After a whole morning spent trying using the other two libs, this one saved my day!

Related

Interactive Map without Google maps

I have a huge plan of a site (the plan is just a picture), the problem is that Google Maps, can't have access to it, so I need to add markers in this picture (Plan), My question how to that ? how to make a picture interactive ? how to add markers ?
Really I have no idea, I saw indoor of Google Maps, but it's not what my custmer need.
Thank's !
this is a small example
you may give this library a try or see its demo here: https://leafletjs.com
it's a pure javascript library that may be used with any web platforms
wish it to be helpful.

Circle menu for mapview Marker in Android google maps API V2

I'm looking to create a circle menu for markers in my app that uses Google maps.
I've found this online example of what I am trying to do:http://demo-ee.com/index.php/examples/view/circle-menu-for-marker-with-mx-google-maps-for-expressionengine#
The problem is that this is for google maps in a webview, I'm looking to do this on Android.
Does anyone know if this is possible to achieve with google maps for Android and if it is, how much work would be involved to do it?
Is it possible to rebuild this example code in java to use in an Android app?
thanks
I put this as an answer and not as a comment, but I don't think you can achieve the same.
First of all, on android you don't have the "hover" callback for maps, you can only use the onMarkerClick listener.
You could try to build a custom infowindow (there are a few tutorial online but never followed, so I can't give you a trusted one, you have to try :( ) and check if the iw can be placed around your item. Unfortunately on android there is a limited set of functionalities, but to be honest, I would explore a different UX for that (cards, dialogfragment or other).
Check how google maps behaves when clicking on a place (a view scrollable from bottom with details).
You can also think about using a toolbar/expandingtoolbar

Android Map Clustering Using Polaris 2

I'm making an app for android and I'm using an android map to show about 15k markers from a WebService, the map gets really slow, I have searched around and find a solution "Clustering" but I can't implement it in my app, my map is running with the lib "Polaris 2" and I tried "ClusterKraf", but I had no results.
If someone has a better way to show the markers or some way to make clustering please help me.
I have been using Android Map Extensions and Clusterkraf, but finally decided implement the clustering by my self. The clustering could be written in a very simple way and you could get more control in how the elements are showing in the map, etc.
You can read my implementation of clustering in http://arnaldog.wordpress.com/2013/07/31/simple-clustering-with-android-maps-v2/.
I hope that helps you.
Polaris 2 does not have clustering implemented.
Both Clusterkraf and Android Maps Extensions mentioned by iaindownie have demo app on Google Play, which are also open source, so you can download the code from their project sites to try working solution. Then you can copy relevant code into your project.

How do I add markers to streets only - Android Development

After plenty of searching, I haven't yet found a solution that works for me and I'm really hoping someone here could help me. First I'll explain my problem, and then I'll mention some of the approaches I've attempted/considered so far.
Basically, I'm developing an Android app where markers randomly appear around the user's location. The catch is, the markers need to be placed on streets only.
I've been working with Google Maps Android API V2 but I'm trying to work around using anything with "limitations" such as 'geocoding'.
I've considered using different map API's such as Nutiteq but I've had some trouble implementing them. It would be nice to stick to Google since I've become familiar with it but I'm willing to try any suggestions you may have.
I have even considered loading up Google Maps API V3 in an html file so that I can use GDirections to load a path from one point to itself and then parse this data to Google Maps Android API V2 using JS but turns out GDirections has a limit as well.
Anyone have any idea how I can go about doing this? Even if the solution is hacky, it's still something.
I'm fairly new to Android Development.
Funny what you want to achieve. You don't need to load API V3 html. You can use directions api directly: http://maps.googleapis.com/maps/api/directions/json?origin=51,19&destination=51,19&sensor=false
It still has limitations, but is was like 2000 or something a day a device. And you don't want to put more than 2000 markers on single user's screen, do you?
This is easy to parse, for example with Gson.

Too many markers Google Maps

We added about 200 new markers in the MapView.
Now the app stucks and you cant use the MapView.
I heared about MarkerClusterer but did not found any more inforamation how to use MarkerClusterer with Android...or are there better solutions?
Can anyone give me a link or write a little turorial?
Thanks :)
You can have a look at this example Android project https://github.com/igorab/ManyPinsProject
It shows limited amount of markers depending on MapView zoom level.
Here is tutorial from Google https://developers.google.com/maps/articles/toomanymarkers
As #CommonsWare said it is only for JavaScript version or GoogleMaps, but may be you can find something useful there. For example, they have a link to MarkerClusterer js source code. Maybe you can find a way to adopt it to Android.
You can use this library – Android MapView Balloons. This project provides an easy way to annotate map overlay items with a simple information balloon when using the Android Maps.

Categories

Resources