0

I'm using PHP to construct a URL to google maps, a really simple little thing. I am doing it like this right now, which only falls short because it takes two clicks to get to street view (click once on link, then when arriving, click on the thumbnail of the streetview):

$map_link = '<a href="https://maps.google.com?q=' . $address_string . '">' . $name . '</a>';

However, I'd really like the link to go straight to the default streetview in full screen without having to click the thumbnail. Looking here (https://developers.google.com/maps/documentation/urls/guide#street-view-action) they say I can use this:

https://www.google.com/maps/@?api=1&map_action=pano&parameters

where for parameters I need to include at least one or the other of viewpoint or pano. I'm not looking for a specific image, I just want the default view, so not going to be using pano. But I don't have this info. Google already knows the viewpoint (latitude/longitude) specific to an address, because it appends it to the URL automatically when you search by JUST the address! So why do they want ME to tell THEM the information THEY are the ones in possession of? Clearly there's got to be a simple way to do this without some complicated look-up process?

I feel like I should be able to obtain this view from google by passing only the address, since that is sufficient for Google to uniquely identify the address and they display the street view already on the page we land on, but I just want it to fill the screen, to save a click when arriving there. This is for an admin page, not to be accessed by end-user. If there's a way to do this not documented in the obvious place, please someone enlighten me! Thanks!

1 Answers1

0

Use Maps Embed API instead which lets you place a Street View panorama on your website by simply specifying the address. To get you started, check this link and click on "Show Street View or a custom panorama" option: https://developers.google.com/maps/documentation/embed/start

NOTE: this will require a valid billing account and an API key to properly work

jabamataro
  • 1,154
  • 7
  • 13
  • Not an option for this application. Our website collects user addresses, and then if someone signs up with the same address (but different apt/ste #) we're generating an email to admin to verify that the address is what they say it is (house vs apartment, for instance). In that email, there's a link to their address on google maps so we don't have to verify by typing that person's address in manually. I just want to eliminate the 2nd click, where you have to click on the thumbnail on the google maps page. There should just be a switch to tell it to be full screen (it's already there)! :\ – filamentary Jun 05 '20 at 16:09
  • In any google maps page, like this one here, google maps always displays the default streetview image - I want it to fill the page; I shouldn't have to specify which view, if I want the default! Should probably send google devs my feedback, as this is a super reasonable request, and shouldn't require creating an API account to do this simple request: https://maps.google.com/?q=5151+state+university+dr+los+angeles+ca+90032 – filamentary Jun 05 '20 at 16:14