Link to Google Streetview using Lat/Long
Solution 1
You may be interested in checking out the following reference, which describes all the known parameters that can be passed to maps.google.com, including Street View parameters:
While this is not an official API, I think it is fair to say that these should be quite reliable, since they are the same parameters used for the permanent links in Google Maps.
With this, you should be able to construct something like the following:
http://maps.google.com/?cbll=40.714103,-74.006206&cbp=12,20.09,,0,5&layer=c
Solution 2
If you want to extract the raw jpegs from the Streetview service this can be done fairly easily. The technique is discussed here:
http://jamiethompson.co.uk/web/2010/05/15/google-streetview-static-api/
XML metadata for a panorama can be gained from the following request
http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG]
which gets 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>
The pano_ids can then be used to get thumbnails or high resolution tiles from the streetview API
Thumbnail
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
Solution 3
Do you mean something like this?
jojomojo
Updated on June 21, 2022Comments
-
jojomojo almost 2 years
I'm trying to make an app that links to Google streetview using latitude/longitude coordinates, and shows a streetview of the nearest road. This is coming from a fairly small and well covered area, so there isn't going to be any coordinates in the middle of the ocean.
Is there a published API showing the get parameters you need to link directly to streetview?
-
jojomojo almost 14 yearsThis is good, but I'm linking from a flex application so I won't be able to use it.
-
James South about 9 yearsEvery link on this answer is now broken.