<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi there,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I'm trying to do something that I can see others have tried to do, but i can't find a working solution.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have a layer with vector polygons, generated programmatically in the JavaScript. My map is global, in 3857 proj, with dateline wrapping.. hence i would like for the polygons to be represented multiple times when appropriate.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">I have tried adding 'mirror' features, i.e. ones where the geometry is shifted right and left by 2*2.003750834E7 meters.. however the new features are rendered on top of the old, despite the fact their geometries are
 not the same. I have tried defining the map extent to be and extra globe wide on each side.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">for e.g.:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            var new_feature1 = feature.clone();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            var new_feature2 = feature.clone();<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            new_feature1.geometry.move(20037508.34*2,0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            extent_layer.addFeatures(new_feature1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            new_feature2.geometry.move(-20037508.34*2,0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            extent_layer.addFeatures(new_feature2);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            console.log(new_feature1.geometry.getBounds());<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">            console.log(new_feature2.geometry.getBounds());<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">the console shows the geoms are different, but they all render on top of each other.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Is there a way to achieve this, i.e. render vectors beyond the logical extent in order to avoid not drawing features where they indeed exist ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">(note in order to get sufficiently zoomed out with wrapDateLine=true i had to override OpenLayers.Map.adjustZoom)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">i am using OpenLayers 2.13-dev<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">thanks for any ideas,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">-i<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>