Discussion:
vector layer reprojection
(too old to reply)
Giuseppe Falcone
2016-08-24 10:49:42 UTC
Permalink
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
pra shant
2016-08-24 12:13:20 UTC
Permalink
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 <
Post by Giuseppe Falcone
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
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Giuseppe Falcone
2016-08-24 12:51:56 UTC
Permalink
This post might be inappropriate. Click to display it.
Robert Sanson
2016-08-24 20:37:14 UTC
Permalink
This post might be inappropriate. Click to display it.
Giuseppe Falcone
2016-08-25 12:51:25 UTC
Permalink
Hi,

I have implemented a function that reproject vector layer when I change map
SR. The feature are now redrawed correctly.
But now there is another problem:
1 - light on vector layer
2 - change mapSR (sr1) -> layer is reprojected
3 - light off vector layer
4 - change map SR (sr2 - different from previous)
5 - light on vector layer -> layer not appears onto map (I presume because
layer have feature stored in sr1 system and the map is in sr2 system)

How can I fix this problem? I have to reproject features also on set vector
layer visibility?
Thanks.

Giuseppe
Post by Robert Sanson
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
Behalf Of *Giuseppe Falcone
*Sent:* Thursday, 25 August 2016 12:52 a.m.
*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
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 <
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
http://lists.osgeo.org/mailman/listinfo/openlayers-users
Continue reading on narkive:
Loading...