【发布时间】:2014-11-08 04:14:53
【问题描述】:
我想做的是使用google api来获取用户在地图上触摸的点的地理位置。
我所拥有的只是基本的 html:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyA86_aRT8-Gh0fCGcAYCq24UtqLvKAFYAY">
</script>
<script type="text/javascript">
function initialize() {
var mapOptions = {
center: { lat: 52.9507709, lng: -1.1746545},
zoom: 20,
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>
问候
【问题讨论】:
-
你能快点提琴吗?
标签: javascript html google-maps