请先查看此地图: Google Map
接下来,将此代码放入新的.htm文件中并在同一浏览器中查看:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<style type="text/css">
html { height: 100%; width: 100% }
body { height: 100%; width: 100%; margin: 0; padding: 0 }
#map_canvas { height: 100%; width: 100% }
</style>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?v=3.16"></script>
<script type="text/javascript">
function initialize() {
var map_canvas = document.getElementById('map_canvas');
var map_options = {
center: new google.maps.LatLng(40.2956686,-111.7006661),
zoom: 12,
mapTypeId: google.maps.MapTypeId.SATELLITE
};
var map = new google.maps.Map(map_canvas, map_options);
map.setTilt(45);
};
google.maps.event.addDomListener(window, 'load', initialize);
</script>
</head>
<body>
<div id="map_canvas" />
</body>
</html>
我的问题是,为什么Google地图有更多倾斜度选项甚至是倾斜图标,但我使用Google Map JavaScript API创建的地图在这个缩放级别不会倾斜?我的经理希望我创建类似Google帖子中链接的内容,而不是我使用Google Map JavaScript API创建的内容。我应该使用什么API?我已经尝试过检查Google Map JavaScript代码了,这让我无法理解。
答案 0 :(得分:2)
因为Google地图和Google Maps API v3由不同的团队共同维护,并且目标不同。谷歌地图旨在为最终用户,而谷歌地图API旨在为开发人员。此外,谷歌希望保持优势,支持平台,因此没有开发人员从谷歌地图中窃取临时用户。
此外,在Google地图中推出新功能比将它们集成到API中更容易,所有文档都必须遵循语法层次结构。他们只需要将新代码作为插件包含在内,而Google Maps API库必须将所有内容集成到其核心中。
其中一些功能确实可以用于谷歌地图API。其中有些人没有。