[OpenLayers-Dev] Projecting a vetorial layer

Eric Lemoine eric.c2c at gmail.com
Sun Oct 26 09:18:26 EDT 2008


Hi

var wkt = new OpenLayers.Format.WKT({
    internalProjection: new OpenLayers.Projection("EPSG:xxxx"),
    externalProjection: new OpenLayers.Projection("EPSG:yyyy")
});

Eric

2008/10/26, Damiano Morosi <damiano.morosi at gmail.com>:
> Hi all,
>
> I have added a vectorial layer in my map, starting from a wkt:
>
> ----
>
> path = new OpenLayers.Layer.Vector("Percorso", {style: result_style});
> map.addLayers([path]);
> parser = new OpenLayers.Format.WKT();
> var wkt = "<?php echo $path_wkt; ?>";
>
> var path_feat = parser.read(wkt);
>
> path.addFeatures([path_feat]);
>
> ----
>
> This works. Now, the wkt comes from an external process in long/lat, and I
> need to project it on the map using EPSG:XXXX. How can I accomplish this?
> Thank you,
>
> Damiano Morosi
>



More information about the Dev mailing list