Re: Check if overlay exists so i can not be added twice or more
I don't think there is an easy way using the API (feel free to prove me
wrong).
The simplest solution for this particular case is to create a boolean
circleExists.
- Set it to true when you draw the circle
- Clear it when you remove the circle
- Don't let the circle be redrawn if its true
- Don't let the circle be removed if its false
It just gets complicated if you start having lots of different
overlays that you need to track.
BTW - your polyline doesn't work in IE. You need to read the API
documentation:
http://www.google.com/apis/maps/documentation/#XHTML_and_VML
-------------------------------------------------------------------------
If you want to show polylines on your map (like the lines used by
Google Maps to show driving directions), you need to include the VML
namespace and some CSS code in your XHTML document, to make everything
work properly in IE.
-------------------------------------------------------------------------
-- Larry
0 Comments:
Yorum Gönder
<< Home