[OpenLayers-Users] WMS w/Google like Behavior
Tim Schaub
noreply at geocartic.com
Fri May 18 11:52:14 EDT 2007
Hello-
Neitz, David wrote:
> The WMS server that I wrote understands how to deliver images across the International dateline.
I'm interested to hear more about this. Specifically, I'd like to see
what a BBOX looks like for a tile that crosses the dateline. Since you
mention the dateline, I assume you're working in EPSG:4326. If that is
the case, let's imagine a tile that is centered on the dateline and
spans 20 degrees in width/height. I imagine your BBOX might look like
one of the following:
1) BBOX=-190,-10,-170,10
-or-
2) BBOX=170,-10,-170,10
The first option requires that your server knows that -190 really means
170 (degrees east). This looks the most reasonable to me because it is
unambiguous (in terms of being able to calculate width from the BBOX).
However, it is a request that will only work with custom WMS setups that
can make this -190 to 170 translation, can render the tile in two pieces
and merge the result (or something similar).
The second option is madness. There is no way of knowing if the request
is for a tile that crosses the dateline once or fifty times (no easy way
to calculate the width of the request in map units).
I don't think either of these options is particularly nice. It seems
that the only general way to handle this is to have the client do one of
two things:
1) allow for arbitrary tile sizes/grid origins and hide tiles or potions
of tiles that cross the dateline
2) only allow for fixed tile sizes, zoom levels, and grid origins
Also, since Google is mentioned here, it is worth talking about the
differences between Google Maps and OpenLayers. Google can "wrap" the
dateline because it decided ahead of time what the lattice of tiles
should look like. At every zoom level, there are an integer number of
tiles that fit perfectly between one edge of the world and the other.
Google uses a Mercator projection and crops things so that at zoom 0
there is 1 tile covering (most of) the earth. At zoom 1, there are 4
tiles. Etc.
If you want to serve up data in EPSG:4326 that does something similar,
you might start out at 2 tiles covering the earth (each 180 x 180
degrees). Eight tiles at the next zoom level. Etc.
So, if you were to create a custom layer in OpenLayers that would wrap
the dateline, you could choose one of those two projections (or any
other), and your resulting lattice of tiles would be different depending
on your choice - keeping in mind that one will never overlay on the other.
Interested to hear more thoughts.
Tim
I'd like to be able to show maps that have the International Dateline as
the center point on the map.
>
> Thanks for the assistance.
>
> Dave Neitz
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
More information about the Users
mailing list