在谷歌关闭中显示谷歌地图

时间:2011-09-26 07:24:59

标签: google-maps google-closure

如何在Google Closure中显示地图。似乎有许多UI小部件,但没有用于显示地图

1 个答案:

答案 0 :(得分:2)

我很困惑。由于Google Closure是一个javascript库,您不能只使用Google Maps Javascript API吗?类似的东西:

<script type="text/javascript" src="http://maps.googleapis.com/maps/ap/js?sensor=set_to_true_or_false">
</script>
<script type="text/javascript">
  function initialize() {
    var latlng = new google.maps.LatLng(-34.397, 150.644);
    var myOptions = {
       zoom: 8,
       center: latlng,
       mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  }

然后您可以将document.getElementById()更改为您需要的任何内容。

参考:Google Maps Javascript API

相关问题