【问题标题】:Adding Street View controls (the two icons just above the +) to a Google Map (v3)将街景控件(+ 上方的两个图标)添加到 Google 地图 (v3)
【发布时间】:2010-04-28 14:05:49
【问题描述】:

这可能很简单,但我在文档中找不到它,也找不到带有它的地图来检查它的来源...

我使用 API 的第 3 版

我想这是要在 myOptions 中添加的东西?

var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
                 zoom: 8,
                 center: latlng,
                 mapTypeId: google.maps.MapTypeId.ROADMAP
                }
map = new google.maps.Map(document.getElementById('map_canvas'), myOptions);

目前我只有拖动控件和缩放窗格控件。我也想要两个街景控件图标。

如果您想要完整的源代码,我将使用 this example 作为基础(您将如何在此示例中添加街景控件?)。

【问题讨论】:

    标签: javascript google-maps google-maps-api-3


    【解决方案1】:

    最近已将街景支持添加到 V3 API。

    在 MyOptions 中,您需要添加变量 streetViewControl: true。

    可从以下位置获得演示: http://homepage.ntlworld.com/keir.clarke/web/v3.htm

    信息也可从 V3 方法库中获得: http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-29
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多