简体   繁体   中英

GeoJSON tiles regression in v3.5.0

My vector tiles were rendered correctly up to version 3.4, but nothing is displayed in 3.5. There are no errors in the JS console. I haven't found any related changes in the most recent API. Is it a bug?

var tileVectorSource = new ol.source.TileVector({
   format: new ol.format.GeoJSON(),
   tileGrid: new ol.tilegrid.XYZ({
      maxZoom: 19
   }),
   url: 'data/{z}/{x}/{-y}.json'
});

var vectorLayer = new ol.layer.Vector({
   source: tileVectorSource,
   style: new ol.style.Style({
      fill: new ol.style.Fill({
         color: '#9db9e8'
      })
   })
});

var map = new ol.Map({
   target: 'map',
   layers: [
      new ol.layer.Tile({
         source: new ol.source.OSM()
      }),
      vectorLayer
   ],
   view: new ol.View({
      center: [1877798, 6568203],
      zoom: 6
   })
});

You have run into a bug see also: https://github.com/openlayers/ol3/issues/3750

The fix ( https://github.com/openlayers/ol3/pull/3747 ) will hopefully be in the upcoming 3.6 release

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM