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

Yves Gillet ygillet at gmail.com
Fri Mar 1 06:06:24 PST 2013


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/3422b60a/attachment.html>


More information about the Users mailing list