如何解决我正在尝试将mapbox / geojson-vt与传单一起使用,它没有呈现LineString几何形状
我正在尝试在Leaflet地图上实现geojson-vt(https://github.com/mapbox/geojson-vt)。我可以渲染polygon,但是即使我已设置lineMetrics:true,geojson-vt也不渲染Linestring。我试图直接在地图上渲染Linestring,但是可以通过geojson-vt正常工作。
parseGeoJSONArray() {
this.parseVT({type: "FeatureCollection",features:[
{
"type": "Feature","properties": {
"dataType": "topology"
},"geometry": {
"type": "polygon","coordinates": [
[
[
-96.9391940144543,32.8664735931367
],[
-96.9392595850587,32.866428752984
],[
-96.9392587474335,32.8664278888345
],[
-96.9392265210577,32.8664499266917
],[
-96.9392065469181,32.8664293200505
],[
-96.939238773294,32.8664072821933
],[
-96.9392379356688,32.8664064180439
],[
-96.9392368435343,32.8664071648949
],[
-96.9392057092929,32.866428455901
],[
-96.9391857351533,32.8664078492599
],[
-96.9392168966981,32.8663865395824
],[
-96.9392180474394,32.8663859000334
],[
-96.9392171239039,32.8663849472532
],[
-96.9391515532995,32.866429787406
],[
-96.9391523909247,32.8664306515554
],[
-96.9391846703222,32.8664085774396
],[
-96.9392046444618,32.8664291840808
],[
-96.9391723650643,32.8664512581966
],[
-96.9391732026895,32.8664521223461
],[
-96.9391742811722,32.8664513848307
],[
-96.939205482087,32.8664300482303
],[
-96.9392254562266,32.8664506548714
],[
-96.9391931768291,32.8664727289872
],[
-96.9391940144543,32.8664735931367
]
]
]
}
},{
"type": "Feature","geometry": {
"type": "Linestring","coordinates": [
[
-96.9392379356688,32.8664064180439,0
],[
-96.9392057092929,32.866428455901,0
]
]
}
},"coordinates": [
[
-96.9392046444618,32.8664291840808,[
-96.9391723650643,32.8664512581966,0
]
]
}
}
]});
}
parseVT(data){
var tileIndex = geojsonvt(data,{
maxZoom: 19,// max zoom to preserve detail on; can't be higher than 24
tolerance: 3,// simplification tolerance (higher means simpler)
extent: 4096,// tile extent (both width and height)
buffer: 64,// tile buffer on each side
debug: 0,// logging level (0 to disable,1 or 2)
lineMetrics: true,// whether to enable line metrics tracking for Linestring/MultiLinestring features
indexMaxZoom: 5,// max zoom in the initial tile index
indexMaxPoints: 100000 // max number of points per tile in the index
});
console.log(tileIndex.tileCoords);
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。