Google Maps API非官方中文版基于Google地图中文版。由于并非官方发布,所以无法保证长期有效。我只能保证在不违反Google TOS的条件下尽量保证升级,以方便大家使用。
调用此库的方法为
- <script src="http://api.gmap2.net/gmap2.cn.js" type="text/javascript"></script>
以下是关于本API的几点说明
下面代码是一个demo(点击查看实例)
- <!DOCTYPE html PUBLIC "-//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://api.gmap2.net/gmap2.cn.js" type="text/javascript">
- <script type="text/javascript">
- //<![CDATA[
- function load() {
- if (GBrowserIsCompatible()) {
- var map = new GMap2(document.getElementById("map"));
- map.setCenter(new GLatLng(39.92, 116.46), 13);
- map.addControl(new GMapTypeControl());
- }
- }
- //]]>
- </script>
- </head>
- <body onload="load()" onunload="GUnload()">
- <div id="map" style="width: 500px; height: 300px"></div>
- </body
