Link to street view URL using address?
Asked Answered
L

2

7

Is it possible to link directly to street view from an URL using only the address (and not lat/lng)?

For example, is there a way to do something like

http://maps.google.com/maps?q=&layer=c&address=Street,number,state&cbp=11,0,0,0,0

Instead of

http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=11,0,0,0,0

?

Lat/lng from geocoding tends to not be recognized by street view as being too far from a street, sometimes getting the wrong street altogether, because the lat/lng it generates may be off the street, as it tries to match the location of a house.

I have looked everywhere and even tried playing with google's URLs on my own, but I can't find anything on it. Most sources won't even mention address. I'm currently using the url sample from this question, but it still isn't really what I'm looking for.

If this is really not possible, could someone link to a source/documentation where it says so?

Edit: Thank you everyone for the answers, but none really address the issue with street view and addresses. I'll look into forwarding this to google. I'll post here if I get a reply.

Laureenlaurel answered 17/7, 2016 at 23:20 Comment(4)
According to the documentation developers.google.com/maps/documentation/streetview/intro location can be either a text string (such as Chagrin Falls, OH) or a lat/lng value (40.457375,-80.009353). Isn't that what you are looking for?Hydrus
That is for the "Google Street View Image API", it's something else. You can use address there, but I just want to link to a google page with real street view. I tried using "location" for the URL on the question, but it didn't seem to work, at least not how I tried.Laureenlaurel
Possible duplicate of https://mcmap.net/q/321461/-google-street-view-urlCalipee
It is nice that the question has a link to a documentation, but for something 6-8 years old, and that does not fully address my question, I decided to create a new one.Laureenlaurel
V
1

Let's enhance your code, if you paste the code in browser then you will be redirect to google maps and will show result what you requested.

http://maps.google.com/maps?&q=Space+Needle,Seattle+WA

If you would like to pass the value (address) via php or any other code type then simply it will not work, you cannot use google maps without API to enhance your requirement. Lat & Lng is basic practice to show map and not require any api, but if you would like to pass additional properties then you will have to use google maps api to do so. Detailed documentation can be found here

https://developers.google.com/maps/documentation/embed/guide

but let's try an example try this code in browser

https://www.google.com/maps/embed/v1/place?q=Mumbai,+Maharashtra,+India

You will get an error that api key not found but if you try this one

https://www.google.com/maps/embed/v1/place?key=AIzaSyD4iE2xVSpkLLOXoyqT-RuPwURN3ddScAI&q=Space+Needle,Seattle+WA

Then you will get output. Hope it helps!

Velma answered 30/7, 2016 at 8:39 Comment(1)
You can indeed link to google maps using the address, however I do not want to link to map, but to street view. Unfortunately it seems if you add the streetview query to your first link, it does not work, and when returning to the map, it returns to a random location in the world map. Embeds is not what I want for this case either, but thanks for your try. Perhaps I should direct this to google feedback or bug reports instead.Laureenlaurel
K
0

First reverse geocode to find the lat lng using another Google Service API.

Then feed the resulting lat lng into the streetview endpoint parameter.

Karaganda answered 18/7, 2016 at 6:42 Comment(2)
That is not what I'm asking. I know how to do it with lat/lng, and I know about geocoding. I want to know if it's possible with address (and no geocoding). Geocoding often gets a position street view doesn't recognize, even if the street beside it has street view, because it marks a location outside of the street.Laureenlaurel
i would just write your own serverside logic to take what input you need, convert it, etc. When you reverse geocode it, you should get an exact coordinate point for the street view. If you are getting something outside, make sure you have the right significant digits for your lat lng - 6 decimal pointsKaraganda

© 2022 - 2024 — McMap. All rights reserved.