Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
430
Setting Tile Origin
posted

For traditional WMS and TMS services, the origin is in the bottom left. However, for most of the BIG map services (google, bing, etc.) it is in the top left. This is causing my tiles to render in the incorrect position for my own little service. Is it possible to set the Tile Origin for a custom map tile source? This is a proving to be a very annoying stumbling block -- in that I can't configure xamGeographicMap and that I can't configure my map service to correctly serve up the tiles in the correct order. I only need one to work as desired and I can move forward.

In another post I mentioned that I was able to get my map service to render with "gmaps" compatibility, however, my excitement fizzled when I discovered some kind of bug or configuration issue on the server that serves up the tiles incorrectly after a certain zoom level. I am attempting to use GeoServer, however, it does not yet provide a way to change the origin for my map service.

Parents
  • 34510
    Offline posted

    Hi Kristopher,

    Are you talking about the coordinate system used in the XamGeographicMap versus what your custom tile service is using?  Where the geomap works off a system that has tile (0,0) at the top-left and your service has (0,0) at the bottom-left?  Currently this can't be changed.  If you have written a custom MapTileSource for the geomap, in the GetTileLayers method it will ask you to provide tile URIs while giving you the X and Y coordinates of the tile it wants.  These coordinates are based on the top-left origin system.

    What you will need to do is transform the coordinates to a bottom-left system.  So when the geomap asks for (0,0), you need to give it your (0,4) tile instead (assuming 4 is the maximum number of tiles for the current zoom level).  You would do this inside your GetTileLayers method inside the custom MapTileSource.

Reply Children