views:

377

answers:

2

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?).

+1  A: 

As far as I am aware, V3 does not currently support Street View. Unless you have a specific reason for using V3 - I would highly suggest working inside of Google Maps V2 - as it is not in beta and has many more features to work with.

Last year Maps V2 released support for adding StreetView objects into a V2 Map.

I do believe it would be possible to accomplish this by creating a sort of hybrid, using both V2 and V3 - but I wouldn't really recommend doing something like that - considering it will load a lot of extra scripts and populate quite a bit of extra Javascript Objects. Doing this would also add another level of complexity to something that could be accomplished pretty easily just using V2.

Are there any particular features you are using in V3 that are not available in V2? If not, try using V2! :)

John
I use v3 to learn the new API not really to use new features. There are some new things that make common problems much more easier to solve (like zooming the map to show all markers).
AlexV
+2  A: 

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

thewinchester