Google Maps API V3 - only shows a blank map when using a geocoder

So, I have javascript that uses the Google Maps V3 API and uses a geocoder to get the coordinates from the address and display the map in these coordinates. It worked perfectly fine, but then I check it a few days ago, and now instead of showing the correct map, it just shows a blank blue map and does not allow you to zoom in or move the map. There does not seem to be any javascript errors or errors returned from google maps, so it’s not entirely sure what might cause this ...

Here is an example of a problem: Click here

Anyone have any ideas on what could be causing this?

0
source share
1 answer

You are using undocumented properties:

var center = results[0].geometry.location.Xa - 0.0062;
var centerCoord = new google.maps.LatLng(center, results[0].geometry.location.Ya);

(geometry.Xa, geometry.Ya)

A crash is guaranteed at some point when the version of the API changes.

Use document properties (geometry.lat (), geometry.lng ())

+2
source

Source: https://habr.com/ru/post/1533842/


All Articles