<div dir="ltr">I have searched google a lot for this issue, I found a lot of people have the same problem. It's better to have a general solution.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Mar 11, 2013 at 9:12 AM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Your bet is correct. Any tips on convert the coordinate? It's not just a point when you draw with openlayer, the shape can be line and polygon.<br>
</blockquote></div>
Well no great mystery here. After the user has drawn the object, and before posting the data to geoserver, (eg on the featureadded event), you just process through the list of coordinates in the geometry converting them (eg if ln>180 then ln -=360). Much more<br>

mysterious is management of the topology but this is a function of the underlying database, rather than geoserver. I dont think there is a general solution to this.<br>
<br>
Slightly more general code is:<br>
where geom is the geometry to convert and extent is generally baseLayer.maxExtent<br>
function wrapDateline(geom,extent) {<br>
    for (var i=0, len=geom.components.length; i<len; i++) {<br>
        var component = geom.components[i];<br>
        for (var j=0, lenj=component.components.<u></u>length; j<lenj; j++) {<br>
            var pt = component.components[j];<br>
            while (pt.x < extent.left) {<br>
                pt.x +=  extent.getWidth();<br>
            }<br>
<br>
            //shift left?<br>
            while (pt.x > extent.right) {<br>
                pt.x -= extent.getWidth();<br>
            }<br>
        }<br>
<br>
    }<br>
    geom.bounds = null;<br>
    return geom;<div class="HOEnZb"><div class="h5"><br>
}<br>
<br>
<br>
Notice: This email and any attachments are confidential.<br>
If received in error please destroy and immediately notify us.<br>
Do not copy or disclose the contents.<br>
<br>
</div></div></blockquote></div><br></div>