Google Maps API指南:点击添加标注
2012-08-14 23:00
183 查看
<!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px } #map_canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"> </script> <script> var map; function initialize() { var myLatlng = new google.maps.LatLng(22.279566, 113.540955); var myOptions = { zoom: 12, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); google.maps.event.addListener(map, 'click', function(event) { placeMarker(event.latLng); }); } function placeMarker(location) { var marker = new google.maps.Marker({ position: location, map: map }); map.setCenter(location); } </script> </head> <body onload="initialize()"> <div id="map_canvas" style="width:100%; height:100%"></div> </body> </html>
相关文章推荐
- Google Maps API指南:点击添加标注
- Google Maps API指南:添加多个随机标注
- Google Maps API指南:地图标记与信息窗口
- Google Maps Data API-java开发指南
- Google_Maps_API_V3离线版实现简单标注
- Google Maps API 指南(http://www.econym.demon.co.uk/googlemaps/)
- Google Maps API指南:地图事件
- Google Maps API for Android 指南(一)
- Google Maps API指南:设置地图选项
- Google Maps API指南:在网页中嵌入GMaps
- Google Maps API:自定义Marker图标,为图标添加文字等信息
- 百度API 批量添加标注和监听标注点击事件
- Google Maps API 2.0解析(19-GArrow一直不为人知的一种标注)
- google font API 使用指南
- Google Maps API申请
- 国内使用Google Maps JavaScript API
- Google Maps API 2.0解析(1-API加载)
- Google AJAX Libraries API基础与使用指南
- GOOGLE地图基站定位-Google Mobile Maps API
- Google Maps API Web Services文档使用