I'm currently using android-map-extensions to cluster markers on google map. However, sometimes two markers are clustered when they are really far, sometimes they have to be almost overlapping each other to be clustered together. I've been trying to wrap my head around this for a couple of days and haven't figured it out. Below is the examples (btw, sorry for the bad english and I don't have enough reputation to post images so imgur to the rescue):
should already clustered : http://imgur.com/MxyN9VI
should not clustered until zoom out far enough (1-2 more zoom level) : http://imgur.com/hVzMQfD
How can I fix this, changing the clusterSize as document does not really help
Android Maps Extensions uses grid based clustering and what you describe is part of how it works.
You have a couple of options:
writing your own clustering strategy for it (e.g. distance based)
finding a proper clusterSize for your case; this might work if all your markers have fixed and static positions; keep in mind choosing between 128 and 128.1 can make a big difference
trying out a different library, e.g. Clusterkraf or Android Maps Utils, which use distance based clusering
Disclosure: I'm a developer of Android Maps Extensions
Related
I use the util library maps android for Cluster item.
I have many marker but It's too slow on navigation.
Is there a way to optimize this apps?
You can see this video : https://youtu.be/lboDrBmI6xo
Here are suggestions to Optimize Maps with Many
Makers:
One approach at simplification is to render markers on the server. Google provides two services built into the API that make this easy to
achieve: FusionTablesLayer and KmlLayer. If you'd prefer to perform
computations on your own server, this can be accomplished by creating
a custom overlay from imagery that is pre-rendered, or rendered on the
fly.
Another useful optimization technique involves viewport marker management: restricting the markers rendered on the map into only
those that exist within the viewable area.
If you still want to display many markers on the map, consider creating a custom overlay that displays markers with minimal
functionality. This approach may garner performance improvements over
standard markers provided by the API.
Read more on the docs for optimization tips.
I believe that marker clustering is the way to go on Android and we have a utility library to use for this. You can check it out here
I'm trying to add a lot of data to a google map (local 3MB+ kml file, will probably be more). I have tried using the KML-layer, but showing all these data seems to use a lot of processing power, so the application/map is getting laggy when scrolling around.
I tried splitting the KML file up into smaller files and loading them according to the camera's position, but I'm still having these performance issues. I also want to show most of the data when the users zoom level is low, so this is not an optimal solution anyway.
I have looked a bit into google fusion layers. Google fusion layers seems to have better performance but is only included in the javascript API for google maps.
Will GEO-JSon improve the performance significantly?
Do you have any tips in how I can encounter this problem? Thanks in advance.
I feel i have to answer my own question here. I tried using Geo-Json instead of KML and it increased the performance significantly. Together with Marker clustering from the google utility library i now have a pretty good solution.
I experienced some problems with placing a lot of polylines to the map, and it caused the app to skip alot of frames, but by adding them one by one with 10ms delay it worked pretty good.
I have a lot of points to show on Google Maps Android. I decided to draw them on the map by drawing circles with small radiuses. However, I noticed that drawing a lot of circles (around 1000) is very slow and the app does not respond well, even when the drawing is made in an AsyncTask.
Any ideas how to get around this?
The best way is to only plot what you can see on the map and when the map moves get the new points you can see so that you eventually dont have to plot anymore.
You can also look into clustering where if you have a bunch of markers in a certain area you can indicate a group of markers by just plotting one marker
this link goes over the different method you can use
https://developers.google.com/maps/articles/toomanymarkers
Consider using Markers instead and one of the clustering libraries freely available:
Android Maps Extensions
Clusterkraf
Android Maps Utils
If you are convinced you want to use Circles, you may try to use one of the libs and modify code to group Circles.
I'm trying to make an app that uses Google maps API mapviews and my problem is that when building the app I realized that the roads on Google maps scale down on zoom in and wondering if there is any way to disable this scaling as I want the full size of the roads on maximum zoom. Hopefully this picture will clear any misunderstandings:
I don't believe that you will be satisfied with the result from what you are trying to do, fixing the zoom to a specific value, which will resukt in a very pour user experience ...
But if you really want to give it a try, just use the one of the solutions in this post
good luck.
I saw these maps in the websites of some universities and I just loved them:
http://www.uottawa.ca/maps/
http://www.washington.edu/maps/
http://map.nd.edu/#/placemarks//zoom/16/lat/41.6993288511065/lon/-86.23415926449582
I would really like to do something like that in an Android app. I've been looking for a way to do it but I've found no clue. Since I'm new to this API I feel quite disoriented.
So, could you please point me in the right direction? Give me some hints, somo tutorials or whatever you think it can be useful.
You can get the mapview easily enough using the Google Maps API. Then you need images of whatever buildings you are proposing to put on the map. The images can be added to a map overlay which will appear on top of the map. The tricky part then, is to match the geo-coordinates of your buildings to the map so that when a user scrolls the map, the images move as well and also to scale the images as the user zooms in and out.