views:

281

answers:

5

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?

+1  A: 

Do you mean something like this?

npinti
This is good, but I'm linking from a flex application so I won't be able to use it.
Dan Monego
A: 

The following is a link to a streetview picture 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.027122&z=16&cbll=40.433975,-79.962101&cbp=2,142.0851621378081,,0,3.3364732946064946

I'm not sure why the coordinates are repeated a few times, I suspect it might have something to do with viewing direction and the like. I haven't checked whether this works for other coordinates. Hope this helps.

TumbleCow
+4  A: 

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

Daniel Vassallo
A: 

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&amp;w=416&amp;h=208&amp;panoid=sLaiF6Jex7mJmNol7tdOoA

Tile

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

WibblePoop
A: 

I'm using getPanoramaByLocation to create my link text, but I was wondering if anyone knew how to get rid of the large left-hand sidebar that appears in street view by default? I've checked mapki but no dice.

I've created a new question, here: get-rid-of-sidebar-when-linking-to-google-maps-streetview

Ian Grainger