GeoJSON 数据不支持自定义属性
acathur opened this issue · comments
data-set/src/connector/geojson.js
Lines 13 to 35 in ead42aa
function GeoJSONConnector(data, options, dataView) { | |
dataView.dataType = GEO; | |
const features = cloneDeep(data.features); | |
// pre-process | |
features.forEach(feature => { | |
feature.name = feature.properties.name; | |
feature.longitude = []; | |
feature.latitude = []; | |
const pathData = feature.pathData = geoPathGenerator(feature); | |
const points = getPointAtLength(pathData); | |
points._path.forEach(point => { | |
feature.longitude.push(point[1]); | |
feature.latitude.push(point[2]); | |
}); | |
const centroid = geoPathGenerator.centroid(feature); | |
feature.centroidX = centroid[0]; | |
feature.centroidY = centroid[1]; | |
}); | |
// dataView.origin = features; | |
return features; | |
} |