<div dir="ltr">Hi,<div><br></div><div>I have implemented a function that reproject vector layer when I change map SR. The feature are now redrawed correctly.</div><div>But now there is another problem:</div><div>1 - light on vector layer</div><div>2 - change mapSR (sr1) -> layer is reprojected</div><div>3 - light off vector layer</div><div>4 - change map SR (sr2 - different from previous)</div><div>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)</div><div><br></div><div>How can I fix this problem? I have to reproject features also on set vector layer visibility?</div><div>Thanks.</div><div><br></div><div>Giuseppe</div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-24 22:37 GMT+02:00 Robert Sanson <span dir="ltr"><<a href="mailto:Robert.Sanson@asurequality.com" target="_blank">Robert.Sanson@asurequality.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-NZ" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">HI<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><br>
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.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Robert<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Users [mailto:<a href="mailto:openlayers-users-bounces@lists.osgeo.org" target="_blank">openlayers-users-<wbr>bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Giuseppe Falcone<br>
<b>Sent:</b> Thursday, 25 August 2016 12:52 a.m.<br>
<b>To:</b> pra shant <<a href="mailto:prashu84k@gmail.com" target="_blank">prashu84k@gmail.com</a>><br>
<b>Cc:</b> <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.<wbr>org</a><br>
<b>Subject:</b> Re: [OpenLayers-Users] vector layer reprojection<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">thanks for the response.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The situation is a bit different.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">The feature are already loaded into layer and visible onto map. Now I have a combo control by which I modified SR onto map.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">With this operation raster layers are reprojected correctly.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">For raster layers what I have to do? I have to remove and re-add features on vector layer?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Giuseppe<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">2016-08-24 14:13 GMT+02:00 pra shant <<a href="mailto:prashu84k@gmail.com" target="_blank">prashu84k@gmail.com</a>>:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Try to transform all features using below code and then add features to vector layer.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Initialize and add all layers while map loading and then perform transformation operation on every feature.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">geometry.transform(4326,3857);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">feature.setGeometry(geometry);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">vectorlayer.add(feature);<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Prashant Kirpan<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal">On Wed, Aug 24, 2016 at 4:19 PM, Giuseppe Falcone <<a href="mailto:falcone.giuseppe@gmail.com" target="_blank">falcone.giuseppe@gmail.com</a>> wrote:<u></u><u></u></p>
</div>
</div>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I have a problem with vector layer reprojection.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I have implemented a map viewer where is possible to change reference system.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">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.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Any idea?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks a lot.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888">Giuseppe<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="color:#888888"><u></u> <u></u></span></p>
</div>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal">______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/openlayers-<wbr>users</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>