Skip to content

Commit

Permalink
support for MultiPoint geometries in MVT data sources
Browse files Browse the repository at this point in the history
  • Loading branch information
bcamper committed Mar 16, 2020
1 parent f6237a5 commit 8554c27
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/sources/mvt.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,14 @@ export class MVTSource extends NetworkTileSource {
geometry.coordinates = coordinates;

if (VectorTileFeature.types[feature.type] === 'Point') {
geometry.type = 'Point';
geometry.coordinates = geometry.coordinates[0][0];
if (coordinates.length === 1) {
geometry.type = 'Point';
geometry.coordinates = geometry.coordinates[0][0];
}
else {
geometry.type = 'MultiPoint';
geometry.coordinates = geometry.coordinates[0];
}
}
else if (VectorTileFeature.types[feature.type] === 'LineString') {
if (coordinates.length === 1) {
Expand Down

0 comments on commit 8554c27

Please sign in to comment.