TileArcGISRest这个接口构造的请求无法从SuperMap iServer RESTMAP服务中得到瓦片,出图的正确格式需要像这样的:“https://iserver.supermap.io/iserver/services/map-world/rest/maps/World/tileImage.png?redirect=false&transparent=true&cacheEnabled=true&_cache=true&origin=%7B%22x%22%3A-180%2C%22y%22%3A90%7D&overlapDisplayed=false&x=3&y=1&width=256&height=256&scale=1.3502381658248012e-8”。
SuperMap iClient for OpenLayers 封装有可以只输入URL就可以获取瓦片的接口——ol.source.TileSuperMapRest,可以直接调用。
提供一种原生OpenLayers加载SuperMap iServer的rest地图服务的方式:以zxy瓦片的方式加载
先打开rest服务查看是否有zxyTileImage接口,然后加载地图
const superMapLayer = new ol.layer.Tile({ source: new ol.source.XYZ({ url: "https://iserver.supermap.io/iserver/services/map-world/rest/maps/World/zxyTileImage.png?z={z}&x={x}&y={y}&width=256&height=256" }) });