基于openlayers6加载ArcGIS图层

2020-03-07  本文已影响0人  初见_JS

参考官方示例Tiled ArcGIS MapServerImage ArcGIS MapServer

加载ArcGIS Server发布的切片服务和动态渲染服务,分别利用TileLayerTileArcGISRestImageLayerImageArcGISRest

加载切片服务

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'
        })
    })
);
上一篇 下一篇

猜你喜欢

热点阅读