User Tools

Site Tools


thinkgeo_cloud_maps_raster_tiles

This is an old revision of the document!


ThinkGeo Cloud Map Raster Tiles

ThinkGeo Cloud Raster Tile serves raster map tiles through XYZ. Check out ThinkGeo Cloud Raster Map Online Sample for a quick look.

RESTful APIs

* Try it Online: All the ThinkGeo Cloud RESTful APIs can be tested online following the instructions below:

ThinkGeo Cloud provides a RESTful API to consume the map tiles:

Get Maps Raster Tile By Xyz

Get one Raster Tile based on given parameters.

HTTP GET 
https://cloud.thinkgeo.com/api/v1/maps/raster/{style}/x{resolution}/{srid}/{tileSize}/{tileZ}/{tileX}/{tileY}.{fileExtension}?apikey={key}

URL Parameters

  • style: The style for the requesting tile, available values are “light”, “dark”, “aerial”, “hybrid” and “transparent-background”
  • resolution: The resolution for the requesting tile. “x1” is available and “x2” will be supported soon. “x1” is good enough for a regular 96 dpi monitor while “x2” is good for high DPI display especially on Apple devices. Behind the Scene, the server will create an 1024*1024 image to serve a 512*512 x2 tile.
  • srid:The SRID for the requesting tile, currently only “3857” (Spherical Mercator) is supported
  • tileSize: The size of the requesting tile, “512” is recommended. “256” is also supported.
  • tileZ: The Z index (zoom level) of the requesting tile, from 0 to 19. Zoom Level 0 is the highest zoomlevel with the entire world in one single tile, Zoom Level z has 4^z tiles for the entire world. The greater the z is, the lower the current zoomlevel is.
  • tileX: The X index (column index in the tiling matrix) of the requesting tile. It is within [0, 4^z) for zoomlevel z.
  • tileY: The Y index (row index in the tiling matrix) of the requesting tile. It is within [0, 4^z) for zoomlevel z.
  • fileExtension: The format of the requesting tile, “png” is available for light/dark/transparent-background styles, “jpeg” and “jpg” are available for aerial/hybrid styles.
  • apikey: the apikey.

Visit GetMapsRasterTileByXyz and click “Try It Out” to explore this API online.

Map Data Coverage

Map Suite Raster Tile Data is composed of street tiles and aerial images tiles.

  • Street Tiles

    The data of streets tiles (light / dark / transparent-background ) mainly come from Open Street Map, and partially from Natural Earth. The tiles cover the entire world. The tiles are scheduled to be updated on a monthly basis.

  • Aerial Image Tiles
    • The data for zoom level 0 ~ 11 comes from LandSat, it covers the entire world.
    • The data for zoom level 12 ~ 19 comes from NAIP 2018. It covers the contiguous US (48 states). The tiles are scheduled to be updated every 2 years.

Our World Map data can be purchased separately. It can be consumed offline by Map Suite SDKs. Check out Maps Streets Offline Data and Maps Imagery Offline Data for detail.

Consume from Client Side

Multiple ways are provided to consume the server from different platforms.

From JavaScript Library

OpenLayers and Leaflet have built-in classes consuming the tiles through XYZ. Here is the code snippet in OpenLayers.

var lightLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
	urls: [
	  "https://cloud.thinkgeo.com/api/v1/maps/raster/light/x1/3857/512/{z}/{x}/{y}.png?apikey=yourkey",
	],
	tileSize: 512
  }),
  name: "lightLayerKey"
});

The sample code in LeafLet:

var lightLayer = L.tileLayer("https://cloud.thinkgeo.com/api/v1/maps/raster/light/x1/3857/512/{z}/{x}/{y}.png?apikey=yourkey");

Here is an Online Sample consuming the map tiles using OpenLayers.

From Map Suite UI Controls

All of the MapSuite UI Controls have built-in a straightforward way for consuming the raster tiles.

Sample Code:

// Setup the overlay
ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("clientId", "clientSecret");
// or ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("apiKey");
Map.Overlays.Add(thinkGeoMapsOverlay);

From Client Side SDKs

A .Net SDK ThinkGeo Cloud Client is provided to consume the ThinkGeo Cloud Service as well. It's available on NuGet, here is the complete API List.

Sample Code:

MapsClient client = new MapsClient("clientId", "clientSecret");
Stream imageStream = client.GetRasterTile(z, x, y, projection, mapType, tileSize, tileResolution);
Task<Stream> task = client.GetRasterTileAsync(z, x, y, projection, mapType, tileSize, tileResolution);

Native SDKs for Python, iOS and Android are coming soon.

Samples

thinkgeo_cloud_maps_raster_tiles.1552025333.txt.gz · Last modified: 2019/03/08 06:08 by tgwikiupdate