====== ThinkGeo Cloud Map Raster Tiles ====== ThinkGeo Cloud Raster Tile serves raster map tiles through XYZ. Check out [[https://samples.thinkgeo.com/thinkgeo-cloud/maps/xyz/|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: * Get a ThinkGeo Cloud Client Key. Check out [[https://wiki.thinkgeo.com/wiki/thinkgeo_cloud_client_keys_guideline|ThinkGeo Cloud Client Keys Guideline]] see how to apply one. It's free for 60 days. * Visit our [[https://cloud.thinkgeo.com/help/|ThinkGeo Cloud API Explorer]], click the "Authorize" button at the top and enter your client credentials. You are then free to play with all the APIs online. //**ThinkGeo Cloud provides a RESTful API to consume the map tiles**:// ==== Get Maps Raster Tile By XYZ ==== Get the raster tile at the specified zoom level and X/Y coordinate, using the supplied 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 of the raster tile. Available values are: * light - street map, light theme * dark - street map, dark theme * aerial - aerial imagery * hybrid - aerial imagery with street map overlaid on top * transparent-background - street map with transparent background * resolution: The resolution of the raster tile. "x1" is available for all sizes, while "x2" is supported in certain scenarios. "x1" is intended for display on a regular 72-96 DPI laptop or desktop monitor, while "x2" is for high-DPI displays such as mobile phones and tablets. When you request an "x2" tile, the server will double the size of the image while rendering the same geographic area. So if you request an "x2" tile at size 512, the server will return you a 1024x1024 image. * srid: The spatial reference system ID for the raster tile. Currently only "3857" (Spherical Mercator) is supported. * tileSize: The pixel size of the raster 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 zoom level with the entire world in one single tile. Each zoom level z has 4z tiles for the entire world. The greater the z value, the closer to the Earth's surface the current zoom level is. * tileX: The X index (column index in the tiling matrix) of the requesting tile. Valid range is between 0 and 4z for each given zoom level z. * tileY: The Y index (row index in the tiling matrix) of the requesting tile. Valid range is between 0 and 4z for each given zoom level z. * fileExtension: The image format of the raster tile. Different formats are available depending on the tile style you have requested, as follows: * png - supported for light, dark, and transparent-background style tiles. * jpeg or jpg - supported for aerial and hybrid style tiles. * apikey: The ThinkGeo Cloud API key that authenticates your request. Here is an example of a raster tile request URL: [[https://cloud.thinkgeo.com/api/v1/maps/raster/light/x1/3857/512/0/0/0.png]]. When no API key is specified, the tile will be watermarked with a ThinkGeo logo. To remove the watermark, a valid ThinkGeo Cloud API key is required. Please check out [[thinkgeo_cloud_client_keys_guideline|Client Keys Guideline]] to find out how to get your own API key. Visit [[https://cloud.thinkgeo.com/help/#/MapsRasterTiles/GetMapsRasterTileByXyzV1|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 [[https://www.openstreetmap.org|Open Street Map]], and partially from [[https://www.naturalearthdata.com/|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 [[https://www.usgs.gov/land-resources/nli/landsat|LandSat]], it covers the entire world. * The data for zoom level 12 ~ 19 comes from [[https://www.fsa.usda.gov/programs-and-services/aerial-photography/imagery-programs/naip-imagery/index|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 [[thinkgeo_offline_data_maps_streets|Maps Streets Offline Data]] and [[thinkgeo_offline_data_maps_imagery|Maps Imagery Offline Data]] for detail. ===== Consume from Client Side ===== Multiple ways are provided to consume the server from different platforms. ==== From JavaScript Library ==== [[https://openlayers.org/|OpenLayers]] and [[https://leafletjs.com/|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 [[https://samples.thinkgeo.com/thinkgeo-cloud/maps/xyz/|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: using ThinkGeo.Cloud; // Setup the overlay ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay = new ThinkGeoCloudMapsOverlay("Your Client ID", "Your Client Secret"); // or ThinkGeoCloudMapsOverlay thinkGeoMapsOverlay= new ThinkGeoCloudMapsOverlay("Your apiKey"); Map.Overlays.Add(thinkGeoMapsOverlay); * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWinForms|ThinkGeoCloudMapsSample-WinForms]] for [[map_suite_desktop_for_winforms|Map Suite Desktop For WinForms]] * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWpf|ThinkGeoCloudMapsSample-WPF]] for [[map_suite_desktop_for_wpf|Map Suite Desktop For WPF]] * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWebForms|ThinkGeoCloudMapsSample-WebForms]] for [[map_suite_web_for_webforms|Map Suite Web For WebForms]] * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForMvc|ThinkGeoCloudMapsSample-MVC]] for [[map_suite_web_for_mvc|Map Suite Web For MVC]] * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForiOS|ThinkGeoCloudMapsSample-iOS]] for [[map_suite_mobile_for_ios|Map Suite Mobile For iOS]] * Sample code: [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForAndroid|ThinkGeoCloudMapsSample-Android]] for [[map_suite_mobile_for_android|Map Suite Mobile for Android]] ==== Consume From Client Side SDKs ==== Our .NET SDK //ThinkGeo Cloud Client// makes it easy to consume all of the ThinkGeo Cloud services in your applications. It's available on [[https://www.nuget.org/packages/ThinkGeo.Cloud.Client|NuGet]]. IntelliSense hints will help you get started, and you can also refer to the [[thinkgeo_cloud_.net_client_apis|ThinkGeo Cloud Client API list]] for details. At the NuGet Package Manager terminal, you can install this package by running the command: ''Install-Package ThinkGeo.Cloud.Client -Version VERSION_TO_BE_INSTALLED''. You can also check out ThinkGeo on GitHub for [[https://github.com/ThinkGeo?utf8=%E2%9C%93&q=cloud&type=&language=|samples utilizing the ThinkGeo Cloud Client]]. Sample Code: using ThinkGeo.Cloud; MapsClient client = new MapsClient("Your Client ID", "Your Client Secret"); Stream imageStream = client.GetRasterTile(z, x, y, projection, mapType, tileSize, tileResolution); Native SDKs for //Python//, //iOS// and //Android// are coming soon. ===== Samples ===== Online Sample: * [[https://samples.thinkgeo.com/thinkgeo-cloud/maps/xyz/|ThinkGeo Cloud Raster Map Online Sample]] Desktop Sample: * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWinForms|ThinkGeoCloudMapsSample-WinForms]] for [[map_suite_desktop_for_winforms|Map Suite Desktop For WinForms]] * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWpf|ThinkGeoCloudMapsSample-WPF]] for [[map_suite_desktop_for_wpf|Map Suite Desktop For WPF]] Web Sample: * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForWebForms|ThinkGeoCloudMapsSample-WebForms]] for [[map_suite_web_for_webforms|Map Suite Web For WebForms]] * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForMvc|ThinkGeoCloudMapsSample-MVC]] for [[map_suite_web_for_mvc|Map Suite Web For MVC]] Mobile Sample: * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForiOS|ThinkGeoCloudMapsSample-iOS]] for [[map_suite_mobile_for_ios|Map Suite Mobile For iOS]] * [[https://github.com/ThinkGeo/ThinkGeoCloudMapsSample-ForAndroid|ThinkGeoCloudMapsSample-Android]] for [[map_suite_mobile_for_android|Map Suite Mobile for Android]] ===== Related Links ===== * [[thinkgeo_cloud_maps_wms|ThinkGeo Cloud Maps WMS]] * [[thinkgeo_cloud_maps_vector_tiles|ThinkGeo Cloud Maps Vector Tiles]] * [[thinkgeo_cloud_geocoding|ThinkGeo Cloud Geocoding]] * [[thinkgeo_cloud_reverse_geocoding|ThinkGeo Cloud Reverse Geocoding]] * [[thinkgeo_cloud_elevation|ThinkGeo Cloud Elevation]] * [[thinkgeo_cloud_projection|ThinkGeo Cloud Projection]] * [[thinkgeo_cloud_colors|ThinkGeo Cloud Colors]] * [[thinkgeo_cloud_timezone|ThinkGeo Cloud Time Zones]]