Adding Google Street View to Popups

183
3
Jump to solution
06-09-2022 08:00 AM
JCGuarneri
Occasional Contributor

Hello, all.

I'm experimenting with adding Google Street View images to feature popups in the new map viewer in Enterprise 10.9.1. What I want to do is use an Arcade expression to build the api link using either the feature's coordinates or the address (if it has one). I can get Arcade to build the URL, but it doesn't bring anything in if I use that expression for the image URL. However, if I copy that same URL and put it in the URL box as text (rather than as from an expresssion), it works just fine. Is there a special workaround I need to get the calculated URL working properly?

1 Solution

Accepted Solutions
JCGuarneri
Occasional Contributor

Looks like I've answered my own question here: Upon inspecting what link comes out the other side where the image should be, I discovered the ampersands were getting replaced. Using URLEncode() on the whole link doesn't work, but I discovered I can just build a location string from address, street, town, and state, or from lat and long, and URLEncode() that. Then, I add the base URL as plain text to the URL box, with the expression inserted after "&location=".

JCGuarneri_0-1654791618638.png

 

View solution in original post

3 Replies
JCGuarneri
Occasional Contributor

Looks like I've answered my own question here: Upon inspecting what link comes out the other side where the image should be, I discovered the ampersands were getting replaced. Using URLEncode() on the whole link doesn't work, but I discovered I can just build a location string from address, street, town, and state, or from lat and long, and URLEncode() that. Then, I add the base URL as plain text to the URL box, with the expression inserted after "&location=".

JCGuarneri_0-1654791618638.png

 

NathanEnge
Esri Contributor

note that google street view API has to be called from a google streemap, else you are in violation of the google street view terms. As this is just experimental YMMV. 

"(e) No Use With Non-Google Maps. To avoid quality issues and/or brand confusion, Customer will not use the Google Maps Core Services with or near a non-Google Map in a Customer Application. For example, Customer will not (i) display or use Places content on a non-Google map, (ii) display Street View imagery and non-Google maps on the same screen, or (iii) link a Google Map to non-Google Maps content or a non-Google map."

JCGuarneri
Occasional Contributor

Good to know! Thank you, I'll have to proceed with caution.

0 Kudos