views:

3324

answers:

5

Hi I have the address of a property and my application can launch a browser to go to http://maps.google.com?q=searchStringHere. If a good match is found it will take it directly there. Is there any thing I can append to the url to make it switch to streetview without having the exact coordinates? I dont't want to code any javascript or flash.

+3  A: 

Unfortunately not - there's no simple answer, based on the address.

Firstly, the list of parameters for the Google Maps site is documented here, so you can use that as your starting point.

The easy part is that you need to select the streetview layer "&layer=c".

However, before anything will display in that layer, you need to specify where your view is. You set the position by the latitude and longitude in cbll and the angle of the camera with some options in cbp.

To get the latitude and longitude from the address, you need to use a geocoding service, like the google maps api.

However, this will only get you a street view close to the address. In addition to knowing where the street view needs to be from, you also need to know which angle to point the camera at - this will be different for every address, depending on where the nearest point the StreetView camera took a photo from was, so it's not easy to do automatically (with any information that I know is available...)

Stobor
Thanks that site was what I was looking for. The problem is that streetview requires exact coordinates. The sollution was to first call it with output=kml, it sends back a simple xml then re call it with cbll= ...
Tim Matthews
Stobor
+3  A: 

Building a Google Street View URL

Basic Google Map URL http://maps.google.com/maps?q=

q= Query - anything passed in this parameter is treated as if it had been typed into the query box on the maps.google.com page.

Basic url to display GPS cords location

http://maps.google.com/maps?q=31.33519,-89.28720

http://maps.google.com/maps?q=&layer=c

layer= Activates overlays. Current options are "t" traffic, "c" street view. Append (e.g. layer=tc) for simultaneous.

http://maps.google.com/maps?q=&layer=c&cbll=

cbll= Latitude,longitude for Street View

http://maps.google.com/maps?q=&layer=c&cbll=31.33519,-89.28720

http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=

cbp= Street View window that accepts 5 parameters:

  1. Street View/map arrangement, 11=upper half Street View and lower half map, 12=mostly Street View with corner map

  2. Rotation angle/bearing (in degrees)

  3. Tilt angle, -90 (straight up) to 90 (straight down)

  4. Zoom level, 0-2

  5. Pitch (in degrees) -90 (straight up) to 90 (straight down), default 5

The one below is: (11) upper half Street View and lower half map, (0) Facing North, (0) Straight Ahead, (0) Normal Zoom, (0) Pitch of 0

This one works as is, just change the cords and if you want to face a different direction (the 0 after 11) http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=11,0,0,0,0

For more Google Street View code interpertation

A: 

Anyone know how to calculate what the cbll and cbp is for a property address?

cbp, no - you have to either guess or do it manually. cbll, though can be found using a geocoding service. See my answer for links.
Stobor
A: 

You can get the values by pressing the link button at the top of the street view.

rykk
A: 

DUDE THANK YOU!!!

Daniel