antvis / data-set

state driven all in one data process for data visualization.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GeoJSON 数据不支持自定义属性

acathur opened this issue · comments

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;
}