Frage

I'm using the HTML5 mobile framework (https://developer.here.com/mobile_html5) to display a map and textbox, so the user can search for an address. This is what the "Mobile HTML5 App Builder" (https://developer.here.com/mobile_html5_appbuilder) gave to me:

var app = nokia.mh5.app.embed({
    domNode:"#app_location",
    appId:"_peU-uCkp-j8ovkzFGNU",
    appCode:"gBoUkAMoxoqIWfxWA5DuMQ",
    "configuration":{
        "map":{
            "infobubble":false
        }
    }
});

What I want to do is either read and store the geo coordinates (longitude and latitude) into some variables after the user has searched and chosen an address or read out the marker's geo coordinates on the map in my code.

Is there something like

$('#app_location').map.getCoordinates() // pseudo-code

or is it possible to add a listener in the configuration section of the embed method?

Thanks for any input.

War es hilfreich?

Lösung

I got an answer in the nokia developer discussion board, so credits go to them. Just in case someone is passing by, here is the solution which solved my problem:

nokia.mh5.event.add(nokia.mh5.app.controller.current.page.header.search, "success", function(e) {
    console.log("results: ", e.data);
});

In e.data you will find information about longitude, langitude, the address entered and more.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top