×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Map and landmarks

    I am trying to display on a Map elements retrieved from the network.
    It seems possible to use landmarks to have the elements at the correct place on the map (see http://doc.qt.nokia.com/qtmobility-1...rkmap-qml.html ), but i cannot add landmarks that are not directly loaded from a file to the landmarkmodel.

    I tried to use a ListModel populated by javascript, but i can't find how to declare a Coordinate element in javascript, and therefore the element is declared like this :
    Code:
    Component {
            id: itemMapDelegate
            Item {
                property Coordinate coordinate: Coordinate {latitude: location.latitude; longitude: location.longitude}
                Image {
                    id: landmarkIcon
                    y: map.toScreenPosition(coordinate).y
                    x: map.toScreenPosition(coordinate).x
                }
            }
        }
    but if the map is moved, the position on the screen is not updated.

    I don't really know where to go from here.

  2. #2
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Map and landmarks

    just in case someone has the same issue, here is a simple way to overcome it :
    in the map, just add
    onCenterChanged: {
    pinpointView.model = null
    pinpointView.model = photos
    }
    this reloads the model and the iterator and works like a charm.

  3. #3
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Map and landmarks

    actually there is a better way :
    it is possible to create a Coordinate variable using createQmlObject:
    var coord = Qt.createQmlObject('import QtMobility.location 1.1; Coordinate{latitude:' + lat + ';longitude:' + lon + ';}', container, "coord");
    add it to the items in the listmodel, and voilà

  4. #4
    Super Contributor
    Join Date
    Mar 2005
    Location
    Paris
    Posts
    814

    Re: Map and landmarks

    ok, i found the correct definition for this. the variant type is to be used for that kind of problems :
    Code:
    property variant coord: Coordinate {
                latitude: lat
                longitude: lng
            }

Similar Threads

  1. widget ovimap and landmarks
    By lucarocchi in forum Symbian
    Replies: 3
    Last Post: 2010-07-20, 15:20
  2. Replies: 7
    Last Post: 2009-06-30, 10:31
  3. Replies: 2
    Last Post: 2009-02-13, 03:19
  4. JSR179API and Landmarks - same store as for Maps?
    By nicholso in forum Mobile Java General
    Replies: 3
    Last Post: 2007-09-10, 18:44
  5. Does N95 map use landmarks
    By danielnilsson in forum Mobile Java General
    Replies: 2
    Last Post: 2007-04-16, 06:50

Posting Permissions

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