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

Introduction

Imagery is one of the most important kinds of data to work with in a GIS system. An eye-catching map with beautiful cartography can make an immediate difference to the appeal of a mapping application.

This chapter is all about working with different types of raster layers. We have tried to summarize, with a set of recipes, the most common and important use cases you can find day to day when working with OpenLayers and third-party layer providers.

OpenLayers offers several classes to integrate with different imagery providers, from proprietary providers, such as Bing Maps, and MapQuest, to open source ones, such as OpenStreetMap, and Stamen, or even any Web Map Service (WMS) service provider.

The base class for any layer type is ol.layer.Base, which offers a set of common properties and defines the common behavior for other layer classes. The ol.layer.Layer class further extends the base class with some extra methods and creates sub-classes, such as ol.layer.Tile, which we'll frequently use during this chapter.

The layer itself is decoupled from the layer source. The base class for any layer source is ol.source.Source. This class is extended through other sub-classes, such as ol.source.Tile, and furthermore with ol.source.TileImage, which offers many sub-classes that lay the foundations for the raster layer sources that we'll be using in this chapter later on.

In addition to this, many layer sources inherit from the ol.source.XYZ class, which pides the layer into zoom levels. This way, each zoom level covers the same area but uses a greater set of tiles. For example, at level zero, a grid with one tile covers the whole world; at level one, a grid with four tiles covers the whole world; and so on. As we can see, on each level, the number of tiles and their resolution increases.

This chapter introduces you to some of the built in raster layers from OpenLayers, as well as taking a look at arbitrary WMS layers, and how to manage some common layer properties.

主站蜘蛛池模板: 红原县| 玉林市| 玛纳斯县| 嘉荫县| 南宫市| 揭东县| 鄂托克前旗| 彭阳县| 阳高县| 邵阳县| 荥经县| 高清| 阿拉善右旗| 黄梅县| 辉县市| 宁津县| 治县。| 平顶山市| 大荔县| 炉霍县| 张掖市| 方正县| 宁安市| 铅山县| 樟树市| 南陵县| 汤原县| 犍为县| 五指山市| 嘉定区| 城固县| 普兰店市| 吉隆县| 乌海市| 永寿县| 长海县| 昆山市| 太康县| 盐池县| 阿拉善左旗| 张家界市|