Hi,

this is a kind of follow-up question to my previous mail. How can I
dynamically create MapObjects, for example MapCircleObjects?

I tried putting them into a repeater but that doesn't work and I've
tried using JavaScript to create them, which also does not work.

== Repeater ==
Item {
    Map {
        id: map
        anchors.fill: parent
        zoomLevel: 14
        center: Coordinate {
            latitude: 51.058517
            longitude: 13.7435728
        }
 
        Repeater {
            model: poisModel
            delegate:  MapCircleObject {
                center: Coordinate {
                    latitude: model.latitude
                    longitude: model.longitude
                }
                color: "red"
                radius: 50
            }
        }
    }
}

The error is: "Cannot assign object to list ... Repeater {"


== JavaScript ==
function createPois() {
    var marker = Qt.createQmlObject('import Qt 4.7; import
QtMobility.location 1.1; MapCircleObject {}', map, "marker");

    marker.center = coord;
    marker.color = "red";
    marker.radius = 50;
}

Where 'map' is the ID of the Map item. And 'coord' a valid Coordinate
item.

There is no error message, but the circle also does not show on the map.


Is there anything else I could try?

Thanks!
Conny


_______________________________________________
Qt-mobility-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-mobility-feedback

Reply via email to