<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I'd go with Yves's example, it's easier if you split your features in small chunks, so you make it easy, perhaps you could use geojson for this but perhaps it's too much. Going through any code sometimes is time-consuming, so small and simple examples help to debug easily what you're trying to achieve, jsfiddle is a good place for testing but it's also a bit difficult at the beginning. Try <a href="http://jsbin.com">jsbin.com</a>, this seems to be easier.<br><br>Sent from my iBath</div><div><br>On Mar 1, 2013, at 15:06, "Yves Gillet" <<a href="mailto:ygillet@gmail.com">ygillet@gmail.com</a>> wrote:<br><br></div><div><div dir="ltr"><div style="">Your data structure of markers is quite not common using arrays. Why not using objects like</div><div style=""><br></div><div style="">markers = [</div><div style="">{</div><div style=""> position :<span style="font-size:13px;font-family:arial,sans-serif"> [ 11.926984840916,22.</span><span style="font-size:13px;font-family:arial,sans-serif">54309741608402],</span></div>
<div style=""><span style="font-size:13px;font-family:arial,sans-serif"> icon: 0</span></div><div style="">},</div><div><br class=""> position :<span style="font-size:13px;font-family:arial,sans-serif"> [ 11.926984840916,22.</span><span style="font-size:13px;font-family:arial,sans-serif">54309741608402],</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"> icon: 2</span></div><div style="">},]<br></div><div style=""><br></div><div style="">it s easier to understand.</div><div style=""><br></div>As said, solve problems one at a time, and please if you need rapid support, use <a href="http://jsfiddle.net/">http://jsfiddle.net/</a> it saves time for experimenting and for those who are trying to help instead of trying to replicate your code .<div style="">
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/1 Gery . <span dir="ltr"><<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I havent followed your post so not sure if this will work. I think you need to test first one feature at the time, you have an array where the 3rd, 6th, 9th and 12th, and so forth..., position defines the color, so you need to loop over this and tell that the two previous positions should be taken to plot the marker. Im not sure if case will help you here, I'd try if/elif/else instead.<br>
<br>
Sent from my iBath<br>
<div class="HOEnZb"><div class="h5"><br>
On Mar 1, 2013, at 13:23, "dolphintroop" <<a href="mailto:thymeland@hotmail.com">thymeland@hotmail.com</a>> wrote:<br>
<br>
the data array is as this:<br>
<br>
var coodCollection = [ 11.926984840916,22.54309741608402,0,<br>
11.9270373628267,22.54429109286876,0,<br>
11.9271964929425,22.54567386485417,1,<br>
11.9272997413621,22.54600196672146,1<br>
];<br>
<br>
0 and 1 is the color code, but I get an icon name beyond 0 and 1.<br>
At the same time, alert(color) get a right data.<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.n6.nabble.com/why-the-popups-have-same-content-tp5037498p5037736.html" target="_blank">http://osgeo-org.1560.n6.nabble.com/why-the-popups-have-same-content-tp5037498p5037736.html</a><br>
Sent from the OpenLayers Users mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br></div>
</div></body></html>