最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

OpenLayers 10.3 and topojson - Stack Overflow

programmeradmin2浏览0评论

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.1

  • if 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

发布评论

评论列表(0)

  1. 暂无评论