当前位置:网站首页>openlayers 5.0 加载arcgis server 切片服务

openlayers 5.0 加载arcgis server 切片服务

2022-04-23 19:08:00 Gis烤羊腿真好吃

import Map from 'ol/Map.js';
import View from 'ol/View.js';
import Tile from 'ol/layer/Tile.js';
import TileArcGISRest from 'ol/source/TileArcGISRest.js';
var webgissource={}

var view=new View({
    center:[106.516,29.56] ,//中心点
     zoom: 12,//当前等级
     minZoom: 5,//最小等级
     maxZoom: 17,//最大等级
     projection: 'EPSG:4326'//坐标系
 })
 webgissource.VectorBaseMap=new Tile({
     visible: true,
     source: new TileArcGISRest({
        url: 'localhost:6080/arcgis/rest/services/founder/china/MapServer'//服务路径
     }),
  })
 var map = new Map({
     loadTilesWhileAnimating: true,
     target: 'mapDiv',//容器id
     layers:[webgissource.VectorBaseMap],
     view: view
 });

版权声明
本文为[Gis烤羊腿真好吃]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_38190600/article/details/102487821