Maps Widget: Capture latitude and longitude using Open Street Map

1
I want to capture the latitude and longitude of my current location when user clicks on current location icon. Is it possible with Open Street Map option? Also is it possible for the user to search for a location by entering address using open street map option?
asked
1 answers
1

There’s a Geolocation widget in the market place. The problem with it, though, is that is renders as a button itself so it doesn’t work well if you’re trying to connect it to a different button on the page or a button inside another widget. BUT, you can simulate the button click if you add the HTML Snippet widget as well. 

 

For example the first “Button” tab in the geolocation widget asks for a Class. if you call it “BackgroundGPS”, then you can simulate a click with: 

 

dojo.query('.BackgroundGPS')[0].click();

.. inside the HTMLSnippet widget if you’ve selected “Javascript with jQuery” as the content type rather than HTML. You’d probably want to wrap that inside a CLICK event of the button inside your openmap.. something like

 

$( "#MapButton").click() {

dojo.query('.BackgroundGPS')[0].click();

}

 

answered