<div dir="ltr">Well I was actually able to do what I want with MapItemView.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 28, 2013 at 3:52 AM, Antoine Reversat <span dir="ltr"><<a href="mailto:a.reversat@gmail.com" target="_blank">a.reversat@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div>Hi guys (and gals),<br><br></div>I'm trying to populate a map with marker based on a model.<br>
<br></div>I wanted to do this <br><br>Map {<br> id: stationsMap<br> anchors.fill: parent<br>
plugin: nokia<br> center: currentLocation.coordinate<br> zoomLevel: stationsMap.maximumZoomLevel - 7<br> gesture.enabled: true<br><br> Repeater {<br> model: myModel<br> delegate: Marker {<br>
coordinate: QtPositioning.coordinate(latitude, longitude)<br> }<br> }<br>}<br><br></div>Each entry in my model contains a latitude and longitude property<br><br></div>Here is Marker.qml<br>
<br>import QtQuick 2.0<br>import QtLocation 5.0<br><br>MapQuickItem {<br> property string type: "station"<br><br> sourceItem: Image {<br> id: marker<br> source: type == "station" ? "../images/bikster-marker.png" : "../images/you-marker.png"<br>
}<br> anchorPoint.x: marker.width/2<br> anchorPoint.y: marker.height<br>}<br><br></div>Can somebody tell me what I'm doing wrong or the right way to dynamically add markers to my map ?<div><div>
<img src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div></div><span class="HOEnZb"><font color="#888888"><span><font color="#888888"><br><br></font></span></font></span></div><span class="HOEnZb"><font color="#888888"><span><font color="#888888">Antoine</font></span></font></span></div>
</blockquote></div><br></div>