{"id":76,"date":"2006-04-28T11:22:00","date_gmt":"2006-04-28T03:22:00","guid":{"rendered":"http:\/\/behindgfw.com\/archives\/2006\/04\/gmap.html"},"modified":"2016-05-03T20:51:30","modified_gmt":"2016-05-03T12:51:30","slug":"gmap","status":"publish","type":"post","link":"https:\/\/www.behindgfw.com\/archives\/2006\/04\/gmap.html","title":{"rendered":"Gmap"},"content":{"rendered":"<p>\u7528Gmap api\u505a\u4e86\u5f20\u5730\u56fe\uff0c\u53ef\u662f\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff0c\u5728firefox\u4e0b\u663e\u793a\u6b63\u5e38\uff0c\u5728ie\u4e0b\u6d4f\u89c8\u5668\u4f1a\u91cd\u7f6e\uff0c\u8c03\u8bd5\u4e86\u534a\u5929\uff0c\u4e5f\u6ca1\u641e\u5b9a\uff0c\u5148\u53d1\u4e86\u518d\u8bf4\u3002\u4ee3\u7801\u5982\u4e0b\uff1a<br \/>\u4ee3\u7801\u5f00\u59cb<\/p>\n<blockquote dir=\"ltr\" style=\"margin-right: 0px;\"><p>  &lt;script type=&#8221;text\/javascript&#8221; src=&#8221;http:\/\/maps.google.com\/maps?file=api&amp;v=2&amp;key=ABQIAAAA43IALmfadaZgVb1L-IEizRT2DsZWTaQwEcLbsDtQz1jnLAblVRRx2_bEwFhsxfHsq9k-5A0PT7xjxw&#8221;&gt;<br \/>  &lt;\/script&gt;<\/p>\n<p>  &lt;div id=&#8221;map&#8221; style=&#8221;width: 600px; height: 400px;&#8221;&gt;&lt;\/div&gt;<\/p>\n<p>  &lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>  \/\/&lt;![CDATA[<br \/>if (GBrowserIsCompatible()) {<\/p>\n<p>  var map=new GMap(document.getElementById(&#8220;map&#8221;));<br \/>  map.addControl(new GSmallMapControl());<br \/>  map.addControl(new GMapTypeControl());<br \/>  map.setMapType(G_HYBRID_TYPE);<br \/>  map.centerAndZoom(new GPoint(121.5581,29.8394), 8);<\/p>\n<p>  \/\/ Create a base icon for all of our markers that specifies the<br \/>  \/\/ shadow, icon dimensions, etc.<br \/>  var baseIcon = new GIcon();<br \/>  baseIcon.shadow = &#8220;http:\/\/www.google.com\/mapfiles\/shadow50.png&#8221;;<br \/>  baseIcon.iconSize = new GSize(20, 34);<br \/>  baseIcon.shadowSize = new GSize(37, 34);<br \/>  baseIcon.iconAnchor = new GPoint(9, 34);<br \/>  baseIcon.infoWindowAnchor = new GPoint(9, 2);<br \/>  baseIcon.infoShadowAnchor = new GPoint(18, 25);<\/p>\n<p>  \/\/ Create a lettered icon for this point using our icon class<br \/>  var letter = String.fromCharCode(&#8220;A&#8221;.charCodeAt(0) + 25);<br \/>  var icon0 = new GIcon(baseIcon);<br \/>  icon0.image = &#8220;http:\/\/www.google.com\/mapfiles\/marker&#8221; + letter + &#8220;.png&#8221;;<\/p>\n<p>  var ningbo = new GMarker(new GPoint(121.5581,29.83941),icon0);<br \/>  GEvent.addListener(ningbo, &#8220;click&#8221;, function(){<br \/>    ningbo.openInfoWindowHtml(&#8220;\u7f8e\u5973\u554a\uff0c\u6211\u7231\u4f60\u5566\uff01&#8221;);<br \/>  });<br \/>  map.addOverlay(ningbo);<\/p>\n<p>  \/\/ Create a lettered icon for this point using our icon class<br \/>  var letter = String.fromCharCode(&#8220;A&#8221;.charCodeAt(0) + 24);<br \/>  var icon = new GIcon(baseIcon);<br \/>  icon.image = &#8220;http:\/\/www.google.com\/mapfiles\/marker&#8221; + letter + &#8220;.png&#8221;;<\/p>\n<p>  var zhoushan = new GMarker(new GPoint(122.1018,30.0207),icon);<br \/>  GEvent.addListener(zhoushan, &#8220;click&#8221;, function(){<br \/>    zhoushan.openInfoWindowHtml(&#8220;\u4f60\u8bf4\u4ec0\u4e48\u554a\uff1f\u6211\u996d\u5403\u8fc7\u5566\uff01&#8221;);<br \/>  });<br \/>  map.addOverlay(zhoushan);<\/p>\n<p>}<br \/>  \/\/]]&gt;<br \/>&lt;\/script&gt;<\/p>\n<p><\/p>\n<\/blockquote>\n<p>\u4ee3\u7801\u7ed3\u675f<\/p>\n<p>    google\u7684api\u6587\u6321\u91cc\u9762\u7684\u5b9e\u4f8b\u4f7f\u7528\u4e86<br \/><br type=\"_moz\"\/><\/p>\n<blockquote style=\"margin-right: 0px;\" dir=\"ltr\">\n<pre class=\"code\">  &lt;body onload=\"load()\" onunload=\"GUnload()\"&gt;<br\/>    &lt;div id=\"map\" style=\"width: 500px; height: 300px\"&gt;&lt;\/div&gt;<br\/>  &lt;\/body&gt;<\/pre>\n<\/p>\n<\/blockquote>\n<p>\u6211\u4f30\u8ba1\u9519\u8bef\u5c31\u51fa\u73b0\u5728\u8fd9\u4e2a\u5730\u65b9\uff0cdonews\u7684\u6a21\u677f\u6211\u597d\u8c61\u8bbe\u7f6e\u4e0d\u4e86body onload\u3002<\/p>\n<p><br type=\"_moz\"\/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7528Gmap api\u505a\u4e86\u5f20\u5730\u56fe\uff0c\u53ef\u662f\u53d1\u73b0\u4e00\u4e2a\u95ee\u9898\uff0c\u5728firefox\u4e0b\u663e\u793a\u6b63\u5e38\uff0c\u5728ie\u4e0b\u6d4f\u89c8\u5668\u4f1a\u91cd\u7f6e\uff0c\u8c03\u8bd5\u4e86\u534a\u5929\uff0c [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[51,21],"class_list":["post-76","post","type-post","status-publish","format-standard","hentry","category-google","category-webdev","tag-googlemaps","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/76","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/comments?post=76"}],"version-history":[{"count":1,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":586,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/posts\/76\/revisions\/586"}],"wp:attachment":[{"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/media?parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/categories?post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.behindgfw.com\/archives\/wp-json\/wp\/v2\/tags?post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}