SuperMap/iClient-JavaScript

创建TileSuperMapRest时报错,Cannot set property 'minX' of null

qizhaoheng opened this issue · 2 comments

`
import Tile from 'ol/layer/Tile.js'
import {TileSuperMapRest} from '@supermap/iclient-ol'

var layer = new Tile({
  source: new TileSuperMapRest({
    url: this.url,
    wrapX:true
  })
});

map.addLayer(layer);
`

谢谢您提的issue。为方便我们定位和解决问题,请尽量参照issue模板提问题。
使用您的部分代码,未重现您的问题。请检查下代码或提供完整代码及浏览器、打包插件、npm项目版本信息。
`
import Map from "ol/Map";
import View from "ol/View";
import Tile from "ol/layer/Tile.js";
import { TileSuperMapRest } from "@supermap/iclient-ol";

var url =
"https://iserver.supermap.io/iserver/services/map-world/rest/maps/World";
var map = new Map({
target: "map",
view: new View({
center: [0, 0],
zoom: 2,
projection: "EPSG:4326"
})
});
var layer = new Tile({
source: new TileSuperMapRest({
url: url,
wrapX: true
})
});
map.addLayer(layer);
`
image

ol@6.1.1
@supermap/iclient-ol@10.0.1
webpack@4.42.1

解决了,谢谢,openlayer版本的问题,我用的是5.x