I have for example:
http://pastebin.com/m70981c1a
http://boxes.x10hosting.com/poly-2.9.html
why can't this work (m7418 is the polygon):
var toggleState = 1;
function toggle() {
if (toggleState == 1) {
m7418.setMap(null);
toggleState = 0;
} else {
m7418.setMap(map);
toggleState = 1;
}
}
I've seen these examples for v2: http://mapperz.googlepages.com/poly_kml_updated.html,
http://www.nn4d.com/site/global/build/manuals/doku6058.jsp?id=ajax:2.0:tutorials:map_objects:polygon;
and this one for v3: http://home.provide.net/~bratliff/polycluster/v3/polygon.html;
I came here by way of this page :
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/de419c64c313bab8
and thought this might work. Thanks for any help.
On Feb 21, 6:56 am, אæα <alephael...@gmail.com> wrote:
>
> why can't this work (m7418 is the polygon):
>
The function looks fine but <input onClick="toggle();" ...
tries to find function toggle() from global scope. Now the function is
local to initialize() function.
You should take the function outside initialize(). Also I would
recommend using a browser with a javascript error console.