< docs

# tilingScheme test

This page tests initializing geomap with services requiring different tilingSchemes.

Dynamic services are not yet implemented but will be able to be layered on top of tiled services as they don't require a tilingScheme at all.

For this example, I have set $.geo.proj to null and am setting the center in real map units. This is because the second service, New Jersey, is not in web mercator and geomap does not provide a built-in conversion from lon/lat.

The New Jersey service is a tiled service with an ArcGIS Server REST endpoint. The level stops of an ArcGIS Server tile cache are often not a power of two and therefore cannot be calculated. We list them all out by using the pixelSizes property of the tilingScheme instead of specifying basePixelSize and levels properties.

## examples

Choose a service/tilingScheme combo and click set to refresh the page and re-initialize the map.

default OSM (web mercator via hosted images)

    services: [
      {
        id: "OSM",
        type: "tiled",
        src: function (view) {
          return "http://tile.openstreetmap.org/"
           + view.zoom + "/"
           + view.tile.column + "/"
           + view.tile.row
           + ".png";
        },
        attr: "© OpenStreetMap & contributors, CC-BY-SA"
      }
    ],
    tilingScheme: {
      tileWidth: 256,
      tileHeight: 256,
      levels: 18,
      basePixelSize: 156543.03392799936,
      origin: [-20037508.342787, 20037508.342787]
    }

New Jersey (NAD83 / New Jersey (ft US); ESPG 3424 via ArcGIS Server REST API)

    services: [
      {
        id: "NewJersey",
        type: "tiled",
        src: function (view) {
          return "http://njgin.state.nj.us/ArcGIS/rest/services/Basemap/basemap/MapServer/tile/"
           + view.zoom + "/"
           + view.tile.row + "/"
           + view.tile.column;
        }
      }
    ],
    tilingScheme: {
      tileWidth: 512,
      tileHeight: 512,
      pixelSizes: [
        3472.22222222222,
        2604.16666666667,
        2170.13888888889,
        1562.5,
        976.5625,
        494.791666666667,
        260.416666666667,
        130.208333333333,
        65.1041666666667,
        32.5520833333333,
        21.7013888888889,
        10.8506944444444,
        5.20833333333333,
        2.08333333333333,
        1.04166666666667
      ],
      origin: [-842000, 1440000]
    }