Leaflet 我尝试将mapbox/geojson vt与传单一起使用,它不是渲染线字符串几何体
我正在尝试在传单地图上实现geojson-vt()。我可以渲染多边形,但geojson vt没有渲染LineString,即使我已将lineMetrics设置为true。我尝试直接在地图上渲染LineString,但通过geojson-vt无法工作Leaflet 我尝试将mapbox/geojson vt与传单一起使用,它不是渲染线字符串几何体,leaflet,mapbox,polygon,geojson,vector-tiles,Leaflet,Mapbox,Polygon,Geojson,Vector Tiles,我正在尝试在传单地图上实现geojson-vt()。我可以渲染多边形,但geojson vt没有渲染LineString,即使我已将lineMetrics设置为true。我尝试直接在地图上渲染LineString,但通过geojson-vt无法工作 parseGeoJSONArray() { this.parseVT({type: "FeatureCollection", features:[ {
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",
"properties": {
"dataType": "topology"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-96.9392379356688,
32.8664064180439,
0
],
[
-96.9392057092929,
32.866428455901,
0
]
]
}
},
{
"type": "Feature",
"properties": {
"dataType": "topology"
},
"geometry": {
"type": "LineString",
"coordinates": [
[
-96.9392046444618,
32.8664291840808,
0
],
[
-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);
}