[OpenLayers-Dev] Projecting a vetorial layer

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


Also, note that OpenLayers by itself only supports 4326 to/from 900913
re-projections. If you use some other projections you'll also need the
proj4js lib. Cheers, Eric

2008/10/26, Eric Lemoine <eric.c2c at gmail.com>:
> 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