官术网_书友最值得收藏!

Tiled map service layers

As I mentioned, tiled map service layers reference a cache of predefined images that are tiled together to create a seamless map display. Because these tiles have been generated in advance, ArcGIS Server doesn't need to create them on the fly and this usually means performance is excellent. For this reason, they are often used as base maps which are cartographically rich and therefore expensive to render:

The ArcGISTiledMapServiceLayer class is used when referencing a tiled (cached) map service exposed by ArcGIS Server. This is one of several tiled map service layer types that inherit from the TiledMapServiceLayer class, but it's the only one shown in our diagram as it is by far the most commonly-used, and the only one we'll be talking about in this book.

Since this type of object works against a pre-generated cache of map tiles, performance is often excellent. The constructor for the ArcGISTiledMapServiceLayer requires an URL to the map service endpoint, along with an optional options object that allow you to assign an ID to the map service and control transparency and visibility. The following code example creates an option-less ArcGISTiledMapServiceLayer and then calls Map.addLayer() to add the layer to the map:

var basemap = new ArcGISTiledMapServiceLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"); 
   map.addLayer(basemap); 
 

Therefore, ArcGISTiledMapServiceLayer is used primarily for the fast display of cached map data: either basemaps or complex cartography that doesn't change very often. (If the data changes, you must recreate the cache). You can also control the levels at which the data will be displayed. For instance, you may want to display data from a more generalized tiled map service showing interstates and highways while your users are zoomed out at levels 0-6, and then switch to a more detailed view once the user zooms in further. You can also control the transparency of each layer added to the map.

主站蜘蛛池模板: 江永县| 东乡县| 南川市| 拉萨市| 新余市| 阿拉尔市| 新余市| 延长县| 余干县| 云浮市| 尉犁县| 丹阳市| 新宁县| 定边县| 郁南县| 隆子县| 前郭尔| 静乐县| 吉林省| 塔河县| 苏尼特左旗| 大新县| 项城市| 綦江县| 蓝山县| 绍兴县| 苏尼特右旗| 泽州县| 贡觉县| 文山县| 平原县| 台东县| 淮阳县| 鄯善县| 揭阳市| 锡林浩特市| 荃湾区| 寿光市| 繁昌县| 杂多县| 定南县|