kikitte / MVTImageryProvider

A Mapbox style renderer for CesiumJS
MIT License
191 stars 50 forks source link

mapbox 1.13.1的样式文件不可用啊 #9

Closed jiuxs33 closed 2 years ago

kikitte commented 2 years ago

嘿,为了解决这个问题,你需要提供无法加载的样式文件并描述当前软件的表现以及你所期望的表现,简而言之就是让别人能够复现并知晓到底发生了什么事。

jiuxs33 commented 2 years ago

错误 layers[30].filter[2]: Expected arguments of type (number, number) | (string, string), but found (value, number) instead. 样式设置: { "id": "town-label", "type": "symbol", "source": "composite", "source-layer": "place", "metadata": { "name": "乡镇街道" }, "minzoom": 13, "maxzoom": 19, "filter": [ "all", [ "==", [ "get", "class" ], "town" ] ], "layout": { "text-size": 13, "text-font": [ "KlokanTech Noto Sans CJK Bold" ], "text-field": "{name:nonlatin}", "text-letter-spacing": 0.15, "text-max-width": 6 }, "paint": { "text-color": "#000000", "text-halo-color": "#ffffff", "text-halo-width": 0.8, "icon-halo-color": "#ffffff", "icon-color": "#333333" } }

kikitte commented 2 years ago

从提供的报错信息来看,出错的地方为Layer的filter属性,该属性为一返回布尔值的表达式。例子中,该处涉及到mapbox style的三个表达式:all==get。从mapbox style specification官方网站提供的信息可知,all、==和get 要求mapbox gljs 版本大于>= 0.41.0。当前Mapbox-basic-renderer对应的mapbox gljs版本为 0.43.0,可知完全支持上述样例中的filter表达式,另外我经过测试也证明了这一点。

结合出错信息和样例来看,报错信息对应的图层不是给的样例图层,原因在于”town"并非number类型。

所以该问题我更倾向于==表达式中 矢量瓦片要素属性类型和 第二个用于比较的参数类型不一致导致,并非Mapbox-basic-render的原因。

jiuxs33 commented 2 years ago

好的 我再看一下,谢谢