Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2014
    Posts
    6

    How do I retrieve custom marker coordinates in HERE Maps API for Javascript?

    How do I retrieve custom marker coordinates in HERE Maps API for Javascript?

    This is how I add a custom marker:

    Code:
    var marker = new nokia.maps.map.StandardMarker([52.51, 13.4], {
       text: "Hi!", // Small label
       draggable: true // Make the marker draggable
    });
    
    map.objects.add(marker);
    The problem: I need to get new coordinates when a user drags this marker to another position and clicks 'ok' (so no listeners are needed).

    Neither
    Code:
    var 123 = marker(coordinate); alert(123);
    nor
    Code:
    var 123 = marker.coordinate; alert(123);
    do the trick. The API seems to be silent about that issue.

  2. #2
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: How do I retrieve custom marker coordinates in HERE Maps API for Javascript?

    Turns out to be pretty simple:

    var latitude = marker.coordinate.latitude.toString();

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,805

    Re: How do I retrieve custom marker coordinates in HERE Maps API for Javascript?

    Just a side note, "var 123 = ..." will not work in many programming environments. 123 is usually considered being a number, which represent a fixed value of 123 and thus can not be set to anything. Refer to the concept of literals, http://en.wikipedia.org/wiki/Literal...r_programming). Things starting with letters or an underscore are more common as variable names, like "var a123 = ..."

Similar Threads

  1. Change Marker in Google Maps
    By Mobile Developer in forum Mobile Java General
    Replies: 9
    Last Post: 2011-12-08, 14:18
  2. Replies: 2
    Last Post: 2010-08-30, 12:03
  3. Navigation route coordinates from Nokia Maps or Ovi Maps
    By selimsolmaz in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2010-03-04, 11:02
  4. Replies: 3
    Last Post: 2010-03-03, 11:25

Posting Permissions

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