Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoJSON 数据不支持自定义属性 #58

Open
acathur opened this issue May 3, 2019 · 0 comments
Open

GeoJSON 数据不支持自定义属性 #58

acathur opened this issue May 3, 2019 · 0 comments

Comments

@acathur
Copy link

acathur commented May 3, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant