I'm utilizing ActiveMQ to push objects onto a map.  As messages are
received a "database" on the client side is built to determine if this
is a new object, or just an update to an existing object.  Currently,
I'm removing the existing marker and then adding a new marker for an
updated.  This seems pretty in-efficient.  Any ideas?

if(marker!=null){ //it's an update
        markers.removeMarker(marker);
      icon = new
OpenLayers.Icon(message.getElementsByTagName("icon")[0].getAttribute('sr
c'),size);
      marker = new OpenLayers.Marker(new OpenLayers.LonLat(x,y),icon);
        _objDatabase.put(id, marker);
      markers.addMarker(marker);
}else{ //new item
        icon = new
OpenLayers.Icon(message.getElementsByTagName("icon")[0].getAttribute('sr
c'),size);
      marker = new OpenLayers.Marker(new OpenLayers.LonLat(x,y),icon);
        markers.addMarker(marker); 
        _objDatabase.put(id, marker); 
 }   



_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to