×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    2

    Getting geo coordinates from map after user searched for address

    Hi all,

    I'm using the HTML5 mobile framework 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:

    Code:
    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() or is it possible to add a listener in the configuration section of the embed method?

    Thanks for any input.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2012
    Posts
    65

    Re: Getting geo coordinates from map after user searched for address

    Hi,

    you can add your custom listeners as following:

    Code:
    nokia.mh5.event.add(nokia.mh5.app.controller.current.page.header.search, "success", function(e) {
        console.log("results: ", e.data);
    });
    Please note that it works only if the page with the search component is visible, i.e. right after the app initialization.

    Look for all available listeners in mh5 API refenrece nokia.mh5.components.Search



    Br,
    Leo

  3. #3
    Registered User
    Join Date
    Mar 2013
    Posts
    2

    Re: Getting geo coordinates from map after user searched for address

    Hi Leo,

    thank you so much; this is exactly what I was looking for!

    Best,
    Rüdiger

Similar Threads

  1. Replies: 2
    Last Post: 2010-11-26, 11:33
  2. Replies: 3
    Last Post: 2010-07-20, 15:24
  3. let the user select address from the address book
    By szleventee in forum Mobile Java General
    Replies: 2
    Last Post: 2008-07-04, 12:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×