[OpenLayers-Users] Track Point with existing Layer

Andreas Hocevar andreas.hocevar at gmail.com
Thu Aug 14 15:06:57 EDT 2008


David Calle wrote:
> Hi List,
>
> I need to modify the Point Track Markers example... for tracking the 
> points of a existing layer...
> This is my layer with the points:
>
>         var paradas8 = new OpenLayers.Layer.MapServer.Untiled( 
> "Paradas 8", "../../cgi-bin/mapserv",
>             {map:"C:/data/publicacion.map",
>             layers: "paradas8_ida",transparent: "true", map_imagetype: 
> "png"});
>
> map.addLayers([paradas8]);

So you are using Mapserver already! You just have to configure it to 
serve it as WFS/GML, and use OpenLayers.Layer.GML instead of 
OpenLayers.Layer.Mapserver.Untiled. The PointTrack layer cannot get the 
points from an image...


>
> So, I need to use these points.... into the example...
>
>         function populateMap() {
>
>             var lineLayer = new OpenLayers.Layer.PointTrack(rss.name 
> <http://rss.name> + " Track",
>                     {dataFrom: 
> OpenLayers.Layer.PointTrack.dataFrom.SOURCE_NODE});

The dataFrom property has nothing to do with the source of your data. It 
only tells the PointTrack layer if a line feature should get the data 
from its source or target node.
 
>
>             lineLayer.addNodes(rss.features);

This is the interesting line. In the example, "rss" is the layer that 
contains the points. In your use case, this would be the GML layer with 
your points.


Regards,
Andreas.



More information about the Users mailing list