[OpenLayers-Users] What layer type to use, and how to use it?
Tiemens, Gerben
Gerben.Tiemens at grontmij.nl
Tue Feb 2 10:22:09 EST 2010
Maybe this example will help you implement it. (look at the function for the tiles of mapnik openstreetmap.)
http://www.openlayers.org/dev/examples/sundials-spherical-mercator.html
Greets
Gerben
-----Oorspronkelijk bericht-----
Van: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Namens Dylan Parry
Verzonden: Monday, February 01, 2010 1:56 PM
Aan: users at openlayers.org
Onderwerp: [OpenLayers-Users] What layer type to use, and how to use it?
Hi,
I'm working on a project that has an existing tile server that generates and serves map tiles of the UK based on the British National Grid projection (EPSG:27700). The tiles are based on the following principles:
Tile x=0, y=0 begins at the UK origin, ie. 0,0 at the bottom-left of the map. The server accepts parameters for x, y and resolution. The coordinates for each tile can be calculated by by applying the following calculations:
// Min X Coordinate
x1 = x > 0 ? x * width * resolution : 0;
// Max X Coordinate
x2 = x * width * resolution + (width * resolution);
// Min Y Coorinate
y1 = y > 0 ? y * height * resolution : 0;
// Max Y Coordinate
y2 = y * height * resolution + (height * resolution);
The X and Y values are always greater than or equal to zero.
Now what I'm unsure of is what sort of layer I should use in order to implement a map viewer for this tile server. Any ideas? If so, how would I go about setting it up? My current experiments have all resulted in lots of maps of the sea when they should have been of land!! I know that the tile server is working correctly as it already works in other contexts.
>From what I've seen, the XYZ layer numbers tiles from the top-left, which is obviously different to how the tile server I'm using does it, so I've ruled that layer type out already. Am I going to have to define something from scratch or does another existing type already fit the bill?
Cheers,
--
Dylan Parry
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
<< Please read our E-mail Disclaimer at: Emaildisclaimer.Grontmij.com >>
More information about the Users
mailing list