We are displaying a number of markers on a Google Map V2 in a browser window in a Delphi application. This has worked since 2010 when the feature was developed. However, the markers have just stopped showing on the map. We obtained a licence key from Google when we set up the project. There are notes on the Goggle Maps site about quotas being exceeded and asks you to go to your console to view. However, we can see no way of doing this.
Our code was copied from examples and uses the following template
<!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Google Maps JavaScript API Example</title> <script src="http://maps.google.com/maps?file=api&v=2&key=<#KEY>&sensor=false" type="text/javascript"></script> <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { function createMarker(point,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; } var map = new GMap2(document.getElementById("map_canvas")); map.setCenter(new GLatLng(<#LAT>, <#LONG>), <#ZOOM>); map.setUIToDefault(); <#MARKERS> } } </script> </head> <body onload="initialize()" onunload="GUnload()"> <div id="map_canvas" style="width:<#WIDTH>px; height: <#HEIGHT>px"></div> </body> </html>
The %s placeholders are Lat, Long and the link to the markers detailed information.
Any one any idea why this should have stopped working. I know that we are being encouraged to migrate to v3 of the API, but I have had no information on v2 being turned off.
Many thanks
Roger
JavaScriptWeb Development
Last Comment
rogerfg7
8/22/2022 - Mon
COBOLdinosaur
If you are getting a message about exceeding quotas, then you need to contact Google support to find out how to increase the quotas. They will probably tell you that you need a paid premium version.
Cd&
rogerfg7
ASKER
No message about exceeding quotas, just markers not appearing.
Roger
Chris Stanyon
You need to switch to version 3. Version 2 was turned off on 19 November (2ish weeks ago).
v3 seems to need to create a separate infowindow for each marker and Listener events for each marker, requiring each marker and infowindow to receive a unique name
'var marker1 = new google.maps.Marker({'+'position: new google.maps.LatLng(<Lat>, <Long>),'+'title: <Title>, map: map});'+'var infowindow1 = new google.maps.InfoWindow({content: <Info>});'#13+'google.maps.event.addListener(marker1, ''click'', function() {'+'infowindow1.open(map,marker1);});'
Sorry, showing my unfamiliarity with JavaScript. I have made the wrapper and simplified the call for each point. Works fine. Just need to get the nice rounded corners that the V2 infowindow had! Many thanks.
Cd&