Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL scheme for the Google Street View App (Not Google Maps)

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?

like image 815
davevsdave Avatar asked Sep 20 '16 18:09

davevsdave


People also ask

How do I get a Google Street View Link?

Open Google Maps. Go to the directions, map, or Street View image you'd like to embed. Click Share or embed map. Click Embed map.

Is there a Street View other than Google Maps?

The best alternative is Google Earth. It's not free, so if you're looking for a free alternative, you could try HERE WeGo or Mapillary. Other great apps like Google Street View are Kartaview, Apple Maps, Yandex. Maps and Bing Maps.

What is the URL of Google Maps?

Launching Google Maps and performing a specific action The only valid value is 1. If api=1 is NOT present in the URL, all parameters are ignored and the default Google Maps app will launch, either in a browser or the Google Maps mobile app, depending on the platform in use (for example, https://www.google.com/maps).

What is the URL of Google Earth?

Bookmark this question. Show activity on this post. How do I generate a sharable URL for Google Earth Web (https://earth.google.com/web/) when I only have the latitude and longitude?


1 Answers

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.

like image 200
Rahul Mayani Avatar answered Sep 26 '22 08:09

Rahul Mayani