@google/earthengine 1.7.9 → 1.7.12
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/build/browser.js +416 -384
- package/build/ee_api_js.js +400 -399
- package/build/ee_api_js_debug.js +393 -362
- package/build/ee_api_js_npm.js +416 -384
- package/build/main.js +416 -384
- package/package.json +1 -1
- package/src/apiclient.js +1 -1
- package/src/apifunction.js +56 -42
- package/src/floattileoverlay.js +1 -1
- package/src/layers/abstractoverlay.js +3 -3
- package/src/maptilemanager.js +3 -3
package/package.json
CHANGED
package/src/apiclient.js
CHANGED
|
@@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues.index');
|
|
|
24
24
|
/** @namespace */
|
|
25
25
|
const apiclient = {};
|
|
26
26
|
|
|
27
|
-
const API_CLIENT_VERSION = '1.7.
|
|
27
|
+
const API_CLIENT_VERSION = '1.7.12';
|
|
28
28
|
|
|
29
29
|
exports.VERSION = apiVersion.VERSION;
|
|
30
30
|
exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
|
package/src/apifunction.js
CHANGED
|
@@ -167,11 +167,11 @@ ee.ApiFunction.lookup = function(name) {
|
|
|
167
167
|
* Looks up an API function by name, but doesn't throw an error.
|
|
168
168
|
*
|
|
169
169
|
* @param {string} name The name of the function to get.
|
|
170
|
-
* @return {!ee.ApiFunction} The requested function or null if it's not found.
|
|
170
|
+
* @return {!ee.ApiFunction|null} The requested function or null if it's not found.
|
|
171
171
|
*/
|
|
172
172
|
ee.ApiFunction.lookupInternal = function(name) {
|
|
173
173
|
ee.ApiFunction.initialize();
|
|
174
|
-
return ee.ApiFunction.api_[name]
|
|
174
|
+
return ee.ApiFunction.api_.hasOwnProperty(name) ? ee.ApiFunction.api_[name] : null;
|
|
175
175
|
};
|
|
176
176
|
|
|
177
177
|
|
|
@@ -244,49 +244,63 @@ ee.ApiFunction.reset = function() {
|
|
|
244
244
|
ee.ApiFunction.importApi = function(target, prefix, typeName, opt_prepend) {
|
|
245
245
|
ee.ApiFunction.initialize();
|
|
246
246
|
const prepend = opt_prepend || '';
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
// Assume we have a constructor Function if we get an instance method.
|
|
264
|
-
const destination =
|
|
265
|
-
isInstance ? /** @type {!Function} */(target).prototype : target;
|
|
247
|
+
const api = ee.ApiFunction.api_;
|
|
248
|
+
for (const name in api) {
|
|
249
|
+
// "names" in API either look like:
|
|
250
|
+
// - `Array` (base constructor), or
|
|
251
|
+
// - `Array.method` (methods)
|
|
252
|
+
|
|
253
|
+
// Ignore properties inherited from the prototype chain.
|
|
254
|
+
if (!Object.prototype.hasOwnProperty.call(api, name)) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
const apiFunc = api[name];
|
|
258
|
+
const parts = name.split('.'); // Should be api group and api method.
|
|
259
|
+
if (parts.length !== 2 || parts[0] !== prefix) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
266
262
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
263
|
+
const apiMethod = parts[1];
|
|
264
|
+
|
|
265
|
+
const fname = prepend + apiMethod;
|
|
266
|
+
const signature = apiFunc.getSignature();
|
|
267
|
+
|
|
268
|
+
// Mark signatures as used.
|
|
269
|
+
ee.ApiFunction.boundSignatures_[name] = true;
|
|
271
270
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
destination[fname] = function(var_args) {
|
|
279
|
-
return apiFunc.callOrApply(
|
|
280
|
-
isInstance ? this : undefined,
|
|
281
|
-
Array.prototype.slice.call(arguments, 0));
|
|
282
|
-
};
|
|
283
|
-
// Add a friendly formatting.
|
|
284
|
-
destination[fname].toString =
|
|
285
|
-
goog.bind(apiFunc.toString, apiFunc, fname, isInstance);
|
|
286
|
-
// Attach the signature object for documentation generators.
|
|
287
|
-
destination[fname]['signature'] = signature;
|
|
271
|
+
// Decide whether this is a static or an instance function.
|
|
272
|
+
let isInstance = false;
|
|
273
|
+
if (signature['args'].length) {
|
|
274
|
+
const firstArgType = signature['args'][0]['type'];
|
|
275
|
+
isInstance = firstArgType != 'Object' &&
|
|
276
|
+
ee.Types.isSubtype(firstArgType, typeName);
|
|
288
277
|
}
|
|
289
|
-
|
|
278
|
+
// Assume we have a constructor Function if we get an instance method.
|
|
279
|
+
const destination =
|
|
280
|
+
isInstance ? /** @type {!Function} */ (target).prototype : target;
|
|
281
|
+
|
|
282
|
+
if (fname in destination && !destination[fname]['signature']) {
|
|
283
|
+
// Don't overwrite client-defined functions.
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Add the actual function
|
|
288
|
+
/**
|
|
289
|
+
* @param {*} var_args
|
|
290
|
+
* @return {!ee.ComputedObject}
|
|
291
|
+
* @this {*}
|
|
292
|
+
**/
|
|
293
|
+
destination[fname] = function(var_args) {
|
|
294
|
+
return apiFunc.callOrApply(
|
|
295
|
+
isInstance ? this : undefined,
|
|
296
|
+
Array.prototype.slice.call(arguments, 0));
|
|
297
|
+
};
|
|
298
|
+
// Add a friendly formatting.
|
|
299
|
+
destination[fname].toString =
|
|
300
|
+
goog.bind(apiFunc.toString, apiFunc, fname, isInstance);
|
|
301
|
+
// Attach the signature object for documentation generators.
|
|
302
|
+
destination[fname]['signature'] = signature;
|
|
303
|
+
}
|
|
290
304
|
};
|
|
291
305
|
|
|
292
306
|
|
package/src/floattileoverlay.js
CHANGED
|
@@ -135,7 +135,7 @@ ee.layers.AbstractOverlay = class extends goog.events.EventTarget {
|
|
|
135
135
|
this.opacity = opacity;
|
|
136
136
|
this.tilesById.forEach(function(tile) {
|
|
137
137
|
goog.style.setOpacity(tile.div, this.opacity);
|
|
138
|
-
}
|
|
138
|
+
}.bind(this));
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
/**
|
|
@@ -201,7 +201,7 @@ ee.layers.AbstractOverlay = class extends goog.events.EventTarget {
|
|
|
201
201
|
*/
|
|
202
202
|
releaseTile(tileDiv) {
|
|
203
203
|
var tile = this.tilesById.get(tileDiv.id);
|
|
204
|
-
this.tilesById.
|
|
204
|
+
this.tilesById.delete(tileDiv.id);
|
|
205
205
|
if (tile) {
|
|
206
206
|
tile.abort();
|
|
207
207
|
goog.dispose(tile);
|
|
@@ -283,7 +283,7 @@ ee.layers.AbstractOverlay = class extends goog.events.EventTarget {
|
|
|
283
283
|
* @private
|
|
284
284
|
*/
|
|
285
285
|
getTileCountForStatus_(status) {
|
|
286
|
-
return goog.array.count(this.tilesById.
|
|
286
|
+
return goog.array.count([...this.tilesById.values()], function(tile) {
|
|
287
287
|
return tile.getStatus() == status;
|
|
288
288
|
});
|
|
289
289
|
}
|
package/src/maptilemanager.js
CHANGED
|
@@ -74,7 +74,7 @@ ee.MapTileManager = class extends goog.events.EventTarget {
|
|
|
74
74
|
* @return {number} The number of requests in flight or pending send.
|
|
75
75
|
*/
|
|
76
76
|
getOutstandingCount() {
|
|
77
|
-
return this.requests_.
|
|
77
|
+
return this.requests_.size;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
/**
|
|
@@ -160,7 +160,7 @@ ee.MapTileManager = class extends goog.events.EventTarget {
|
|
|
160
160
|
* @private
|
|
161
161
|
*/
|
|
162
162
|
releaseRequest_(request) {
|
|
163
|
-
this.requests_.
|
|
163
|
+
this.requests_.delete(request.getId());
|
|
164
164
|
if (request.getImageLoader()) {
|
|
165
165
|
this.releaseObject_(request.getToken());
|
|
166
166
|
request.getImageLoader().dispose();
|
|
@@ -189,7 +189,7 @@ ee.MapTileManager = class extends goog.events.EventTarget {
|
|
|
189
189
|
|
|
190
190
|
// Call dispose on each request.
|
|
191
191
|
var requests = this.requests_;
|
|
192
|
-
goog.array.forEach(requests.
|
|
192
|
+
goog.array.forEach([...requests.values()], function(value) {
|
|
193
193
|
value.dispose();
|
|
194
194
|
});
|
|
195
195
|
requests.clear();
|