Reputation: 21
I'm running into an issue the last couple of days on my website. When trying to switch to Street View on a map - after dropping the yellow man on a street - I get a grey screen (see screen grab). My console (on Chrome) shows this error, which pops up when doing the switch:
Uncaught TypeError: Cannot redefine property: Map at defineProperty () at pa (https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:3:229) at https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:7:1 at https://maps.googleapis.com/maps-api-v3/api/js/30/5/intl/en_gb/imagery_viewer.js:866:268
I had this problem in the past too, but I solved it by downgrading my google maps version. My init_map:
function init_map() {
var myOptions = {
zoom: 4,
center: new google.maps.LatLng(48.632909,17.138672),
panControl: true,
zoomControl: true,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU,
position: google.maps.ControlPosition.TOP_RIGHT
},
scaleControl: true,
streetViewControl: true,
gestureHandling: 'greedy',
mapStreetViewControlOptions: {
position: google.maps.ControlPosition.RIGHT_TOP
},
overviewMapControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var gmap = new google.maps.Map(document.getElementById("gmap"), myOptions);
I was working with the 3.29 and it was working fine, now, I have problems with Version 3.31:
<script src="maps.google.com/maps/api/js?v=3.31&key=....."; type="text/javascript"></script>
Upvotes: 1
Views: 617
Reputation: 195
We were facing the very same error string, but seen when loading just the embedded map itself. It appeared that we were redefining the function Map()
within another one of our (now unused) JS files, renaming this function resolved the issue.
I didn't come to this conclusion entirely on my own, see Google Product Forums for a user describing the very same issue as yourself.
Upvotes: 2