I am trying to get the current location on my. The example that was used originally was for Web Mercator. What do I need to change to get the currentLocation variable to open Google Streetview?
Here is my code: JS Bin - Collaborative JavaScript Debugging It displays currentLocation as undefined.
Solved! Go to Solution.
See Create a Map
Problem is now however that a browser's popup-blocker will kick in. This is because the new window is opened in an async callback.
You forgot to require esri/geometry/Point
That helped but I need to replace the line var theLatLongGeom = webMercatorUtils.webMercatorToGeographic(theLocation); I'm not using webMercator. What should that be changed to?
Here is my updated code:JS Bin - Collaborative JavaScript Debugging
Chrome DevTools is pretty clear:
So, require esri/geometry/webMercatorUtils
Ah, I see... You're not using webmercator
Then you would need to use the Geometry service to project to lat/long.
I was thinking that but I wasn't sure what to write or where to look. I checked in the API for geometry service and still wasn't sure. Any idea what should be written?
See Create a Map
Problem is now however that a browser's popup-blocker will kick in. This is because the new window is opened in an async callback.
That worked. I just needed to tell my machine to trust the site that I am running on to stop the pop-up blocker and it's working well. Thanks!
One last question. My projection is 3435. It doesn't work when I replace 4326 for this. Will this be an issue? It seems to be accurate though.
Not sure I follow, can you elaborate?