marker manager - 600+ markers

39 views
Skip to first unread message

corbanb

unread,
Jul 28, 2010, 12:16:52 PM7/28/10
to UMapper
Hi I have a map that will need to add 600+ locations to it for the
user to find locations on. Right now when I add all of them the map
performance is terrible. Is there a way to only show locations based
on a zoom and also on proximity to my current lat/long?

So at zoom 5 show locations with in X radius etc? Can this be done?

corbanb

unread,
Jul 29, 2010, 2:05:37 PM7/29/10
to UMapper
Basically I have written a method like the one below. Problem is it
doesn't handle the markers if they are groups:


public function showHideMarkers():void{

var i:uint = 0;
var l:uint = _locations.length;
var pos:LatLng;
var bounds:LatLngBounds = _map.getBoundsLatLng();
var marker:IOverlay;

for(i; i<l; i++){

marker = getObjectById(i) as IOverlay;
pos = marker.position; //fails for a grouping from a marker
manager

//hide or show marker based on position
if(bounds.containsLatLng(pos)){
marker.show();
}else{
marker.hide();
}

}

}

anyone have a good example of doing the same thing? It works fine if I
turn off the marker manager. but with it on it causes all kinds of
issues.

corbanb

unread,
Jul 28, 2010, 4:20:40 PM7/28/10
to UMapper
basically the way I understand it is, I need to remove all markers on
zoom_start and try to re-add them based on the
bounds.containsLatLng(pos) on zoom_end.

but i am having issues 1 getting the zoom events to fire on the map as
well as removing the marker manager.



On Jul 28, 12:16 pm, corbanb <corb...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages