[OpenLayers-Users] International date line and bounds [SEC=UNCLASSIFIED]

Matthew Doyle M.Doyle at bom.gov.au
Thu Mar 26 21:17:56 EDT 2009


Hi Craig,

I think you'll find that if you do set wrapDateLine:true on your base layer (you must have at least some base layer?), then OpenLayers won't restrict your panning at the dateline as it no longer defines the boundary of the map. There are a few known bugs that come with this though; sometimes a large gap can appear when you are to the west of the 180 line (but not on the east), and you are likely to run into Vector problems with many of the points appearing / disappearing as you scroll over the dateline.

Ryan's suggested solution below is surely brute force as this would mean you are drawing all Vector points twice, which may be fine if you are dealing with a small subset. 

I haven't got this to work in harmony with maxExtent values either. There seems to be problems with extent boundaries which extend over the 180/-180 dateline. When I remove my maxExtent/restrictedExtent vars these problems disappear. Your issue of being stuck at (0,0) may have something to do with using a different displayProjection to your maps projection, but I'm only harbouring a guess here.

I'd certainly be keen to know if anyone in the community has written any patches, or has any ideas, for the above issues.

Best regards,
Matt



-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On Behalf Of Craig Stanton
Sent: Friday, 27 March 2009 9:23 AM
To: users at openlayers.org
Subject: Re: [OpenLayers-Users] International date line and bounds

Hi Ryan,
    I think that example is showing how to wrap a layer, which I guess I'll need later, but what I'm stuck with now is that my map won't move beyond that boundary, presumably because the MaxExtent is incorrect. In the example code no extends are set and scrolling seems fine, but when I leave MaxExtent off I get stuck at (0,0) and can't move the map around.

~Craig

>>> Ryan Hofschneider  03/27/09 10:58 AM >>>

On Mar 26, 2009, at 2:47 PM, Craig Stanton wrote:

> I'm trying to display points centered around New Zealand, some of 
> which are on the other side of the -180/180 line. Therefore I'd like 
> to set the bounds of my OpenLayers map to go from 0 to 360 instead of 
> -180 to 180, or better yet, have no bounds at all and let people move 
> the map as they see fit.

See:
http://openlayers.org/dev/examples/wrapDateLine.html

Also, in order to quickly support full wrap around in a seamless manner with non-WMS data, I took the brute force approach of drawing my data multiple times at +/-360 offsets.

Cheers,
Ryan
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users

NIWA is the trading name of the National Institute of Water & Atmospheric Research Ltd.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list