With the button 'Toggle Visibility' I want to hide/show the polygon
'poly'.
I've seen the examples, but they're all for API V2. I need something
for V3.
I've tried some things with hide() but I'm not good with JS so I can't
make it on my own without some help...
What do I have to do to hide/show the polygons? Or isn't it possible
and do I have to stick to V2?
.setMap(null);
> Or isn't it possible
> and do I have to stick to V2?
What could possibly be the reasoning for having polygons that cannot
be removed after being added?
--
Marcelo - http://maps.forum.nu
--
.setMap(null) is good if you want to remove the polygon. But is there
any way to hide the polyline/gon?
I mean the equivalent of setVisible(true/false) for marker class.
Thank You
Julian
For that, you can add your own methods. See:
"Hiding and Showing an Overlay" in
http://code.google.com/apis/maps/documentation/v3/overlays.html#Polygons
--
Marcelo - http://maps.forum.nu
--
On 13 feb, 17:22, Marcelo <marcelo...@hotmail.com> wrote:
> On Feb 13, 4:46 pm, Grapefruit <ando...@gmail.com> wrote:
>
>
>
> > What do I have to do to hide/show the polygons?
>
> .setMap(null);
>
> > Or isn't it possible
> > and do I have to stick to V2?
>
> What could possibly be the reasoning for having polygons that cannot
> be removed after being added?
I use Maps as a map for my company, with different area's of
customers. I want to select different area's therefor.
I've tried this http://code.google.com/intl/nl/apis/maps/documentation/v3/overlays.html#HideShow
but I don't know how to translate this to my map and to my polygons...
On 13 feb, 17:22, Marcelo <marcelo...@hotmail.com> wrote:
> On Feb 13, 4:46 pm, Grapefruit <ando...@gmail.com> wrote:
>
>
>
> > What do I have to do to hide/show the polygons?
>
> .setMap(null);
>
This is working, but only when:
google.maps.event.addListener(poly, 'click', function() {
poly.setMap(null);
});
I want to let it disappear when I click on a button outside of the
map.
What do I need to put in the onClick=""? I can't figure it out...
I've tried onClick="remov()"
with
function remov() {
poly.setMap(null);
}
but then nothing is happening...
Yes, i'm a JS noob :)
1. This is not a forum for basic javascript.
2. Please read and follow the group's posting guidelines:
http://groups.google.com/group/google-maps-js-api-v3/browse_thread/thread/2b3f101fd509919e#
http://groups.google.com/group/Google-Maps-API/web/why-including-a-link-is-critical
My link is http://www.andorvb.nl/test2.html
If you click on the polygon, it disappears, just like it has to. When
you click on the other one, it appears again. But I want to do that
with the Remove!-link :)
On 13 feb, 22:32, Marcelo <marcelo...@hotmail.com> wrote:
> On Feb 13, 10:08 pm, Grapefruit <ando...@gmail.com> wrote:
>
>
>
> > but then nothing is happening...
> > Yes, i'm a JS noob :)
>
> 1. This is not a forum for basic javascript.
>
> 2. Please read and follow the group's posting guidelines:http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th...http://groups.google.com/group/Google-Maps-API/web/why-including-a-li...
>
> --
> Marcelo -http://maps.forum.nu
> --
--
Marcelo - http://maps.forum.nu
--
On Feb 13, 10:38 pm, Grapefruit <ando...@gmail.com> wrote:
> Yes, I know, but I can't find these things in tutorials (only simple
> things with alert () )
> I don't know how to refer to the google.maps. A simple link to a
> tutorial is enough, I want to do it myself :)
>
> My link ishttp://www.andorvb.nl/test2.html
> If you click on the polygon, it disappears, just like it has to. When
> you click on the other one, it appears again. But I want to do that
> with the Remove!-link :)
>
> On 13 feb, 22:32, Marcelo <marcelo...@hotmail.com> wrote:
>
>
>
> > On Feb 13, 10:08 pm, Grapefruit <ando...@gmail.com> wrote:
>
> > > but then nothing is happening...
> > > Yes, i'm a JS noob :)
>
> > 1. This is not a forum for basic javascript.
>
> > 2. Please read and follow the group's posting guidelines:http://groups.google.com/group/google-maps-js-api-v3/browse_thread/th......
BTW, is there a contextmenu available for V3?
On 13 feb, 23:27, Marcelo <marcelo...@hotmail.com> wrote:
> It's about scope. Unnest your functions and make your var map global:http://econym.org.uk/gmap/scope.htm
>
> --
> Marcelo -http://maps.forum.nu