Google Map V3 – Allow only one infobox to be displayed at a time

Change this part: google.maps.event.addListener(marker, “click”, function (e) {, this); }); var ib = new InfoBox(myOptions); google.maps.event.addListener(marker2, “click”, function (e) {, this); }); var ib2 = new InfoBox(myOptions2); to the following: var ib = new InfoBox(); google.maps.event.addListener(marker, “click”, function (e) { ib.close(); ib.setOptions(myOptions), this); }); google.maps.event.addListener(marker2, “click”, function (e) { ib.close(); ib.setOptions(myOptions2), … Read more

Decoding the Google Maps embedded parameters

This intermediate is not the final answer, and the sequel follows)), just some thoughts Undocumented method. (with ftid instead of place_id parameter) Places API Web Service No warranty in future: The documented request is: Need API KEY for this requests Setting up API keys Answer from Google: (JSON – light parsing) { “html_attributions” … Read more

How to offset the center of a Google maps (API v3) in pixels?

Found this question when researching and thought I should provide an answer: function map_recenter(latlng,offsetx,offsety) { var point1 = map.getProjection().fromLatLngToPoint( (latlng instanceof google.maps.LatLng) ? latlng : map.getCenter() ); var point2 = new google.maps.Point( ( (typeof(offsetx) == ‘number’ ? offsetx : 0) / Math.pow(2, map.getZoom()) ) || 0, ( (typeof(offsety) == ‘number’ ? offsety : 0) / … Read more

Googlemaps API Key for Localhost

Go to this address: Create new project and Create Credentials (API key) Click on “Library” Click on any API that you want Click on “Enable” Click on “Credentials” > “Edit Key” Under “Application restrictions”, select “HTTP referrers (web sites)” Under “Website restrictions”, Click on “ADD AN ITEM” Type your website address (or “localhost”, “”, … Read more

Google street view URL

Building a Google Street View URL Basic Google Map URL q= Query – anything passed in this parameter is treated as if it had been typed into the query box on the page. Basic url to display GPS cords location,-89.28720 layer= Activates overlays. Current options are “t” traffic, “c” street view. … Read more

Using initMap and initAutocomplete on same html page google maps

You can’t add multiple callbacks (and you shouldn’t include the API more than once). Put all the code in a single callback. <script src=”[API KEY]&signed_in=true&libraries=places&callback=initialize” async defer></script> function initialize() { initMap(); initAutoComplete(); } or see this example in the documentation function initialize() { initMap(); initAutocomplete(); } var map, marker; function initMap() { map = new … Read more