@dra2020/baseclient 1.0.150 → 1.0.151
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 -4
- package/dist/baseclient.js.map +1 -1
- package/lib/geo/multiblockmapping.ts +11 -4
- package/package.json +1 -1
|
@@ -84,7 +84,7 @@ export class MultiBlockMapping
|
|
|
84
84
|
|
|
85
85
|
rev(geoid: string): string[]
|
|
86
86
|
{
|
|
87
|
-
for (let i =
|
|
87
|
+
for (let i = this.entries.length-1; i >= 0; i--)
|
|
88
88
|
{
|
|
89
89
|
let e = this.entries[i];
|
|
90
90
|
if (! e.rbm)
|
|
@@ -102,14 +102,21 @@ export class MultiBlockMapping
|
|
|
102
102
|
Object.keys(this.entries[0].bm).forEach(blockid => cb(blockid));
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
//
|
|
105
|
+
// Walk maps in reverse order, careful to not invoke on same geoid
|
|
106
106
|
forEachRev(cb: (geoidid: string, blocks: string[]) => void): void
|
|
107
107
|
{
|
|
108
|
-
|
|
108
|
+
let seen = new Set<string>();
|
|
109
|
+
for (let i = this.entries.length-1; i >= 0; i--)
|
|
109
110
|
{
|
|
110
111
|
let e = this.entries[i];
|
|
111
112
|
if (! e.rbm) e.rbm = reverseBlockMapping(e.bm);
|
|
112
|
-
Object.keys(e.rbm).forEach(geoid =>
|
|
113
|
+
Object.keys(e.rbm).forEach(geoid => {
|
|
114
|
+
if (! seen.has(geoid))
|
|
115
|
+
{
|
|
116
|
+
seen.add(geoid);
|
|
117
|
+
cb(geoid, e.rbm[geoid]);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
113
120
|
}
|
|
114
121
|
}
|
|
115
122
|
}
|