[OpenLayers-Users] vector layer reprojection
Robert Sanson
Robert.Sanson at asurequality.com
Wed Aug 24 13:37:14 PDT 2016
HI
Yes, I believe the approach is to create a new layer and transform the features from the old layer and add them one by one into the new layer.
Regards,
Robert
From: Users [mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Giuseppe Falcone
Sent: Thursday, 25 August 2016 12:52 a.m.
To: pra shant <prashu84k at gmail.com>
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] vector layer reprojection
Hi,
thanks for the response.
The situation is a bit different.
The feature are already loaded into layer and visible onto map. Now I have a combo control by which I modified SR onto map.
With this operation raster layers are reprojected correctly.
For raster layers what I have to do? I have to remove and re-add features on vector layer?
Thanks.
Giuseppe
2016-08-24 14:13 GMT+02:00 pra shant <prashu84k at gmail.com<mailto:prashu84k at gmail.com>>:
Hi,
Try to transform all features using below code and then add features to vector layer.
Initialize and add all layers while map loading and then perform transformation operation on every feature.
geometry.transform(4326,3857);
feature.setGeometry(geometry);
vectorlayer.add(feature);
Regards,
Prashant Kirpan
On Wed, Aug 24, 2016 at 4:19 PM, Giuseppe Falcone <falcone.giuseppe at gmail.com<mailto:falcone.giuseppe at gmail.com>> wrote:
Hi all,
I have a problem with vector layer reprojection.
I have implemented a map viewer where is possible to change reference system.
If I load vector layer after that I have changed SR, this is correctly loaded. If i load vector layer and then I change SR, the raster layers are reprojected correctly, but the vector layer disappear.
Any idea?
Thanks a lot.
Giuseppe
_______________________________________________
Users mailing list
Users at lists.osgeo.org<mailto: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/20160824/0d22f99e/attachment.html>
More information about the Users
mailing list