Service Portal Google Maps widget

yundlu316
Kilo Guru

I'm trying to build a google maps widget that shows the logged in user's location.   My html is as follows:

<div class="map-container">

  <iframe frameborder="0" src="https://www.google.com/maps/embed/v1/place?key=AIzaSyCmoLpiJFrdXLLUYsM3PRfPD0zQ0uATAUw&q={{data.location}}" allowfullscreen/>

</div>

My server script is:

data.location =gs.getUser().getLocation();

This doesn't seem to work, however when I replace {{data.location}} with an actual location such as Space+Needle,Seattle+WA, the widget populates.  

Any suggestions?

8 REPLIES 8

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I would try that with ngSrc.



AngularJS



You might also do a console.log(data.location) to make sure it's returning what you're expecting.


Hey Brad, just tried that without any luck.


When the page loads and you inspect the iframe element what does the src tag have in it?


Hi Brad,



In the iframe element, the src is showing up correctly.   I don't see a separate src tag anywhere else.


find_real_file.png