Hello,
I am pulling my hair our for more then 4 days.
I can create circle overlays perfectly, but removing them?? noway. I
thnk this is a bug in V2, can someone please help?
This is the function im using:
function test (x,y,r)
{
var center = new GLatLng(x,y);
var radius = r;
var latOffset = 0.01;
var lonOffset = 0.01;
var latConv = center.distanceFrom(new GLatLng(center.lat()+0.1,
center.lng()))/100;
var lngConv = center.distanceFrom(new GLatLng(center.lat(),
center.lng()+0.1))/100;
// nodes = number of points to create circle polygon
var nodes = 40;
//Loop
var points = [];
var step = parseInt(360/nodes)||10;
for(var i=0; i<=360; i+=step)
{
var pint = new GLatLng(center.lat() + (radius/latConv * Math.cos(i *
Math.PI/180)), center.lng() + (radius/lngConv * Math.sin(i * Math.PI/
180)));
// push pints into points array
points.push(pint);
}
var polygon = new GPolygon(points, "#f33f00", 1, 1, "#ff0000", 0.1);
if (r==0){
map.removeOverlay(polygon);
} else {
map.addOverlay(polygon);
}
} // end
When im using it like:
test(x,y,600);
Then it makes a nice circle, but to remove it:
test(x,y,0);
it does NOTHING, but really nothing.
Please help someone
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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-api?hl=en.