加载
ArcGIS Server
发布的切片
服务和动态渲染
服务,分别利用TileLayer
、TileArcGISRest
和ImageLayer
、ImageArcGISRest
加载切片服务
- 引入所需组件
import TileLayer from 'ol/layer/Tile';
import {TileArcGISRest} from 'ol/source';
- 加载图层
map.addLayer(
new TileLayer({
extent: [107.66615218883604, 16.780085439091835, 113.39113536886373, 20.948901121306612],
source: new TileArcGISRest({
url: 'http://localhost:6080/arcgis/rest/services/layer_base/MapServer'
})
}))
加载动态渲染服务
- 引入所需组件
import {Image as ImageLayer} from 'ol/layer';
import {ImageArcGISRest} from 'ol/source';
- 加载图层
map.addLayer(
new ImageLayer({
source: new ImageArcGISRest({
ratio: 1,
params: {},
url: 'http://localhost:6080/arcgis/rest/services/layer_hainan/MapServer'
})
})
);
网友评论