mirror of
https://github.com/mapbox/vector-tile-js.git
synced 2026-01-25 14:08:34 +00:00
parent
a3e6da8c02
commit
3d15fbae71
@ -155,7 +155,7 @@ VectorTileFeature.prototype.toGeoJSON = function(x, y, z) {
|
||||
type = 'MultiLineString';
|
||||
}
|
||||
|
||||
return {
|
||||
var result = {
|
||||
type: "Feature",
|
||||
geometry: {
|
||||
type: type,
|
||||
@ -163,4 +163,10 @@ VectorTileFeature.prototype.toGeoJSON = function(x, y, z) {
|
||||
},
|
||||
properties: this.properties
|
||||
};
|
||||
|
||||
if ('_id' in this) {
|
||||
result.id = this._id;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
@ -72,6 +72,7 @@ test('parsing vector tiles', function(t) {
|
||||
|
||||
var point = tile.layers.poi_label.feature(11).toGeoJSON(8801, 5371, 14);
|
||||
t.deepEqual(point.type, 'Feature');
|
||||
t.deepEqual(point.id, 3000003150561);
|
||||
t.deepEqual(point.properties, {
|
||||
localrank: 1,
|
||||
maki: 'park',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user