@dra2020/baseclient 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baseclient.js +10 -0
- package/dist/baseclient.js.map +1 -1
- package/dist/geo/geo.d.ts +1 -0
- package/lib/geo/geo.ts +12 -0
- package/package.json +1 -1
package/dist/geo/geo.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export declare class GeoMultiCollection {
|
|
|
56
56
|
map(cb: (f: GeoFeature) => GeoFeature): GeoFeature[];
|
|
57
57
|
isHidden(id: string): boolean;
|
|
58
58
|
find(id: string): GeoFeature;
|
|
59
|
+
filter(test: (f: GeoFeature) => boolean): GeoMultiCollection;
|
|
59
60
|
}
|
|
60
61
|
export declare enum geoIntersectOptions {
|
|
61
62
|
Intersects = 0,
|
package/lib/geo/geo.ts
CHANGED
|
@@ -386,6 +386,18 @@ export class GeoMultiCollection
|
|
|
386
386
|
|
|
387
387
|
return undefined;
|
|
388
388
|
}
|
|
389
|
+
|
|
390
|
+
filter(test: (f: GeoFeature) => boolean): GeoMultiCollection
|
|
391
|
+
{
|
|
392
|
+
let m = new GeoMultiCollection();
|
|
393
|
+
this.forEachEntry(e => {
|
|
394
|
+
let col = this._col(e);
|
|
395
|
+
let features = col ? col.features.filter(test) : null;
|
|
396
|
+
if (features && features.length)
|
|
397
|
+
m.add(e.tag, null, { type: 'FeatureCollection', features: features }, null);
|
|
398
|
+
});
|
|
399
|
+
return m;
|
|
400
|
+
}
|
|
389
401
|
}
|
|
390
402
|
|
|
391
403
|
export enum geoIntersectOptions { Intersects, Bounds, BoundsCenter };
|