I'm interested to hear how others have handled the situation of a MapView with too many annotations. This seems like a pretty common thing that several app developers must run in to, but I haven't seen too many best practices or defined strategies for overcoming it.
You have an app that places an annotation at every gas station. When zoomed in to a pretty tight level, you may see a dozen or so pins. But the more you zoom out, the more you see, until it becomes problematic for both usability and performance.
My Idea (Feedback on this please)
Conceptually separate the MapView into a grid of 100 cells (10 high x 10 wide). When any cell contains more than X number of items, instead of displaying those annotations, display a single annotation [of a different color] centered in that cell. This annotation, when selected, displays how many items there are in this cell, and tells the user they need to zoom in. This annotation would also likely have a button that performed the zoom for them.
I also have a need for something like this.. but the points on my maps are fairly static. I was planning on handling this on a web page. But was thinking that using some kind of json file to create a map would also be an option. I would just refresh the JSON file from the web.
I was also going to use DRUPAL as my backend JSON and/or web server.
I have a similar situation. I have decided to limit the number of pins for each query. So I do SELECT … LIMIT 200. It seems like the map view can handle a lot of pins, just not adding a lot at a time. Are you seeing the same thing, or does the performance suffer for you just by having a certain number of pins present period?
I also allow the user to jump to another location at any time, and when I do that I call removeAllAnnotations() first so the old ones at the previous location are not kept in memory, just in case the number of pins present does affect the performance. If the user pans the map around I do add new ones as they go, but don't remove the old ones.
I'd like some help in this area too, to improve map view performance.
This isn't a solution but you can see how clustering annotations would look. Toward the bottom you'll see DTClusterMaker.
I have this issue too, I have over 900 POI's and its growing, adding markers on the map severely slows the device, removing the animations speeds up the process slightly, but still not good enough, I have got around it by only showing some of the markers at a time, they can be split by who owns them. But its not an ideal solution, I would much rather see a Titanium implementation of marker clustering.
Especially as a webview, whilst would work, doesn't have tight integration with passing data from a SQLite db, which is how I have stored my data.
However, if anyone has a working example they could share it would be so much appreciated, either via webview or native maps.
If one needs to many pins on a map, setting these with the client will eventually slowly and steadily kill your app.
If google offers layering with pixels in the bitmaps I am not certain about, but the tileserver we use in our company does. We used ESRI and put the pins on the tiles using layered maps on the ESRI server. I am not certain if the map functions in appCelerator supports this, but I am pretty certain the webView does.
Annotations are added on the client only for the pins visible in the display, limited to an amount which one safely can assume the client can handle.
I offer no solutions here, but adding more than a limited number of pins in a map on the client will eventually lead to a grinding halt on your device…
The only right solution is to use a clustering. In the web google map api world are lot of solutions. In relation of zoom level (in our world = region) a part of markers (in our world = annotations) will suppressed displaying of superfluouses annotations. There are a lot of rules to do this.
What we need is a annotations manager. It collects teh annotations and controls displaying of annoations.