Link to Google Streetview using Lat / Long

I am trying to make an application that links to Google streetview using latitude / longitude coordinates and shows a street view of the nearest road. This comes from a rather small and well-covered area, so there will be no coordinates in the middle of the ocean.

Is there a published API showing the retrieval parameters needed to directly link to a street view?

+6
language-agnostic google-maps gis
source share
4 answers

You may be interested in learning the following link, which describes all the known parameters that can be transferred to maps.google.com, including Street View parameters:

Although this is not an official API, I consider it fair to say that they should be reliable enough, since they are the same parameters as for permalinks in Google Maps.

With this, you should be able to build something like the following:

http://maps.google.com/?cbll=40.714103,-74.006206&cbp=12,20.09,,0,5&layer=c

+17
source share

If you want to extract the original jpegs from the Streetview service, this can be done quite easily. The technique is discussed here:

http://jamiethompson.co.uk/web/2010/05/15/google-streetview-static-api/

The XML metadata for the panorama can be obtained from the following query

http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG] 

which will give you something like this:

 <panorama> <data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" pano_id="sLaiF6Jex7mJmNol7tdOoA" num_zoom_levels="3" lat="51.495090" lng="-0.146971" original_lat="51.495098" original_lng="-0.147000"> <copyright>© 2010 Google</copyright> <text>Eccleston Pl</text> <region>London, England</region> <country>United Kingdom</country> <data_flag>1</data_flag> </data_properties> <projection_properties projection_type="spherical" pano_yaw_deg="201.78" tilt_yaw_deg="92.06" tilt_pitch_deg="1.75"/> <annotation_properties> <link yaw_deg="204.7" pano_id="CeutxcyB2V74lfN_fJwRww" road_argb="0x80ffffff"> <link_text>Eccleston Pl</link_text> </link> <link yaw_deg="24.7" pano_id="t_mnKSugTLrQTEnJplXQ3A" road_argb="0x80ffffff"> <link_text>Eccleston Pl</link_text> </link> </annotation_properties> 

Pano_ids can then be used to get high-res thumbnails or tiles from the Streetview API

Icon

http://cbk0.google.com/cbk?output=thumbnail&w=416&h=208&panoid=sLaiF6Jex7mJmNol7tdOoA

Tile

http://cbk0.google.com/cbk?output=tile&panoid=sLaiF6Jex7mJmNol7tdOoA&zoom=4&x=0&y=3

+2
source share

Do you mean something like this ?

+1
source share

Below is a link to a street view image at coordinates 40.437, -79.962 (lat, lon):

http://maps.google.com/maps?f=q&hl=en&geocode=&sll=40.437965,-79.96253&sspn=0.007104,0.020084&layer=c&ie=UTF8&ll=40.437361,-79.960599&spn=0.007104,0.027129&z16=16.4&z -79.962101 & cbp = 2.142.0851621378081,,. 0.3.3364732946064946

I'm not sure why the coordinates are repeated several times, I suspect that this may have something to do with the viewing direction and the like. I did not check if this works for other coordinates. Hope this helps.

-one
source share

All Articles