@vertigis/arcgis-extensions 48.3.4 → 48.4.0
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/data/FeatureSettings.d.ts +2 -2
- package/data/FeatureSettings.js +1 -1
- package/data/FeatureSourceBase.js +1 -1
- package/data/FieldExtension.d.ts +1 -1
- package/data/PopupContentExtension.d.ts +1 -1
- package/data/Schema.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/data_FeatureList.FeatureList.html +1 -1
- package/docs/html/classes/data_FeatureSourceBase.RelationshipCollection.html +1 -1
- package/docs/html/classes/mapping_ArcGISSublayerExtension.ArcGISSublayerRelationshipCollection.html +1 -1
- package/docs/html/classes/mapping_GroupLayerExtension.GroupLayerExtensionCollection.html +1 -1
- package/docs/html/classes/mapping_SubtypeGroupLayerExtension.SubtypeGroupLayerRelationshipCollection.html +1 -1
- package/docs/html/classes/mapping_SubtypeSublayerExtension.SubtypeSublayerRelationshipCollection.html +1 -1
- package/docs/html/classes/mapping_WMSLayerExtension.WMSLayerExtension.html +4 -4
- package/docs/html/classes/mapping__LayerExtensionCollectionImpl.LayerExtensionCollectionImpl.html +1 -1
- package/docs/html/classes/mapping__SublayerExtension.SubSublayerExtensionCollection.html +1 -1
- package/docs/html/classes/mapping_support_ArrayWrappedCollection.ArrayWrappedCollection.html +1 -1
- package/docs/html/classes/mapping_support__LayerExtensionCollection.LayerExtensionCollectionBase.html +1 -1
- package/docs/html/classes/mapping_support__SublayerExtensionCollection.SublayerExtensionCollectionBase.html +1 -1
- package/docs/html/classes/support_InitializableCollectionProxy.InitializableCollectionProxy.html +1 -1
- package/docs/html/classes/support_ReadOnlyInitializableCollection.ReadOnlyInitializableCollection.html +1 -1
- package/docs/html/classes/support__ArcGISRelationshipCollection.ArcGISRelationshipCollection.html +1 -1
- package/docs/html/classes/tasks_identify_IdentifyProviderBase.IdentifyProviderBase.html +1 -1
- package/docs/html/classes/tasks_identify_WMSLayerFeatureInfoIdentifyProvider.WMSLayerFeatureInfoIdentifyProvider.html +62 -0
- package/docs/html/classes/utilities_CollectionProxy.CollectionProxy.html +1 -1
- package/docs/html/classes/utilities_CopyOnWriteCollection.CopyOnWriteCollection.html +1 -1
- package/docs/html/classes/utilities_MapTransformCollection.MapTransformCollection.html +1 -1
- package/docs/html/classes/utilities_ReadOnlyCollection.ReadOnlyCollection.html +1 -1
- package/docs/html/functions/mapping_support_ogc.wfsFeatureCollectionToFeatures.html +2 -2
- package/docs/html/functions/utilities_array.groupBy.html +2 -2
- package/docs/html/functions/utilities_asyncIterable.find.html +2 -2
- package/docs/html/functions/utilities_iterable.map.html +2 -2
- package/docs/html/functions/utilities_object.filter.html +2 -2
- package/docs/html/functions/utilities_promise.each.html +3 -33
- package/docs/html/functions/utilities_promise.map.html +3 -51
- package/docs/html/functions/utilities_promise.parallelEach.html +3 -14
- package/docs/html/functions/utilities_promise.reduce.html +4 -60
- package/docs/html/functions/utilities_uri.isRelativeUri.html +3 -1
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/modules/support_esri.html +2 -0
- package/docs/html/modules/tasks_identify_WMSLayerFeatureInfoIdentifyProvider.html +2 -0
- package/docs/html/modules/tasks_identify_defaultProviders.html +2 -1
- package/docs/html/modules.html +1 -0
- package/docs/html/types/support_esri.FeatureEditResultError.html +1 -0
- package/docs/html/types/support_esri.RequestResponse.html +1 -0
- package/docs/html/variables/utilities_scaleRanges.wellKnownScaleRanges.html +1 -1
- package/docs/html/variables/version.version.html +1 -1
- package/json/WMSLayerJson.d.ts +1 -1
- package/mapping/WMSLayerExtension.d.ts +1 -0
- package/mapping/WMSLayerExtension.js +1 -1
- package/mapping/support/ogc.d.ts +1 -1
- package/mapping/support/ogc.js +1 -1
- package/package.json +1 -1
- package/support/Settings.d.ts +2 -2
- package/support/esri.d.ts +2 -0
- package/tasks/geocoding/Geocoder.d.ts +1 -1
- package/tasks/identify/IdentifyService.js +1 -1
- package/tasks/identify/WMSLayerFeatureInfoIdentifyProvider.d.ts +38 -0
- package/tasks/identify/WMSLayerFeatureInfoIdentifyProvider.js +1 -0
- package/tasks/identify/defaultProviders.d.ts +1 -0
- package/tasks/identify/defaultProviders.js +1 -1
- package/utilities/CollectionProxy.d.ts +7 -1
- package/utilities/CollectionProxy.js +1 -1
- package/utilities/_gml.js +1 -1
- package/utilities/_ogc.d.ts +1 -1
- package/utilities/array.d.ts +1 -1
- package/utilities/asyncIterable.d.ts +1 -1
- package/utilities/iterable.d.ts +1 -1
- package/utilities/object.d.ts +1 -1
- package/utilities/promise.d.ts +5 -194
- package/utilities/promise.js +1 -1
- package/utilities/scaleRanges.d.ts +2 -2
- package/utilities/scaleRanges.js +1 -1
- package/utilities/uri.d.ts +3 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -196,7 +196,13 @@ export declare abstract class CollectionProxy<T> extends CollectionProxy_base {
|
|
|
196
196
|
* and returns a new value at the same index of the original item.
|
|
197
197
|
*/
|
|
198
198
|
map<U>(callback: ItemMapCallback<T, U>): Collection<U>;
|
|
199
|
-
on(
|
|
199
|
+
on(type: "after-add", listener: CollectionAfterAddEventHandler<T>): IHandle;
|
|
200
|
+
on(type: "after-changes", listener: CollectionAfterChangesEventHandler): IHandle;
|
|
201
|
+
on(type: "after-remove", listener: CollectionAfterRemoveEventHandler<T>): IHandle;
|
|
202
|
+
on(type: "before-add", listener: CollectionBeforeAddEventHandler<T>): IHandle;
|
|
203
|
+
on(type: "before-changes", listener: CollectionBeforeChangesEventHandler): IHandle;
|
|
204
|
+
on(type: "before-remove", listener: CollectionBeforeRemoveEventHandler<T>): IHandle;
|
|
205
|
+
on(type: "change", listener: CollectionChangeEventHandler<T>): IHandle;
|
|
200
206
|
/**
|
|
201
207
|
* Removes the last item from the collection and returns it.
|
|
202
208
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Observable as t}from"../support/Observable.js";import{onCollectionPropertyChange as e}from"./watch.js";export class CollectionProxy extends t{get length(){return this._collection.length}get declaredClass(){return"esri.core.Collection"}get destroyed(){return this._destroyed}set destroyed(t){this._destroyed=t}get initialized(){return this._initialized}set initialized(t){this._initialized=t}get _collection(){if(void 0===this._collectionField)throw new Error("CollectionProxy requires a backing collection.");return this._collectionField}set _collection(t){this._collectionField=t}_destroyed=!1;_initialized=!0;_afterChangesHandle;_collectionField;constructor(t){super(),this._collectionField=t,e(this,"_collectionField",(t=>{this.emit("change",t)})),this.watch("_collectionField.length",(()=>this.notifyChange("length"))),this.watch("_collectionField",(t=>{this._afterChangesHandle?.remove(),this._afterChangesHandle=t?.on("after-changes",(t=>this.emit("after-changes",t))),this.emit("after-changes")}),!0),null!=this._collectionField&&(this._afterChangesHandle=this._collectionField.on("after-changes",(t=>this.emit("after-changes",t))))}*[Symbol.iterator](){for(const t of this._collection)yield t}add(t,e){return this._collection.add(t,e),this}addMany(t,e){if(!t)return this;
|
|
1
|
+
import{Observable as t}from"../support/Observable.js";import{onCollectionPropertyChange as e}from"./watch.js";export class CollectionProxy extends t{get length(){return this._collection.length}get declaredClass(){return"esri.core.Collection"}get destroyed(){return this._destroyed}set destroyed(t){this._destroyed=t}get initialized(){return this._initialized}set initialized(t){this._initialized=t}get _collection(){if(void 0===this._collectionField)throw new Error("CollectionProxy requires a backing collection.");return this._collectionField}set _collection(t){this._collectionField=t}_destroyed=!1;_initialized=!0;_afterChangesHandle;_collectionField;constructor(t){super(),this._collectionField=t,e(this,"_collectionField",(t=>{this.emit("change",t)})),this.watch("_collectionField.length",(()=>this.notifyChange("length"))),this.watch("_collectionField",(t=>{this._afterChangesHandle?.remove(),this._afterChangesHandle=t?.on("after-changes",(t=>this.emit("after-changes",t))),this.emit("after-changes")}),!0),null!=this._collectionField&&(this._afterChangesHandle=this._collectionField.on("after-changes",(t=>this.emit("after-changes",t))))}*[Symbol.iterator](){for(const t of this._collection)yield t}add(t,e){return this._collection.add(t,e),this}addMany(t,e){if(!t)return this;if(arguments.length>1){let i=e;for(let e=0;e<t.length;e++)"function"==typeof t.getItemAt?this.add(t.getItemAt(e),i++):this.add(t[e],i++)}else for(let e=0;e<t.length;e++)"function"==typeof t.getItemAt?this.add(t.getItemAt(e)):this.add(t[e]);return this}clone(){const t=Object.create(Object.getPrototypeOf(this));return t._collection=this._collection,t}concat(t){return this._collection.concat(t)}destroy(){}every(t){return this._collection.every(t)}filter(t){return this._collection.filter(t)}find(t){return this._collection.find(t)}findIndex(t){return this._collection.findIndex(t)}flatten(t){return this._collection.flatten(t)}forEach(t){return this._collection.forEach(t)}getItemAt(t){return this._collection.getItemAt(t)}includes(t){return this._collection.includes(t)}indexOf(t,e){return this._collection.indexOf(t,e)}join(t){return this._collection.join(t)}lastIndexOf(t,e){return this._collection.lastIndexOf(t,e)}map(t){return this._collection.map(t)}on(t,e){return super.on(t,e)}pop(){return this.removeAt(this.length-1)}push(t){return this.add(t,this.length),this.length}reduce(t,e){return this._collection.reduce(t,e)}reduceRight(t,e){return this._collection.reduceRight(t,e)}remove(t){return this.removeAt(this.indexOf(t))}removeAll(){const t=[];for(;this.length;)t.push(this.pop());return t}removeAt(t){return this._collection.removeAt(t)}removeMany(t){const e=[];for(let i=0;i<t.length;i++){const r="function"==typeof t.getItemAt?t.getItemAt(i):t[i],o=this.indexOf(r);o>=0&&e.push(this.removeAt(o))}return e}reorder(t,e){return this._collection.reorder(t,e)}reverse(){return this._collection.reverse(),this}shift(){return this.removeAt(0)}slice(t,e){return this._collection.slice(t,e)}some(t){return this._collection.some(t)}sort(t){return this._collection.sort(t),this}splice(t,e,...i){const r=[];for(let i=e;i>0;i--)r.push(this.removeAt(t));let o=t;return i.forEach((t=>{this.add(t,o),o++})),r}toArray(){return this._collection.toArray()}unshift(t){return this.add(t,0),this.length}_get(t){throw Error()}_set(t,e){throw Error()}}
|
package/utilities/_gml.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"@arcgis/core/geometry/Extent";import n from"@arcgis/core/geometry/Multipoint";import t from"@arcgis/core/geometry/Point";import o from"@arcgis/core/geometry/Polygon";import r from"@arcgis/core/geometry/Polyline";import s from"@arcgis/core/geometry/SpatialReference";import{ArgumentError as i}from"../ArgumentError.js";import{getGmlNS as a,ogcSrsToEsriSr as c,webMercatorAliases as m}from"./_ogc.js";import{checkArg as l}from"./checkArg.js";import{isExtent as g,isPolygon as f}from"./esri.js";const p="Unable to convert the GML geometry into an Esri geometry.";export function gmlToEsri(s){switch(l("geometry",s).isNotMissing(),s.localName){case"Point":return function(e){const n=h(e),o=u(e);if(o&&o.length>1)return new t({x:o[0],y:o[1],spatialReference:n});throw new i(p)}(s);case"MultiPoint":return function(e){const t=new Array,o=h(e);if(e.childElementCount>0){const n=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"pointMember")),o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"pointMembers")),r=n.concat(...o);for(const e of r){const n=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Point"));for(const e of n)t.push(u(e))}}if(t&&t.length>0)return new n({points:t,spatialReference:o});throw new i(p)}(s);case"LineString":case"Curve":case"MultiLineString":case"MultiCurve":return function(e){let n;const t=h(e);"LineString"===e.localName?n=function(e){const n=y(e);return[n]}(e):"Curve"===e.localName&&e.childElementCount>0?n=function(e){const n=new Array,t=e.getElementsByTagNameNS(e.namespaceURI,"segments");if(t.length>0){const o=Array.from(t[0].getElementsByTagNameNS(e.namespaceURI,"LineStringSegment"));for(const e of o){const t=y(e);n.push(t)}}return n}(e):"MultiLineString"===e.localName&&e.childElementCount>0?n=function(e){const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"lineStringMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"LineString"));for(const e of t)n.push(y(e))}return n}(e):"MultiCurve"===e.localName&&e.childElementCount>0&&(n=function(e){const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"curveMember")),o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"curveMembers")),r=t.concat(...o);for(const e of r){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"LineString"));for(const e of t)n.push(y(e))}return n}(e));if(n&&n.length>0)return new r({paths:n,spatialReference:t});throw new i(p)}(s);case"Polygon":case"MultiPolygon":case"MultiSurface":return function(e){let n;const t=h(e);"Polygon"===e.localName?n=N(e):"MultiPolygon"===e.localName?n=function(e){l("geometry",e).isNotMissing();const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"polygonMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Polygon"));for(const e of t){const t=N(e);n.push(...t)}}return n}(e):"MultiSurface"===e.localName&&(n=function(e){l("geometry",e).isNotMissing();const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"surfaceMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Polygon"));for(const e of t){const t=N(e);n.push(...t)}}return n}(e));if(n&&n.length>0)return new o({rings:n,spatialReference:t});throw new i(p)}(s);case"Envelope":return function(n){const t=h(n),o=function(e){if(l("geometry",e).isNotMissing(),"Envelope"!==e.localName)throw new i(p);const n=function(e){const n=e.getElementsByTagNameNS(e.namespaceURI,"coordinates");if(0===n.length)return;const t=n[
|
|
1
|
+
import e from"@arcgis/core/geometry/Extent";import n from"@arcgis/core/geometry/Multipoint";import t from"@arcgis/core/geometry/Point";import o from"@arcgis/core/geometry/Polygon";import r from"@arcgis/core/geometry/Polyline";import s from"@arcgis/core/geometry/SpatialReference";import{ArgumentError as i}from"../ArgumentError.js";import{getGmlNS as a,ogcSrsToEsriSr as c,webMercatorAliases as m}from"./_ogc.js";import{checkArg as l}from"./checkArg.js";import{isExtent as g,isPolygon as f}from"./esri.js";const p="Unable to convert the GML geometry into an Esri geometry.";export function gmlToEsri(s){switch(l("geometry",s).isNotMissing(),s.localName){case"Point":return function(e){const n=h(e),o=u(e);if(o&&o.length>1)return new t({x:o[0],y:o[1],spatialReference:n});throw new i(p)}(s);case"MultiPoint":return function(e){const t=new Array,o=h(e);if(e.childElementCount>0){const n=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"pointMember")),o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"pointMembers")),r=n.concat(...o);for(const e of r){const n=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Point"));for(const e of n)t.push(u(e))}}if(t&&t.length>0)return new n({points:t,spatialReference:o});throw new i(p)}(s);case"LineString":case"Curve":case"MultiLineString":case"MultiCurve":return function(e){let n;const t=h(e);"LineString"===e.localName?n=function(e){const n=y(e);return[n]}(e):"Curve"===e.localName&&e.childElementCount>0?n=function(e){const n=new Array,t=e.getElementsByTagNameNS(e.namespaceURI,"segments");if(t.length>0){const o=Array.from(t[0].getElementsByTagNameNS(e.namespaceURI,"LineStringSegment"));for(const e of o){const t=y(e);n.push(t)}}return n}(e):"MultiLineString"===e.localName&&e.childElementCount>0?n=function(e){const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"lineStringMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"LineString"));for(const e of t)n.push(y(e))}return n}(e):"MultiCurve"===e.localName&&e.childElementCount>0&&(n=function(e){const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"curveMember")),o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"curveMembers")),r=t.concat(...o);for(const e of r){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"LineString"));for(const e of t)n.push(y(e))}return n}(e));if(n&&n.length>0)return new r({paths:n,spatialReference:t});throw new i(p)}(s);case"Polygon":case"MultiPolygon":case"MultiSurface":return function(e){let n;const t=h(e);"Polygon"===e.localName?n=N(e):"MultiPolygon"===e.localName?n=function(e){l("geometry",e).isNotMissing();const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"polygonMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Polygon"));for(const e of t){const t=N(e);n.push(...t)}}return n}(e):"MultiSurface"===e.localName&&(n=function(e){l("geometry",e).isNotMissing();const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"surfaceMember"));for(const e of t){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"Polygon"));for(const e of t){const t=N(e);n.push(...t)}}return n}(e));if(n&&n.length>0)return new o({rings:n,spatialReference:t});throw new i(p)}(s);case"Box":case"Envelope":return function(n){const t=h(n),o=function(e){if(l("geometry",e).isNotMissing(),"Envelope"!==e.localName&&"Box"!==e.localName)throw new i(p);const n=function(e){const n=e.getElementsByTagNameNS(e.namespaceURI,"coordinates");if(0===n.length)return;const t=n[0],o=t.getAttribute("cs")??",",r=t.getAttribute("ts")??" ",{data:s}=t.childNodes[0];return s.split(r).map((e=>B(e,o)))}(e);if(n)return n;const t=e.getElementsByTagNameNS(e.namespaceURI,"pos");if(2===t.length&&t[0].childNodes[0].nodeType===Node.TEXT_NODE){const e=t[0].childNodes[0].data,n=t[0].childNodes[0].data;return[B(e),B(n)]}const o=e.getElementsByTagNameNS(e.namespaceURI,"lowerCorner"),r=e.getElementsByTagNameNS(e.namespaceURI,"upperCorner");if(o.length>0&&o[0].childNodes[0].nodeType===Node.TEXT_NODE&&r.length>0&&r[0].childNodes[0].nodeType===Node.TEXT_NODE){const e=o[0].childNodes[0].data,n=r[0].childNodes[0].data;return[B(e),B(n)]}throw new i(p)}(n);if(2===o.length){const[n,r]=o;return new e({spatialReference:t,xmin:n[0],xmax:r[0],ymin:n[1],ymax:r[1]})}throw new i(p)}(s);default:throw new i("Unrecognized geometry type.")}}export function esriToGml(e,n){switch(l("geometry",e).isNotMissing(),l("geometry type",e.type).isNotMissing(),l("gmlVersion",n.gmlVersion).isNotMissing(),e.type){case"point":return function(e,n){const t=a(n.gmlVersion),o=T(t,"Point","gml"),r=w(e,n),s=n.hasOwnProperty("srsDimension")?n.srsDimension:void 0;let i,c;E(o,r,s),"2.0"===n.gmlVersion||"3.0"===n.gmlVersion?(i=T(t,"coordinates","gml"),c=R(", ",e)):(i=T(t,"pos","gml"),c=R(" ",e));o.appendChild(i);const m=S(c);return i.appendChild(m),o}(e,n);case"polyline":return function(e,n){const t=a(n.gmlVersion),o=T(t,"LineString","gml"),r=w(e,n),s=n.hasOwnProperty("srsDimension")?n.srsDimension:void 0;let i,c;E(o,r,s),"2.0"===n.gmlVersion||"3.0"===n.gmlVersion?(i=T(t,"coordinates","gml"),c=A(", ",e)):(i=T(t,"posList","gml"),c=A(" ",e));o.appendChild(i);const m=S(c);return i.appendChild(m),o}(e,n);case"polygon":case"extent":return function(e,n){const t=a(n.gmlVersion),o=T(t,"Polygon","gml"),r=w(e,n),s=n.hasOwnProperty("srsDimension")?n.srsDimension:void 0;E(o,r,s);const i="2.0"===n.gmlVersion?T(t,"outerBoundaryIs","gml"):T(t,"exterior","gml");o.appendChild(i);const c=T(t,"LinearRing","gml");let m,l;i.appendChild(c),"2.0"===n.gmlVersion||"3.0"===n.gmlVersion?(m=T(t,"coordinates","gml"),l=M(", ",e)):(m=T(t,"posList","gml"),l=M(" ",e));c.appendChild(m);const g=S(l);return m.appendChild(g),o}(e,n);default:throw new i(`Unrecognized geometry type: ${e.type}. Must be one of point, polyline or polygon.`)}}function u(e){if(l("geometry",e).isNotMissing(),"Point"!==e.localName)throw new i(p);const n=e.getElementsByTagNameNS(e.namespaceURI,"coordinates"),t=e.getElementsByTagNameNS(e.namespaceURI,"pos");if(n.length>0&&n[0].childNodes[0].nodeType===Node.TEXT_NODE){return B(n[0].childNodes[0].data)}if(t.length>0&&t[0].childNodes[0].nodeType===Node.TEXT_NODE){return B(t[0].childNodes[0].data)}throw new i(p)}function N(e){l("geometry",e).isNotMissing();const n=new Array,t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"outerBoundaryIs")),o=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"innerBoundaryIs")),r=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"exterior")),s=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"interior")),i=t.concat(...o).concat(...r).concat(...s);for(const e of i){const t=Array.from(e.getElementsByTagNameNS(e.namespaceURI,"LinearRing"));for(const e of t)n.push(y(e))}return n}function y(e){if(l("geometry",e).isNotMissing(),"LineString"!==e.localName&&"LinearRing"!==e.localName&&"LineStringSegment"!==e.localName)throw new i(p);const n=e.getElementsByTagNameNS(e.namespaceURI,"coordinates"),t=e.getElementsByTagNameNS(e.namespaceURI,"posList");if(n.length>0&&n[0].childNodes[0].nodeType===Node.TEXT_NODE){return d(n[0].childNodes[0].data)}if(t.length>0&&t[0].childNodes[0].nodeType===Node.TEXT_NODE){return d(t[0].childNodes[0].data)}throw new i(p)}function d(e){const n=e.replace(/,/g," ").split(" ").filter((e=>!!e)).map(Number),t=new Array;for(let e=0;e<n.length;e+=2){if(void 0===n[e+1])throw new i(p);t.push([n[e],n[e+1]])}if(t.length>0)return t;throw new i(p)}function h(e){return l("geometry",e).isNotMissing(),e.hasAttribute("srsName")?c(e.getAttribute("srsName")):s.WebMercator}function w(e,n){if(n.hasOwnProperty("srsName"))return n.srsName;if(void 0!==e.spatialReference.wkid&&null!==e.spatialReference.wkid){if(e.spatialReference.wkid<32767)return`EPSG:${e.spatialReference.wkid}`;if(m.includes(e.spatialReference.wkid))return"EPSG:3857"}throw new i("Unable to convert Esri WKT spatial reference to an OGC spatial reference")}function E(e,n,t){if(null!=n&&(e.setAttribute("srsName",n),null!=t)){const n=t<1?2:t;e.setAttribute("srsDimension",n.toString())}}function T(e,n,t){l("namespace",e).isNotMissing(),l("name",n).isNotMissing();return document.implementation.createDocument(void 0,"temp",void 0).createElementNS(e,t?`${t}:${n}`:n)}function S(e){return document.implementation.createDocument(void 0,"temp",void 0).createTextNode(e)}function R(e,n){const t=n;return" "===e?`${t.x} ${t.y}`:`${t.x}, ${t.y}`}function A(e,n){return n.paths[0].map((n=>n.join(e))).join(" ")}function M(e,n){let t;if(f(n))t=n.rings[0];else if(g(n)){const{xmin:e,xmax:o,ymin:r,ymax:s}=n;t=[[e,s],[o,s],[o,r],[e,r],[e,s]]}return t.map((n=>n.join(e))).join(" ")}function B(e,n=" "){const t=e.replace(/,/g,n).split(n).filter((e=>e)).map(Number);if(2===t.length)return[t[0],t[1]];throw new i(p)}
|
package/utilities/_ogc.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare function inferGmlVersion(wfsVersion: string): GmlVersion;
|
|
|
47
47
|
*
|
|
48
48
|
* @param ns The namespace to check.
|
|
49
49
|
*/
|
|
50
|
-
export declare function isGmlNamespace(ns: string): boolean;
|
|
50
|
+
export declare function isGmlNamespace(ns: string | undefined | null): boolean;
|
|
51
51
|
/**
|
|
52
52
|
* Naively converts an EPSG OGC spatial reference to an Esri spatial reference.
|
|
53
53
|
*
|
package/utilities/array.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare function chunk<T>(array: T[], size: number): T[][];
|
|
|
50
50
|
* @returns An object containing groups, keyed by group key. The order of items
|
|
51
51
|
* is preserved within each group.
|
|
52
52
|
*/
|
|
53
|
-
export declare function groupBy<T, K>(array: T[], getKey: (item: T, index
|
|
53
|
+
export declare function groupBy<T, K>(array: T[], getKey: (item: T, index: number) => K): Map<K, T[]>;
|
|
54
54
|
/**
|
|
55
55
|
* Options that can be passed to {@link compare}.
|
|
56
56
|
*/
|
|
@@ -127,7 +127,7 @@ export declare function filter<T>(iterable: AsyncIterable<T>, p: (x: T, index?:
|
|
|
127
127
|
* @param iterable The async iterator to search.
|
|
128
128
|
* @param p The predicate to use for finding an item.
|
|
129
129
|
*/
|
|
130
|
-
export declare function find<T>(iterable: AsyncIterable<T>, p: (x: T, index?: number) => boolean | PromiseLike<boolean>): Promise<T
|
|
130
|
+
export declare function find<T>(iterable: AsyncIterable<T>, p: (x: T, index?: number) => boolean | PromiseLike<boolean>): Promise<T | undefined>;
|
|
131
131
|
/**
|
|
132
132
|
* Returns the first element in an async iterable, or undefined if there are no
|
|
133
133
|
* elements.
|
package/utilities/iterable.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { CompareOptions } from "./array.js";
|
|
|
6
6
|
* @param iterable The iterator to map over.
|
|
7
7
|
* @param f The mapping function.
|
|
8
8
|
*/
|
|
9
|
-
export declare function map<T, U>(iterable: Iterable<T>, f: (x: T, index
|
|
9
|
+
export declare function map<T, U>(iterable: Iterable<T>, f: (x: T, index: number) => U): Iterable<U>;
|
|
10
10
|
/**
|
|
11
11
|
* The equivalent of Array.prototype.reduce for iterators.
|
|
12
12
|
*
|
package/utilities/object.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function map<T, K extends keyof T, V>(obj: T, callback: (value: T
|
|
|
28
28
|
* @returns An object containing the properties for which the callback function
|
|
29
29
|
* returned a value that evaluates to `true`.
|
|
30
30
|
*/
|
|
31
|
-
export declare function filter<T extends Record<string, unknown>>(obj: T, callback: (value:
|
|
31
|
+
export declare function filter<T extends Record<string, unknown>>(obj: T, callback: (value: T[keyof T], key: keyof T, obj: T) => boolean): Partial<T>;
|
|
32
32
|
/**
|
|
33
33
|
* Like Object.keys, but unsound in exchange for more convenience.
|
|
34
34
|
*
|
package/utilities/promise.d.ts
CHANGED
|
@@ -35,70 +35,7 @@ export declare function timeout<T>(ms: number, promise: Promise<T>, message?: st
|
|
|
35
35
|
* @param values The array of values to map over.
|
|
36
36
|
* @param mapper The mapper function to apply to each element.
|
|
37
37
|
*/
|
|
38
|
-
export declare function map<T, U>(values: PromiseLike<Iterable<PromiseLike<T
|
|
39
|
-
/**
|
|
40
|
-
* Map an array, or a promise of an array, which contains promises (or a mix of
|
|
41
|
-
* promises and values) with the given mapper function with the signature
|
|
42
|
-
* `(item, index)` where `item` is the resolved value of a respective promise in
|
|
43
|
-
* the input array. If any promise in the input array is rejected the returned
|
|
44
|
-
* promise is rejected as well.
|
|
45
|
-
*
|
|
46
|
-
* If the mapper function returns promises or then-ables, the returned promise
|
|
47
|
-
* will wait for all the mapped results to be resolved as well.
|
|
48
|
-
*
|
|
49
|
-
* The mapper function for a given item is called as soon as possible, that is,
|
|
50
|
-
* when the promise for that item's index in the input array is fulfilled. This
|
|
51
|
-
* means that multiple promises may be pending concurrently, and that the mapper
|
|
52
|
-
* function may not be applied to elements in the order that they appear in the
|
|
53
|
-
* original array. However, items in the resulting array will always appear in
|
|
54
|
-
* the same order as the input items.
|
|
55
|
-
*
|
|
56
|
-
* @param values The array of values to map over.
|
|
57
|
-
* @param mapper The mapper function to apply to each element.
|
|
58
|
-
*/
|
|
59
|
-
export declare function map<T, U>(values: PromiseLike<Iterable<T>>, mapper: (item: T, index: number) => U | PromiseLike<U>): Promise<U[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Map an array, or a promise of an array, which contains promises (or a mix of
|
|
62
|
-
* promises and values) with the given mapper function with the signature
|
|
63
|
-
* `(item, index)` where `item` is the resolved value of a respective promise in
|
|
64
|
-
* the input array. If any promise in the input array is rejected the returned
|
|
65
|
-
* promise is rejected as well.
|
|
66
|
-
*
|
|
67
|
-
* If the mapper function returns promises or then-ables, the returned promise
|
|
68
|
-
* will wait for all the mapped results to be resolved as well.
|
|
69
|
-
*
|
|
70
|
-
* The mapper function for a given item is called as soon as possible, that is,
|
|
71
|
-
* when the promise for that item's index in the input array is fulfilled. This
|
|
72
|
-
* means that multiple promises may be pending concurrently, and that the mapper
|
|
73
|
-
* function may not be applied to elements in the order that they appear in the
|
|
74
|
-
* original array. However, items in the resulting array will always appear in
|
|
75
|
-
* the same order as the input items.
|
|
76
|
-
*
|
|
77
|
-
* @param values The array of values to map over.
|
|
78
|
-
* @param mapper The mapper function to apply to each element.
|
|
79
|
-
*/
|
|
80
|
-
export declare function map<T, U>(values: Iterable<PromiseLike<T>>, mapper: (item: T, index: number) => U | PromiseLike<U>): Promise<U[]>;
|
|
81
|
-
/**
|
|
82
|
-
* Map an array, or a promise of an array, which contains promises (or a mix of
|
|
83
|
-
* promises and values) with the given mapper function with the signature
|
|
84
|
-
* `(item, index)` where `item` is the resolved value of a respective promise in
|
|
85
|
-
* the input array. If any promise in the input array is rejected the returned
|
|
86
|
-
* promise is rejected as well.
|
|
87
|
-
*
|
|
88
|
-
* If the mapper function returns promises or then-ables, the returned promise
|
|
89
|
-
* will wait for all the mapped results to be resolved as well.
|
|
90
|
-
*
|
|
91
|
-
* The mapper function for a given item is called as soon as possible, that is,
|
|
92
|
-
* when the promise for that item's index in the input array is fulfilled. This
|
|
93
|
-
* means that multiple promises may be pending concurrently, and that the mapper
|
|
94
|
-
* function may not be applied to elements in the order that they appear in the
|
|
95
|
-
* original array. However, items in the resulting array will always appear in
|
|
96
|
-
* the same order as the input items.
|
|
97
|
-
*
|
|
98
|
-
* @param values The array of values to map over.
|
|
99
|
-
* @param mapper The mapper function to apply to each element.
|
|
100
|
-
*/
|
|
101
|
-
export declare function map<T, U>(values: Iterable<T>, mapper: (item: T, index: number) => U | PromiseLike<U>): Promise<U[]>;
|
|
38
|
+
export declare function map<T, U>(values: PromiseLike<Iterable<T | PromiseLike<T>>> | Iterable<T | PromiseLike<T>>, mapper: (item: T, index: number) => U | PromiseLike<U>): Promise<U[]>;
|
|
102
39
|
/**
|
|
103
40
|
* Iterate over an array, or a promise of an array, which contains promises (or
|
|
104
41
|
* a mix of promises and values) with the given iterator function with the
|
|
@@ -112,65 +49,7 @@ export declare function map<T, U>(values: Iterable<T>, mapper: (item: T, index:
|
|
|
112
49
|
* @param values The array of values to iterate over.
|
|
113
50
|
* @param iterator The iterator function to apply to each element.
|
|
114
51
|
*/
|
|
115
|
-
export declare function each<T>(values: PromiseLike<Iterable<PromiseLike<T>>>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Iterate over an array, or a promise of an array, which contains promises (or
|
|
118
|
-
* a mix of promises and values) with the given iterator function with the
|
|
119
|
-
* signature `(item, index)` where `item` is the resolved value of a respective
|
|
120
|
-
* promise in the input array. Iteration happens serially. If any promise in the
|
|
121
|
-
* input array is rejected the returned promise is rejected as well.
|
|
122
|
-
*
|
|
123
|
-
* If the iterator function returns a promise or a thenable, the result for the
|
|
124
|
-
* promise is awaited for before continuing with next iteration.
|
|
125
|
-
*
|
|
126
|
-
* @param values The array of values to iterate over.
|
|
127
|
-
* @param iterator The iterator function to apply to each element.
|
|
128
|
-
*/
|
|
129
|
-
export declare function each<T>(values: Iterable<PromiseLike<T>>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
|
|
130
|
-
/**
|
|
131
|
-
* Iterate over an array, or a promise of an array, which contains promises (or
|
|
132
|
-
* a mix of promises and values) with the given iterator function with the
|
|
133
|
-
* signature `(item, index)` where `item` is the resolved value of a respective
|
|
134
|
-
* promise in the input array. Iteration happens serially. If any promise in the
|
|
135
|
-
* input array is rejected the returned promise is rejected as well.
|
|
136
|
-
*
|
|
137
|
-
* If the iterator function returns a promise or a thenable, the result for the
|
|
138
|
-
* promise is awaited for before continuing with next iteration.
|
|
139
|
-
*
|
|
140
|
-
* @param values The array of values to iterate over.
|
|
141
|
-
* @param iterator The iterator function to apply to each element.
|
|
142
|
-
*/
|
|
143
|
-
export declare function each<T>(values: PromiseLike<Iterable<T>>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
|
|
144
|
-
/**
|
|
145
|
-
* Iterate over an array, or a promise of an array, which contains promises (or
|
|
146
|
-
* a mix of promises and values) with the given iterator function with the
|
|
147
|
-
* signature `(item, index)` where `item` is the resolved value of a respective
|
|
148
|
-
* promise in the input array. Iteration happens serially. If any promise in the
|
|
149
|
-
* input array is rejected the returned promise is rejected as well.
|
|
150
|
-
*
|
|
151
|
-
* If the iterator function returns a promise or a thenable, the result for the
|
|
152
|
-
* promise is awaited for before continuing with next iteration.
|
|
153
|
-
*
|
|
154
|
-
* @param values The array of values to iterate over.
|
|
155
|
-
* @param iterator The iterator function to apply to each element.
|
|
156
|
-
*/
|
|
157
|
-
export declare function each<T>(values: Iterable<T>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
|
|
158
|
-
/**
|
|
159
|
-
* Same as {@link each}, except that the elements are processed in parallel
|
|
160
|
-
* rather than sequentially.
|
|
161
|
-
*
|
|
162
|
-
* @param values The array of values to iterate over.
|
|
163
|
-
* @param iterator The iterator function to apply to each element.
|
|
164
|
-
*/
|
|
165
|
-
export declare function parallelEach<T, U>(values: PromiseLike<Iterable<PromiseLike<T>>>, iterator: (item: T, index: number) => U | PromiseLike<U>): Promise<void>;
|
|
166
|
-
/**
|
|
167
|
-
* Same as {@link each}, except that the elements are processed in parallel
|
|
168
|
-
* rather than sequentially.
|
|
169
|
-
*
|
|
170
|
-
* @param values The array of values to iterate over.
|
|
171
|
-
* @param iterator The iterator function to apply to each element.
|
|
172
|
-
*/
|
|
173
|
-
export declare function parallelEach<T, U>(values: Iterable<PromiseLike<T>>, iterator: (item: T, index: number) => U | PromiseLike<U>): Promise<void>;
|
|
52
|
+
export declare function each<T>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, iterator: (item: T, index: number) => void | PromiseLike<void>): Promise<void>;
|
|
174
53
|
/**
|
|
175
54
|
* Same as {@link each}, except that the elements are processed in parallel
|
|
176
55
|
* rather than sequentially.
|
|
@@ -178,76 +57,7 @@ export declare function parallelEach<T, U>(values: Iterable<PromiseLike<T>>, ite
|
|
|
178
57
|
* @param values The array of values to iterate over.
|
|
179
58
|
* @param iterator The iterator function to apply to each element.
|
|
180
59
|
*/
|
|
181
|
-
export declare function parallelEach<T, U>(values: Iterable<T
|
|
182
|
-
/**
|
|
183
|
-
* Reduce an array, or a promise of an array, which contains a promises (or a
|
|
184
|
-
* mix of promises and values) with the given reducer function with the
|
|
185
|
-
* signature `(total, current, index)` where `current` is the resolved value of
|
|
186
|
-
* a respective promise in the input array. If any promise in the input array is
|
|
187
|
-
* rejected the returned promise is rejected as well.
|
|
188
|
-
*
|
|
189
|
-
* If the reducer function returns a promise or a thenable, the result for the
|
|
190
|
-
* promise is awaited for before continuing with next iteration.
|
|
191
|
-
*
|
|
192
|
-
* The original array is not modified. If no `initialValue` is given and the
|
|
193
|
-
* array doesn't contain at least 2 items, the callback will not be called and
|
|
194
|
-
* `undefined` is returned. If no `initialValue` is given and the array contains
|
|
195
|
-
* at least two items, the first element is used as the initial value. If
|
|
196
|
-
* `initialValue` is given and the array doesn't have at least 1 item,
|
|
197
|
-
* `initialValue` is returned.
|
|
198
|
-
*
|
|
199
|
-
* @param values The array of values to iterate over.
|
|
200
|
-
* @param reducer The reducer function.
|
|
201
|
-
* @param initialValue Optional. The initial seed value for the reducer
|
|
202
|
-
* function.
|
|
203
|
-
*/
|
|
204
|
-
export declare function reduce<T, U>(values: PromiseLike<Iterable<PromiseLike<T>>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
|
205
|
-
/**
|
|
206
|
-
* Reduce an array, or a promise of an array, which contains a promises (or a
|
|
207
|
-
* mix of promises and values) with the given reducer function with the
|
|
208
|
-
* signature `(total, current, index)` where `current` is the resolved value of
|
|
209
|
-
* a respective promise in the input array. If any promise in the input array is
|
|
210
|
-
* rejected the returned promise is rejected as well.
|
|
211
|
-
*
|
|
212
|
-
* If the reducer function returns a promise or a thenable, the result for the
|
|
213
|
-
* promise is awaited for before continuing with next iteration.
|
|
214
|
-
*
|
|
215
|
-
* The original array is not modified. If no `initialValue` is given and the
|
|
216
|
-
* array doesn't contain at least 2 items, the callback will not be called and
|
|
217
|
-
* `undefined` is returned. If no `initialValue` is given and the array contains
|
|
218
|
-
* at least two items, the first element is used as the initial value. If
|
|
219
|
-
* `initialValue` is given and the array doesn't have at least 1 item,
|
|
220
|
-
* `initialValue` is returned.
|
|
221
|
-
*
|
|
222
|
-
* @param values The array of values to iterate over.
|
|
223
|
-
* @param reducer The reducer function.
|
|
224
|
-
* @param initialValue Optional. The initial seed value for the reducer
|
|
225
|
-
* function.
|
|
226
|
-
*/
|
|
227
|
-
export declare function reduce<T, U>(values: PromiseLike<Iterable<T>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
|
228
|
-
/**
|
|
229
|
-
* Reduce an array, or a promise of an array, which contains a promises (or a
|
|
230
|
-
* mix of promises and values) with the given reducer function with the
|
|
231
|
-
* signature `(total, current, index)` where `current` is the resolved value of
|
|
232
|
-
* a respective promise in the input array. If any promise in the input array is
|
|
233
|
-
* rejected the returned promise is rejected as well.
|
|
234
|
-
*
|
|
235
|
-
* If the reducer function returns a promise or a thenable, the result for the
|
|
236
|
-
* promise is awaited for before continuing with next iteration.
|
|
237
|
-
*
|
|
238
|
-
* The original array is not modified. If no `initialValue` is given and the
|
|
239
|
-
* array doesn't contain at least 2 items, the callback will not be called and
|
|
240
|
-
* `undefined` is returned. If no `initialValue` is given and the array contains
|
|
241
|
-
* at least two items, the first element is used as the initial value. If
|
|
242
|
-
* `initialValue` is given and the array doesn't have at least 1 item,
|
|
243
|
-
* `initialValue` is returned.
|
|
244
|
-
*
|
|
245
|
-
* @param values The array of values to iterate over.
|
|
246
|
-
* @param reducer The reducer function.
|
|
247
|
-
* @param initialValue Optional. The initial seed value for the reducer
|
|
248
|
-
* function.
|
|
249
|
-
*/
|
|
250
|
-
export declare function reduce<T, U>(values: Iterable<PromiseLike<T>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>, initialValue?: U): Promise<U>;
|
|
60
|
+
export declare function parallelEach<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, iterator: (item: T, index: number) => U | PromiseLike<U>): Promise<void>;
|
|
251
61
|
/**
|
|
252
62
|
* Reduce an array, or a promise of an array, which contains a promises (or a
|
|
253
63
|
* mix of promises and values) with the given reducer function with the
|
|
@@ -270,7 +80,8 @@ export declare function reduce<T, U>(values: Iterable<PromiseLike<T>>, reducer:
|
|
|
270
80
|
* @param initialValue Optional. The initial seed value for the reducer
|
|
271
81
|
* function.
|
|
272
82
|
*/
|
|
273
|
-
export declare function reduce<T, U>(values: Iterable<T
|
|
83
|
+
export declare function reduce<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>, initialValue: U): Promise<U>;
|
|
84
|
+
export declare function reduce<T, U>(values: Iterable<T | PromiseLike<T>> | PromiseLike<Iterable<T | PromiseLike<T>>>, reducer: (total: U, current: T, index: number) => U | PromiseLike<U>): Promise<U | undefined>;
|
|
274
85
|
type Awaited<T> = T extends PromiseLike<infer PT> ? PT : T;
|
|
275
86
|
/**
|
|
276
87
|
* Like `Promise.all` but for object properties instead of array items. Returns
|
package/utilities/promise.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{checkArg as t}from"./checkArg.js";import{map as a}from"./iterable.js";export function delay(t=0){return new Promise((a=>{setTimeout(a,t)}))}export async function timeout(t,a,i){let e=!1;return new Promise((async(r,s)=>{setTimeout((()=>{e||s("string"==typeof i?new Error(i):i||new Error("Timed out while waiting for promise to resolve."))}),t);try{r(await a)}catch(t){s(t)}finally{e=!0}}))}export async function map(i,e){t("values",i).isNotMissing(),t("mapper",e).isNotMissing();const r=Array.from(a(await i,(async(t,a)=>e(await t,a))));return Promise.all(r)}export async function each(a,i){t("values",a).isNotMissing(),t("iterator",i).isNotMissing();const e=await a;let r=0;for(const t of e)await i(await t,r++)}export async function parallelEach(t,a){await map(t,a)}export function reduce(a,i,e){const r=arguments.length;return(async()=>{t("values",a).isNotMissing(),t("reducer",i).isNotMissing();
|
|
1
|
+
import{checkArg as t}from"./checkArg.js";import{map as a}from"./iterable.js";export function delay(t=0){return new Promise((a=>{setTimeout(a,t)}))}export async function timeout(t,a,i){let e=!1;return new Promise((async(r,s)=>{setTimeout((()=>{e||s("string"==typeof i?new Error(i):i||new Error("Timed out while waiting for promise to resolve."))}),t);try{r(await a)}catch(t){s(t)}finally{e=!0}}))}export async function map(i,e){t("values",i).isNotMissing(),t("mapper",e).isNotMissing();const r=Array.from(a(await i,(async(t,a)=>e(await t,a))));return Promise.all(r)}export async function each(a,i){t("values",a).isNotMissing(),t("iterator",i).isNotMissing();const e=await a;let r=0;for(const t of e)await i(await t,r++)}export async function parallelEach(t,a){await map(t,a)}export function reduce(a,i,e){const r=arguments.length;return(async()=>{t("values",a).isNotMissing(),t("reducer",i).isNotMissing();const s=[...await a];let n=e;if(r<3){if(s.length<2)return;n=await s.shift()}for(let t=0;t<s.length;t++)n=await i(n,await s[t],t);return n})()}export async function props(a){t("object",a).isNotMissing().satisfies((t=>"object"==typeof t));const i={},e=await a;return await parallelEach(Object.keys(e),(async t=>{const a=await e[t];e.hasOwnProperty(t)&&(i[t]=a)})),i}export async function asyncFlatMap(t,a){return(await Promise.all(t.map(a))).flat()}
|
|
@@ -38,9 +38,9 @@ export declare const getNextScale: (currentScale: number, scaleLevels?: number)
|
|
|
38
38
|
*
|
|
39
39
|
* @param id The Scale ID.
|
|
40
40
|
*/
|
|
41
|
-
export declare const getScaleRange: (id: ScaleId) => number
|
|
41
|
+
export declare const getScaleRange: (id: ScaleId) => number;
|
|
42
42
|
/**
|
|
43
|
-
* A list of esri well known scale ranges.
|
|
43
|
+
* A list of esri well known scale ranges. See
|
|
44
44
|
* arcgis-js-api\widgets\ScaleRangeSlider\ScaleRanges.js.
|
|
45
45
|
*/
|
|
46
46
|
export declare const wellKnownScaleRanges: ScaleRange[];
|
package/utilities/scaleRanges.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const expandExtentToScale=(e,
|
|
1
|
+
export const expandExtentToScale=(e,t,n)=>{const o=e.width/t*n/e.width;return e.clone().expand(o)};export const getNextScale=(e,t=1)=>{let n=t;for(const t of wellKnownScaleRanges)if(t.scale>e&&0==--n)return t.scale};export const getScaleRange=t=>e[t];const e={room:100,rooms:400,smallBuilding:800,building:1999,buildings:3999,street:7499,streets:14999,neighborhood:29999,town:59999,city:119999,cities:249999,metropolitanArea:499999,county:999999,counties:1999999,stateProvince:3999999,statesProvinces:6999999,countriesSmall:14999999,countriesBig:34999999,continent:99999999,world:147914382};export const wellKnownScaleRanges=Object.entries(e).map((e=>({id:e[0],scale:e[1]})));
|
package/utilities/uri.d.ts
CHANGED
|
@@ -87,8 +87,10 @@ export declare class Uri {
|
|
|
87
87
|
* Determines whether a URI is relative.
|
|
88
88
|
*
|
|
89
89
|
* @param uri The URI to check.
|
|
90
|
+
* @returns `true` if the URI is relative, empty, or undefined; otherwise,
|
|
91
|
+
* `false`.
|
|
90
92
|
*/
|
|
91
|
-
export declare function isRelativeUri(uri: string): boolean;
|
|
93
|
+
export declare function isRelativeUri(uri: string | undefined): boolean;
|
|
92
94
|
/**
|
|
93
95
|
* Determines whether a URI is absolute.
|
|
94
96
|
*
|
package/version.d.ts
CHANGED
package/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version="48.
|
|
1
|
+
export const version="48.4.0";
|