street view icon popping up in my custom maps

422 views
Skip to first unread message

Mehmet

unread,
Oct 8, 2010, 2:03:57 PM10/8/10
to Google Maps JavaScript API v3
The Street View Pegman control (the one with the yellow man) started
to be displayed on the upper left in my custom maps, as of the past
few minutes (11:58 AM MST) and it's not going away unless i explicitly
set streetViewControl: false in map options, that includes setting
disableDefaultUI: true. Is this intended or just a bug? It's kinda
confusing for users of the maps which use custom tiles (that are not
necessarily corresponding to the standard street tiles).

Thanks,
Mehmet

mp-

unread,
Oct 8, 2010, 3:32:15 PM10/8/10
to Google Maps JavaScript API v3
Same here. Very annoying. How do I remove?

Mehmet

unread,
Oct 8, 2010, 4:21:50 PM10/8/10
to Google Maps JavaScript API v3
Set the streetViewControl parameter to false in map options object you
supply to the map constructor. For example:

var fenway = new google.maps.LatLng(42.345573,-71.098326);
var mapOptions = {
center: fenway,
zoom: 14,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
mapOptions);

There's a pretty good chance that the default value for
streetViewControl was set to true accidentally and this is an API bug,
considering it's the only control that shows up when you set
disableDefaultUI to true.

mp-

unread,
Oct 8, 2010, 4:36:29 PM10/8/10
to Google Maps JavaScript API v3
That doesn't work. Does it make a difference that I'm using a v3
STYLED map?

My code:

var myOptions = {
zoom: zoom,
center: latlng,
disableDefaultUI: true,
navigationControl: true,
scrollwheel: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT,
streetViewControl: false},
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var mapStyle =
[{featureType:"road.highway",elementType:"labels",stylers:
[{visibility:"simplified"}]}];

map = new google.maps.Map(document.getElementById("find-map"),
myOptions);
var styledMapOptions = {map: map};
var styleMapType = new google.maps.StyledMapType(mapStyle,
styledMapOptions);
map.mapTypes.set('minimial', styleMapType);
map.setMapTypeId('minimial');

Mehmet

unread,
Oct 8, 2010, 4:47:45 PM10/8/10
to Google Maps JavaScript API v3
If you set streetViewControl parameter to false inside the main
myOptions object instead of navigationControlOptions it should work.
For example try this:

var myOptions = {
zoom: zoom,
center: latlng,
disableDefaultUI: true,
streetViewControl: false
navigationControl: true,
scrollwheel: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL,
position: google.maps.ControlPosition.TOP_RIGHT
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
Reply all
Reply to author
Forward
0 new messages