Suggestions on Using the Cached Tiles |
In a scale, the more tiles of the map we get, the higher hit rate they will be. However, the greater hit rate could also result in the huge amount of tiles to be transferred, which will, in return, affect the map response time. Therefore, we need to find a balance between the server concurrency and the network traffic. In other words, the client side should display maps in an optimal way.
Therefore, you can consider the following factors when preparing tiles for map services.
Support the generation and use of raster tiles, vector tiles, and attribute tiles (obsolete) for map services, and the generated tile package supports sharing, propagation, and offline use. When using tiles, you can determine how to use them according to the characteristics of different tiles and specific usage scenarios.
Map tiles that split and store all layers in the map as raster images, with support for MongoDB distributed storage, SMTiles and MBTiles format , SuperMap UGC format and GeoPackage format. The SuperMap UGC format is a traditional raster tile format common among SuperMap products, and map tiles of the same version can be used universally. The "UGCV5" tile type supported by the distributed graph cutting service refers to the original cache of version 5.0.
In addition, the format of the raster tile supports PNG, PNG8, JPG_PNG, JPG, WebP (OTS WebP format is not currently supported in tile). If PNG is selected and the current map color value is 256 or less, SuperMap iServer will automatically save the image as PNG8 format to save storage space.
The specified vector layer in the map is split and stored in the form of vector tiles, and SVTiles format is supported.
In the application of map services, in addition to providing users with access to browse maps, there is also a practical need to provide users with operations such as querying, selecting, and highlighting. In this case, it is necessary to provide users with the above functions through element services. Just as map services require caching technology to improve access speed, feature services also need to pre generate tiles from vector data to enhance client rendering speed. Therefore, Vector Tile was born. When storing vector data, its volume is smaller than that of map tiles, making it more suitable for expressing terrain features with high timeliness requirements in maps, such as POI information, route information, etc. Common online map services, such as Google Maps and Baidu Maps, use raster tiles as the base map and overlay vector tiles.
SuperMap iServer's pre-caching service is available in 512 * 512 and 256 * 256 sizes.
Because when using the block layer of the iClient client to access the map services of the SuperMap iServer, the default is 256 * 256 size picture. For example, iClient for Ajax clients can use SuperMap.Web.Mapping.TiledDynamicRESTLayer (256 * 256 by default); iClient for Silverlight client can use the SuperMap.Web.iServerJava6R.TiledDynamicRESTLayer(256 * 256 by default). Of course, you can also change the TileSize is 512 * 512.
When caching, you need to set the size of the cached image according to the needs of the client, so as to make full use of the pre-cache.
In order to make full use of the cache generated by the pre-cache service of SuperMap iServer and realize multi-level zooming, a map can be pre-generated with cache images of multiple scales. The map interface in the SuperMap iServer client SDK (for JavaScript, for Flash, for Silverlight, etc.) can set the corresponding scale array corresponding to the cache scale on the server, so as to limit the map to zoom within the specified scale. Achieve the effect of multi-level scaling.
When caching, it is necessary to set the size of the cached image according to the client's needs in order to fully utilize the pre-cache.
Users can generate pre-caches for frequently visited map regions and then generate caches in real time for less frequently visited map regions as needed to reduce the cost of generating and storing caches.
For example, when accessing a world map, a sparsely populated area is not the focus of the client and a cache may not be generated. This allows you to specify a geographic range as the area shown in the following figure: