问题描述
我将我的应用程序从OpenLayers 4.6.4升级到6.1.1,并且我无法再访问 ol.Tile 。我的代码如下,可在4.6.4中使用。我该怎么做才能在OpenLayers 6中实现同一目标?
我的index.html是:
<!-- OpenLayers 6.1.1 -->
<link rel="stylesheet" href="ol.css">
<script src="ol.js"></script>
<div tabindex="700" id="map" class="map"></div>
<script type="module">
import MapView from './mapview.js';
var mv = new MapView();
</script>
我的地图视图类包含以下内容(在OL4中有效,但在OL6中无效)。似乎平铺不再位于OL5 +中的 ol 对象中。有什么办法解决吗?
class CanvasTile extends ol.Tile {
constructor(options) {
super(options);
}
}
我得到的错误是
未捕获的TypeError:类扩展未定义的值不是构造函数或null
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)