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

switch to new $type names #499

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions js/worker/workertile.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function sortLayerIntoBuckets(layer, mapping, buckets) {
if (!mapping[key].compare || mapping[key].compare(feature.properties)) {

// Only load features that have the same geometry type as the bucket.
var type = geometryTypeToName[feature._type];
var type = vt.VectorTileFeature.types[feature.type];
var filterType = mapping[key].filter && mapping[key].filter.$type;
if (!filterType || type === filterType) {
buckets[key].features.push(feature);
Expand All @@ -268,13 +268,10 @@ function sortLayerIntoBuckets(layer, mapping, buckets) {
}
}

var geometryTypeToName = [null, 'point', 'line', 'polygon'];

function getGeometry(feature) {
return feature.loadGeometry();
}

function getType(feature) {
return geometryTypeToName[feature._type];
return vt.VectorTileFeature.types[feature.type];
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"queue-async": "^1.0.7",
"rbush": "~1.3.2",
"unitbezier": "0.0.0",
"vector-tile": "0.0.5",
"vector-tile": "0.1.1",
"point-geometry": "0.0.0"
},
"devDependencies": {
Expand Down