04.02.2013 Views

MapInfo Spatial Server Map Tiling Service - Product Documentation ...

MapInfo Spatial Server Map Tiling Service - Product Documentation ...

MapInfo Spatial Server Map Tiling Service - Product Documentation ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1. Calculate the tile column:<br />

col = (pixelX ÷ tileWidth) + 1<br />

2. Calculate the tile row:<br />

row = (pixelY ÷ tileHeight) + 1<br />

It is important to remember that the pixel location is relative to the map's pixel space and not the screen<br />

space. It may not be enough to directly feed a pixel coordinate from a mouse location on the screen.<br />

For instance, you may have to convert the mouse location to a location in the map's pixel space. This<br />

involves keeping track of the location in map pixels space of the upper right-hand corner of the image<br />

control and offsetting the mouse location with that location.<br />

Transforming a <strong>Map</strong> Coordinate to a Tile Coordinate<br />

Using the information specified in the section Transforming a Pixel to a <strong>Map</strong> Coordinate on page 54,<br />

instead, reverse the affine transform and create a transform that goes from map coordinates to pixels.<br />

Feed a coordinate in the map's projection into the affine transform and the result is a coordinate in the<br />

map's pixel space. Next, apply the steps from the section Transforming a Pixel to a Tile Coordinate<br />

on page 54 to convert the pixels from map space to a tile coordinate.<br />

<strong>Map</strong> <strong>Tiling</strong> <strong>Service</strong> Guide<br />

Appendix C: How Pixels, Tiles, and <strong>Map</strong> Coordinates are Transformed<br />

55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!