> "except it has never been added to the map at all "
>
> You are wrong on mouseover event it is added, and onmouseout i need to
> remove it.

Okay, let me try again:

> var polygon = new GPolygon(points, "#f33f00", 1, 1, "#ff0000", 0.1);

This creates a brand new GPolygon.  You might have created ten things
called 'polygon' before, but this isn't them.  This a new polygon.

> var polygon = new GPolygon(points, "#f33f00", 1, 1, "#ff0000", 0.1);
> if (r==0){
>   map.removeOverlay(polygon);

In the map.remove line, 'polygon' refers to the new GPolygon that you
have only just created, which hasn't yet been added to the map.
What you would like to do is not to remove the poly you just created,
but the one you created last time.

----

Anyway, that doesn't matter because the actual code in your page is
now nothing like the snippet posted to begin with.

>  www.globalwebdevelopment.net/aardbeving/test.php

> How to make a global reference???

You already have a few global variables in your script, to use as
examples -
       var side_bar_html = "";
outside of any function creates a global string, which you can then
refer to inside any function.
      side_bar_html += '<div id="+ .....

So use that as pattern to make something like
      var myCircle ;
and use that for your GPolygon

-- 
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.

Reply via email to