How to show/hide the pegman on a map (not the control)?

1,564 views
Skip to first unread message

Fred Janon

unread,
Apr 19, 2013, 11:54:03 AM4/19/13
to google-map...@googlegroups.com
Hi,

I have a map and a streetview panorama side to side. I associate the panorama created with new google.maps.StreetViewPanorama with the map, no issue there with map.setStreetView(panorama).

I want to be able to show/hide the pegman on the map (not the control) at will, since it is over a marker that the user should be able to move.

The only way I found so far is to map.setStreetView(null), but for some reason the streetview is then hidden when I do that. If I force the panorama.setVisible(true), it's missing the streetview images, they reappear when I move with the streetview controls in the panorama.

Is there a way to show/hide the pegman on the map?

Thanks

Fred

Pil

unread,
Apr 24, 2013, 2:33:59 PM4/24/13
to Google Maps JavaScript API v3
You can use the official sprite imgee for the pagman, for example this
one

http://maps.gstatic.com/intl/en_ALL/mapfiles/cb/mod_cb_scout/cb_scout_sprite_004.png

You'd have to find the coords of the image you want to use. That's not
so time consuming as it seems at first sight.

Fred Janon

unread,
Apr 26, 2013, 10:18:24 AM4/26/13
to google-map...@googlegroups.com
Thanks, but that's not really my question.

Assuming the pegman is already on a map (associated with a StreetView) how can I hide and show it with some JS code, say like "map.hideStreetViewMarker()" or something similar.



--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-maps-js-a...@googlegroups.com.
To post to this group, send email to google-map...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages