I would like to launch Google StreetView in the Safari browser from my native iOS app. I have the street address and latitude longitude available. I know it is relatively easy to find panorama ID using an API, but unfortunately I can't use any Google API. I need to launch the google maps website outside of my app with the given address or latitude longitude.
The url for street view (for 40.535673,-74.209823) on desktop looks something like this:
https://www.google.com/maps?es_sm=91&um=1&ie=UTF-8&q=719+Ramona+ave+new+york&layer=c&z=17&iwloc=A&sll=40.535673,-74.209823&cbp=13,354.4,0,0,0&cbll=40.535462,-74.209796&sa=X&ei=BMdjVIaPMIn5yASA64Jw&ved=0CCAQxB0wAA
How can construct this url without using any Google Maps API? If I simply try to replace the latitude longitude above the street view ends up facing in the incorrect direction. Any way to get the heading just right?
The way I solved this was to first call the following API to get a
panoId
andbest_view_direction_deg
. Here's an example url for that API:Here's a piece of ObjC code I used to convert the pano ID and direction into a url:
Output looks like: