Google지도는 China 방화벽에 의해 차단되었으므로 도메인 이름 http://maps.googleapis.com/maps/api/js?sensor=false&language=en에서 Google지도 API를 직접 인용 할 필요는 없지만 http://maps.google.cn/maps/jssodsors=false로 변경하십시오. 중국에있는 Google.CN의 도메인 이름은 차단되지 않았으며 사용할 수 있습니다.
참고 : Google.cn을 사용할 수 있지만 JS가 Google.com에 참조 한 리소스를 출력하여 맵 렌더링이 지연됩니다. 따라서 헤드 태그와 같이 Google Maps API를 콘텐츠 앞에 놓지 말고 콘텐츠 또는 HTML 엔드 태그에 넣을 때 페이지 컨텐츠가 비워지는 것을 방지하고 브라우저에 콘텐츠가 표시 될 수 없습니다.
Google.com 리소스가로드되고 Google.com 리소스가 가로 채기 때문에 Window.onload 이벤트를 사용하지 않거나 Google지도가 제 시간에 표시되지 않으므로 요청 시간 초과 (약 2 분)를 알고있는 경우에만 Google지도를 그릴 수 있습니다.
Google의 콜백 매개 변수를 사용하여 Window.onload 이벤트를 사용하는 것보다 Google지도를 더 빨리 렌더링하도록 테스트 된 콜백 기능 이름을 전달하십시오.
샘플 코드 :
<! doctype html public "-// w3c // dtd xhtml 1.0 transitional // en" "http://www.w.w.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"><Html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta http-equiv = "content-type"content = "text/html; charset = utf-8"/<title> sity maps 솔루션 : google.cn </head> <body id = "map_canvas": 350px; width : 500px; ">"> </div> </body> <script type = "text/javaScript"src = "http://maps.google.cn/maps/api/js?sensor=false&callback=rendergooglemap"</script> <script> {텍스트/javascript "> functionsform GeoCoder = 새로운 Google.maps.geocoder (); geocoder.geocode ({ 'address': 'Guilin City Center Square'}, 함수 (결과, 상태) {if (status == google.maps.geocoderstatus.ok) {map.setCenter (results [0] .geometry.location);} else ( "지오 코드는 다음 이유에 성공하지 못했습니다 :"}); var mapoptions = {Zoom : 17, mapTypeid : google.maps.maptypeid.roadmap}; var map = new Google.maps.map (Document.GetElementById ( "MAP_CANVAS"), MAPOPTIONS); } </script> </body> </html>