14

I'm using Google Cardboard with the Street View App. I want to be able to create a link that sends users directly into the Street View App to view a specific location.

Within the Street View App I can create a link from a location, if it's a featured location within the app, the link it generates works perfectly and looks something like this: http://www.google.com/maps/streetview/#us-highlights/faneuil-hall-boston

If it's not a featured location, the URL it generates is different and opens in google maps, rather than the Street View app, looking something like this: https://www.google.com/maps/@/data=!3m4!1e1!3m2!1s7lx0Oz8OSTwIweRXw7eNiA!2e0

Is it possible to create a URL that opens in the Street View App that isn't a featured location. If so, what's the process/format?

davevsdave
  • 264
  • 2
  • 15
  • You might want to investigate the Google Street View APIs documentation at https://developers.google.com/maps/documentation/streetview/ From what i remember, I had to acquire a key from Google to place in the URL request (see https://developers.google.com/maps/documentation/streetview/get-api-key) – GlennRay Sep 21 '16 at 00:32
  • Wish that was it. I need the url to open a specific location in the Street View App, not open a specific location in Google Maps in street view mode. Seems like a minor difference, but in my use case, makes all the difference. – davevsdave Sep 21 '16 at 04:57
  • This is the URL to open the app: `[NSURL URLWithString:@"streetview://"]` .. so maybe you can add a location, too.. like: `[NSURL URLWithString:@"streetview://?location=45.332331%2C-27.031219"]` – TonyMkenu Sep 29 '16 at 14:09
  • any idea how to open streetview app with specific location? [NSURL URLWithString:@"streetview://?location=45.332331%2C-27.03121‌​9"] only can open streetview app, but not zoom in the specific location. – Simon Jul 08 '17 at 15:19
  • Did you found a solution? – Derzu Jul 05 '18 at 03:38
  • Please check my question: https://stackoverflow.com/questions/51083188/opening-streetview-from-my-app-at-a-specific-location – Derzu Jul 09 '18 at 19:51
  • @Derzu - Looks like you've run into the same roadblock as I did. I came to the conclusion that this is a limitation of the software and not possible. I'd submit a feature request with google. Let me know if you find a work around. – davevsdave Jul 10 '18 at 21:32
  • @davevsdave Where can we submit the feature request to Google? – Derzu Jul 11 '18 at 16:56
  • @Derzu here: https://developers.google.com/streetview/publish/support – davevsdave Jul 12 '18 at 18:12
  • @davevsdave Thanks I submitted. – Derzu Jul 13 '18 at 01:46

1 Answers1

4

You can launch the Google Maps for iOS application in street view mode with the comgooglemaps URL Scheme by setting the mapmode parameter to streetview.

Objective c

 if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"comgooglemaps://"]]) {

       [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"comgooglemaps://?center=46.414382,10.013988&mapmode=streetview"]]];    
  }

Swift 4

if UIApplication.shared.canOpenURL(URL(string: "comgooglemaps://")!) {


   guard let url = URL(string: "comgooglemaps://?center=46.414382,10.013988&mapmode=streetview") else {
            return //be safe
        }

    if #available(iOS 10.0, *) {
        UIApplication.shared.open(url, options: [:], completionHandler: nil)
    } else {
        UIApplication.shared.openURL(url)
    }

 }

& more details here on Google Streetview.

Rahul Mayani
  • 3,761
  • 4
  • 25
  • 40
  • 1
    Thanks for answering. Not what I'm looking to do. If you re-read my question, I want to open a specific location in the Street View App, not Google Maps in street view mode. I know it seems like a minor difference, but it makes all the difference in my use case scenario. – davevsdave Oct 06 '16 at 02:54
  • @davevsdave have you found any solution. same situation want to open google street view app not map app – Ajay Singh Thakur Sep 20 '17 at 06:58
  • @AjaySinghThakur Sorry, I never did find a solution for this. If you come across a solution let me know. We might need to make a feature request for this to be possible. – davevsdave Sep 23 '17 at 20:25