Hi together,

I've set up a small test page to integrate a custom TMS Layer into OpenLayers. 
The tiles are displayed correctly but when I place a marker on the map it is 
placed north of the real position. Example:

http://www.uecmoedling.at/maptest.html

Mapnik layer is shown by default: shows the correct position
when switching the layer you get to a position which is exactly to the north of 
the real position

Maybe anyone can give me an hint which parameters I need to adjust to fix this 
shifting? I tried to modifiy the north/south bounds but this resulted in the 
marker changing position depending on the zoom level.

I got the following information from the people how manage the tile server but 
I don't know exactly what to do with these infos to make it work in OpenLayers:

The number of grids at a given zoom level is: gridWidth = 2^zoomlevel
The (earth) radius for the Mercator map projection is calculated as radius = 
(gridWidth * tileSize) / (2.0 * PI) where tileSize=256.

The x and y grid indexes are given by the calculated Mercator coordinate 
divided by the tile size:
    xGrid = xCoordinate / tileSize
    yGrid = yCoordinate / tileSize

Mercator coordinates will range from 0 through (gridWidth * tileSize).

The origin for the grid coordinates is at 180° W (false easting = radius * PI), 
and approx 85° N (false northing = -radius * PI), with x increasing toward the 
East and y toward the South. The scale (mpp) is determined by scale = radius * 
2.0 * PI / (gridWidth * tileSize)

Other customers use an inverse flattening value of 298.257223563; so the 
projection is actually Mercator-ellipsoidal.

Thanks very much,
Michael

_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to