Google地图API V3 Javascript基本示例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Google地图API V3 Javascript基本示例相关的知识,希望对你有一定的参考价值。
This javascript will create a google map on the div with the ID "the_map" and centered on an address with a marker on it. In this example the address is for Jet City Improv. More information on setup and customization at the link.
window.onload = function(){ var geocoder = new google.maps.Geocoder(); geocoder.geocode({'address':'5510 University Way NE Seattle, WA 98105'},function(result,status){ if(status==google.maps.GeocoderStatus.OK){ var map = new google.maps.Map(document.getElementById("the_map"),{ 'center': result[0].geometry.location, 'zoom': 14, 'streetViewControl': false, 'mapTypeId': google.maps.MapTypeId.TERRAIN, 'noClear':true, }); new google.maps.Marker({ 'map': map, 'position': result[0].geometry.location, }); }else{ alert('Address not found!'); } }); }
以上是关于Google地图API V3 Javascript基本示例的主要内容,如果未能解决你的问题,请参考以下文章
[转]MBTiles 离线地图演示 - 基于 Google Maps JavaScript API v3 + SQLite
google maps js v3 api教程 -- 创建一个地图
google maps js v3 api教程 -- 在地图上添加标记