开发者

Adding Street View controls (the two icons just above the +) to a Google Map (v3)

开发者 https://www.devze.com 2022-12-28 16:59 出处:网络
It\'s probably something really simple, but I can\'t find it in the docs and I can\'t find a map with it to check it\'s source...

It's probably something really simple, but I can't find it in the docs and I can't find a map with it to check it's source...

I use version 3 of the API.

I guess it's an something to add in开发者_运维技巧 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);

Currently I only have dragging controls and the zoom pane controls. I would like to have the two Street View controls icons too.

If you want full source, I'm using this example as a base (how would you add Street View controls to this example?).


Streetview support has recently been added to the V3 API.

Within MyOptions, you will need to add the variable streetViewControl: true.

A demonstration is available from: http://homepage.ntlworld.com/keir.clarke/web/v3.htm

Information is also available from the V3 methods library: http://code.google.com/apis/maps/documentation/javascript/reference.html#MapOptions

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号