Loading Google Street View Image API by panorama ID rather than location
Asked Answered
H

3

5

The Street View image API, as documented here, gives static images for a particular location. However, it does not accept a panorama ID parameter for loading specific panoramas.

Recent additions to Google Maps' Street View imagery have been "off the map", and only accessible via the panorama id (the panoid URL parameter), such as these hot-tub monkeys or this donkey. If you remove the panoid from the URL then the monkeys don't load. For comparison, this picture of a tree doesn't need the panoid to load the streetview panorama.

This same behaviour is seen when loading these panoramas via the API. The Google Maps API docs has the following to say about the panoid:

Returns the current panorama ID for the Street View panorama. This id is stable within the browser's current session only.

However, as shown above with the monkeys the panorama id is not tied to the current session.

My problem is that the Google Street View Image API doesn't accept the panoid, so there is no way I can find to get a static image of the monkeys. The static image of the tree works, but I get "no imagery" for the monkeys.

Why are these streetviews not available on the API by location, and is there a way to load static images from the panorama ID?

Horseplay answered 18/7, 2012 at 8:47 Comment(0)
H
5

I think its a bit of a hack but here are your monkeys:

http://cbk0.google.com/cbk?output=thumbnail&w=500&h=500&panoid=-_0l0tU3lKz0JtaEsqJk7w

I used this site as a reference

Hydroponics answered 18/7, 2012 at 10:47 Comment(3)
Thanks, it's a start, but that thumbnail service has a load of other drawbacks. I'd rather use the official API if they just supported the panoids.Horseplay
you can also just use the normal maps url eg: maps.google.com/…Rebozo
What you suggest here is incorrect. Requests to cbk0.google.com/cbk? are NOT part for a public API, and therefore not dependable. The other answer links to the actual API (maps.googleapis.com/maps/api/streetview) which is the correct thing to do.Wolk
K
2

You are missing three parameters: pov, heading and pitch so that you cannot see the monkey image.

When calling the street view image API using a pano id, try use &pano=#panoid.

The monkey

Kasi answered 16/2, 2016 at 18:37 Comment(0)
B
2

Here is the url which uses PanoID

https://maps.googleapis.com/maps/api/streetview?size=300x150&pano=YOUR_PANOID&heading=0&pitch=0&key=YOUR_API_KEY

You can move the panorama view by providing the heading value. Which is default zero in above example.

Bear answered 14/12, 2016 at 9:16 Comment(2)
Since the new IDs are longer, do have slashes and are sometimes used starting with "F:-", sometimes not, I'm curious how exactly the ID should be formatted. None of my patterns did work. Can you describe how exactly to format the PanoID?Cormac
Please note that there is a bug in existing streetview images api, which will not return an image when you pass the new longer panoID, specifically the ones with F:- (photosphere). The bug report can be found here: issuetracker.google.com/issues/35831151Bear

© 2022 - 2024 — McMap. All rights reserved.