Sign up ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using wrapDateLine properties for OpenLayers.Layer.WMS for handling dateline issues. The problem with wrapDateLine is that I am getting the same polygon repetitively around the wrapped map as a user selects a desired polygon around dateline. Is there any way to select the polygon around dateline in a single wrapped map and avoiding repetitions? My OpenLayers.Layer.WMS constructor is as:

var I = new OpenLayers.Layer.MapServer("region", "http://localhost/cgi-bin/mapserv?map=/home/public_html/",{poly='Bermuda', layers: 'myregion', format:'image/png'}, 
    {wrapDateLine: true}

e.g. Bermuda in my example is in dateline and if I use wrapDateLine:true, I get complete polygon of Bermuda but it is repeated (wrapped). I want complete polygon of Bermuda but no repetition. Is there any other way for it?

I see that there are options like OpenLayers.Bounds() and layer.adjustBounds(). I am not sure if it works in my problem.

Thanks in advance!

share|improve this question
can you post a picture? I'm having trouble visualizing this, especially as Bermuda is no where near the date line. – iant Mar 9 '11 at 18:57
@iant I am just taking Bermuda as an example. In my shape file, the red colored polygon is Aleutian Island that is at two corners of the map. I want it to be displayed as a complete polygon. I find that wrapDateLine works but it wrap the map and gives the polygon repetitively.![my image][1] [1]: – tester Mar 9 '11 at 20:29
The image you posted looks perfectly fine to me. You'd rather have the red polygon as a whole on either eastern or western border? Wouldn't that be more confusing? – underdark Mar 10 '11 at 13:49
@underdark: The user wants to see a single polygon rather than at two ends. wrapDateLine: true works well for getting a single polygon but my concern is it wraps the map not only for once but infinitely. I am looking for a way to get a single polygon for displaying required polygon. – tester Mar 10 '11 at 17:13
Similar question:… – CaptDragon Mar 10 '11 at 17:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.