Roy C
Roy C

Reputation: 29

GoogleMaps JS can't load map anymore in China

In the app, we use Google Maps to provide services to users in different countries.


main code...

/// It works until February 4, 2020, but now it can't load the map correctly.
/// I haven't made any changes...
///
MapManager.loadGMapAPIScript = function(){

   var script = doc.createElement("script");
   script.id = "map_api_script";
   script.type = "text/javascript";
   script.src = "http://maps.google.cn/maps/api/js?sensor=false&v=3.40&key="my-googlemap-key-here"&callback=initialize_";
   script.defer = "true";
   script.async = "true";

   if(MapLanguage.language){

     script.src += "&language=" + MapLanguage.language;
   }

   doc.body.appendChild(script);
};

Console error log: "net::ERR_ABORTED 503 (Service Unavailable)"


Q: How can I continue to use GoogleMap-JS in China and other regions without VPN ?

Upvotes: 2

Views: 1240

Answers (1)

Art Dumas
Art Dumas

Reputation: 440

Google announced in November 2019 that maps.google.cn was going away on Feb 3, 2020. They told us to switch to using maps.googleapis.com with a region=CN query string parameter (other parameters were the same from what I recall).

But the new URI doesn't work. The JS file is blocked in China. I opened a support ticket yesterday and Google simply pointed me to the prohibited territory list last updated in May 2018. China is on the list which is very strange because maps.google.cn had worked for at least a couple of years. Google is being very cryptic in their response when I asked when this behavior was officially changed. I almost get the impression that Google maps was not ever supposed to work in China and the fact that it did was an accident.

Upvotes: 5

Related Questions