ol-debug.js - 断言失败:第三条指令应该是一个数字
ol-debug.js - Assertion failed: 3rd instruction should be a number
我正在将在线应用程序从 OpenLayers 3.0 升级到当前版本 3.9。
更改为新向量 api ( https://github.com/openlayers/ol3/releases/tag/v3.5.0 ) 我收到以下错误(使用 ol-debug.js ):
Assertion failed: 3rd instruction should be a number
goog.debug.Error@ ... /InViTo_3/js/ol-debug.js?ver=20140502:2606:17
goog.asserts.AssertionError@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:4307:1
goog.asserts.doAssertFailure_@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:4366:11 goog.asserts.assert@
... /InViTo_3/js/ol-debug.js?ver=20140502:4396:1
ol.render.canvas.Replay.prototype.replay_@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:60032:1
ol.render.canvas.Replay.prototype.replay@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:60094:1
ol.render.canvas.ReplayGroup.prototype.replay@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:61576:1
ol.renderer.canvas.VectorLayer.prototype.composeFrame@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:74555:1
ol.renderer.canvas.Map.prototype.renderFrame@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:74969:7
ol.Map.prototype.renderFrame_@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:84629:3
goog.async.AnimationDelay.prototype.doAction_@ ...
/InViTo_3/js/ol-debug.js?ver=20140502:39611:3
实际上,我有两个从 geojsons 构建的矢量图层:
source: new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures( jsondata, {featureProjection: 'EPSG:' + jsondata.srid} )
})
第一层(折线)运行良好。
第二个(多边形)的加载导致错误并使所有地图不稳定(未正确刷新)。
在以下位置报告了类似的错误:
https://groups.google.com/forum/#!topic/ol3-dev/hA5wNYL3CxE
我试图明确投影,但没有帮助。
这里是错误演示:
http://130.192.92.243:8000/~invitest/?page_id=2&pname=project&act=view&cid=259
谢谢,
瑞奇克斯
您在某些功能的样式中使用字符串,例如 "1"
作为线宽。断言错误表明宽度必须是数字:http://openlayers.org/en/v3.9.0/apidoc/ol.style.Stroke.html
我正在将在线应用程序从 OpenLayers 3.0 升级到当前版本 3.9。
更改为新向量 api ( https://github.com/openlayers/ol3/releases/tag/v3.5.0 ) 我收到以下错误(使用 ol-debug.js ):
Assertion failed: 3rd instruction should be a number
goog.debug.Error@ ... /InViTo_3/js/ol-debug.js?ver=20140502:2606:17 goog.asserts.AssertionError@ ... /InViTo_3/js/ol-debug.js?ver=20140502:4307:1 goog.asserts.doAssertFailure_@ ... /InViTo_3/js/ol-debug.js?ver=20140502:4366:11 goog.asserts.assert@ ... /InViTo_3/js/ol-debug.js?ver=20140502:4396:1 ol.render.canvas.Replay.prototype.replay_@ ... /InViTo_3/js/ol-debug.js?ver=20140502:60032:1 ol.render.canvas.Replay.prototype.replay@ ... /InViTo_3/js/ol-debug.js?ver=20140502:60094:1 ol.render.canvas.ReplayGroup.prototype.replay@ ... /InViTo_3/js/ol-debug.js?ver=20140502:61576:1 ol.renderer.canvas.VectorLayer.prototype.composeFrame@ ... /InViTo_3/js/ol-debug.js?ver=20140502:74555:1 ol.renderer.canvas.Map.prototype.renderFrame@ ... /InViTo_3/js/ol-debug.js?ver=20140502:74969:7 ol.Map.prototype.renderFrame_@ ... /InViTo_3/js/ol-debug.js?ver=20140502:84629:3 goog.async.AnimationDelay.prototype.doAction_@ ... /InViTo_3/js/ol-debug.js?ver=20140502:39611:3
实际上,我有两个从 geojsons 构建的矢量图层:
source: new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures( jsondata, {featureProjection: 'EPSG:' + jsondata.srid} )
})
第一层(折线)运行良好。 第二个(多边形)的加载导致错误并使所有地图不稳定(未正确刷新)。
在以下位置报告了类似的错误: https://groups.google.com/forum/#!topic/ol3-dev/hA5wNYL3CxE 我试图明确投影,但没有帮助。
这里是错误演示: http://130.192.92.243:8000/~invitest/?page_id=2&pname=project&act=view&cid=259
谢谢, 瑞奇克斯
您在某些功能的样式中使用字符串,例如 "1"
作为线宽。断言错误表明宽度必须是数字:http://openlayers.org/en/v3.9.0/apidoc/ol.style.Stroke.html