Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User gpf.worker's Avatar
    Join Date
    Mar 2012
    Posts
    5
    Anyone know a way to get the address from the map object? or by the lat/lng values ?

    ie. User pan map from San Francisco, CA to Cuppertino , CA

    Is there a way after the draggend event, I can access the property to or use searchManager to reverse the lat/lng to an address?

    Thanks!

  2. #2
    Nokia Developer Moderator jasfox's Avatar
    Join Date
    Aug 2011
    Location
    Berlin
    Posts
    240
    You can't get an address directly from the map, but you can get a GeoCoordinate using map.pixelToGeo() and then do a reverseGeoCode() lookup. First create your event handler as shown:

    Code:
    var processResults = function (data, requestStatus, requestId) { 
          if (requestStatus == "OK") {
          			console.log (data.location.address);
                    } else if(requestStatus == "ERROR") {
                            alert("SEARCH FAILED"); 
                    }
                };
    Then within the event you have generated pick up the geoCoordinate you are interested in:
    Code:
    var  clicked_location = map.pixelToGeo(event.displayX, event.displayY);
    nokia.places.search.manager.reverseGeoCode({
    					latitude: clicked_location.latitude,
    					longitude: clicked_location.longitude,
    					onComplete: processResults
    		});

    You may also want to look at using the ContextMenu, which typically displays an address.

    http://api.maps.nokia.com/en/playgro...le_contextmenu
    http://api.maps.nokia.com/en/apirefe...ntextMenu.html
    Jason Fox
    Technical Support Engineer, Maps Platform
    Location & Commerce

    http://developer.here.net/

Similar Threads

  1. Convert lat/lon to address data
    By brendanmc25 in forum Mobile Java General
    Replies: 3
    Last Post: 2010-04-01, 05:35
  2. What is the best way to find out your IP address?
    By camroe in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2006-01-12, 23:03
  3. Replies: 1
    Last Post: 2003-10-16, 19:17
  4. can i configure both an IPv6 address and IPv4 address on Symbian?
    By shangoo in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2003-10-16, 08:24
  5. Replies: 0
    Last Post: 2003-10-16, 08:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved