admin管理员组文章数量:1355522
Starting from OpenLayers v. 10.3 I can no longer load topoJSON files which worked till 10.2.1. Here's what happens:
-I made no changes in js code. A layer is configured as follows
var vectorLayer = new ol.layer.VectorImage({
source: new ol.source.Vector({
format: new ol.format.TopoJSON(),
url: 'shape/myLayer.json',
}),
style: {
'stroke-color': 'black',
'stroke-width': 1.5,
},
can });
topoJSON
file is the same I used till rel. 10.2.1if I use OL rel. 10.3 (and 10.3.1 and 10.4) map doesn't show the layer; if I query layer extent with a simple alert I get "infinity, infinity, infinity, infinity", so I guess no element from topoJSON file has been loaded
everything works in 10.3 if I replace the topoJSON file with the very same file in geoJSON format (I can see features in map and I get correct extent)
A geoJSON
file works the same in rel. 10.3 as in 10.2.1, so I believe something broke topoJSON
source in 10.3.
Please note that I don't use npm, still everything is working as expected except topoJSON (starting from 10.3; and in 10.3.1 and 10.4 also).
Thanks in advance for help
本文标签: OpenLayers 103 and topojsonStack Overflow
版权声明:本文标题:OpenLayers 10.3 and topojson - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743973132a2570769.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论