On Jan 6, 4:54 am, gordon zhao <[email protected]> wrote:
> Hi bratliff, I just have another silly question. How do I remove a
> polycluster from the map? If I set it invisible and draw another
> polycluster, it will show both of them. I know for other object I can use
> setMap(null) to remove it, and do you have similar function to do it?
> Thanks!
Typically, you never discard the entire PolyCluster. You can purge
individual polys with:
cluster.setPaths({polyname0:[],polyname1:[] , ... });
or
cluster.setPaths({polyname0:null,polyname1:null , ... });
You can also reload a poly with a different path.
The API uses one object per poly each with a separate "setMap".
PolyCluster uses one OverlayView to manage many polys in the same
"setMap".
You are correct about:
var point = {x:latlng.lng(),y:latlng.lat()};
Requiring every point of every poly to execute a "new
google.maps.LatLng()" constructor is insane, especially for large
polys. The application has to construct it. The API has to
deconstruct it through methods. It serves no purpose except to impede
performance. I have been unable to convince Google to offer an
alternative.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.