Get the new InfoWindows square using Google Maps?

I am creating a website that primarily serves as a map search and shows professional wrestling competitions in the UK. I am using the v3 JavaScript API for Google Maps for this, but I have a question why my InfoWindows application looks different than InfoWindows on maps.google.co.uk .

Compare the following two screenshots. Mine:

enter image description here

And the Google Maps website:

enter image description here

Why does the Google Maps site have an InfoWindows square, and why is my application using the latest version of the JavaScript Maps JavaScript API rounded up by InfoWindows?

+4
source share
2 answers

Martin,

I went to a demo of the Google Maps API and found this demo:

http://gmaps-samples-v3.googlecode.com/svn/trunk/geocoder/v3-geocoder-tool.html#q%3D42.032974%2C-90.703125

You should see the InfoWindow square.

I looked under the hood and found the code below, maybe the border of your window. Hope this helps.

var openInfoWindow = function(resultNum, result, marker) { return function() { if (selected != null) { document.getElementById('p' + selected).style.backgroundColor = "white"; clearBoundsOverlays(); } map.fitBounds(result.geometry.viewport); infowindow.setContent(getAddressComponentsHtml(result.address_components)); infowindow.open(map, marker); if (result.geometry.bounds) { boundsOverlay = new google.maps.Rectangle({ 'bounds': result.geometry.bounds, 'strokeColor': '#ff0000', 'strokeOpacity': 1.0, 'strokeWeight': 2.0, 'fillOpacity': 0.0 }); boundsOverlay.setMap(map); google.maps.event.addListener(boundsOverlay, 'click', onClickCallback); document.getElementById('boundsLegend').style.display = 'block'; } else { boundsOverlay = null; } viewportOverlay = new google.maps.Rectangle({ 'bounds': result.geometry.viewport, 'strokeColor': '#0000ff', 'strokeOpacity': 1.0, 'strokeWeight': 2.0, 'fillOpacity': 0.0 }); viewportOverlay.setMap(map); google.maps.event.addListener(viewportOverlay, 'click', onClickCallback); document.getElementById('viewportLegend').style.display = 'block'; document.getElementById('p' + resultNum).style.backgroundColor = "#eeeeff"; document.getElementById('matches').scrollTop = document.getElementById('p' + resultNum).offsetTop - document.getElementById('matches').offsetTop; selected = resultNum; } } 
+5
source

Just a small note. This means that the v2 API now has square info windows. I have the same question. But perhaps this will also be fixed automatically on v3 soon.

+1
source

All Articles