[OpenLayers-Users] why the popups have same content?

Gery . gamejihou at hotmail.com
Fri Mar 1 06:43:09 PST 2013


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 jsbin.com, this seems to be easier.

Sent from my iBath

On Mar 1, 2013, at 15:06, "Yves Gillet" <ygillet at gmail.com> wrote:

Your data structure of markers is quite not common using arrays. Why not using objects like

markers = [
{
  position : [ 11.926984840916,22.54309741608402],
  icon: 0
},

  position : [ 11.926984840916,22.54309741608402],
  icon: 2
},]

it s easier to understand.

As said, solve problems one at a time, and please if you need rapid support, use http://jsfiddle.net/ it saves time for experimenting and for those who are trying to help instead of trying to replicate your code .



2013/3/1 Gery . <gamejihou at hotmail.com>
> 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.
> 
> Sent from my iBath
> 
> On Mar 1, 2013, at 13:23, "dolphintroop" <thymeland at hotmail.com> wrote:
> 
> the data array is as this:
> 
>    var coodCollection = [ 11.926984840916,22.54309741608402,0,
>                           11.9270373628267,22.54429109286876,0,
>                           11.9271964929425,22.54567386485417,1,
>                           11.9272997413621,22.54600196672146,1
>                            ];
> 
> 0 and 1 is the color code, but I get an icon name beyond 0 and 1.
> At the same time, alert(color) get a right data.
> 
> 
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.n6.nabble.com/why-the-popups-have-same-content-tp5037498p5037736.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130301/a2977288/attachment.html>


More information about the Users mailing list