@nextgis/ngw-map 3.0.0-alpha.20 → 3.0.0-alpha.22
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/lib/ngw-map.cjs.js +1 -1
- package/lib/ngw-map.cjs.prod.js +1 -1
- package/lib/ngw-map.esm-browser.js +22 -13
- package/lib/ngw-map.esm-browser.js.map +1 -1
- package/lib/ngw-map.esm-browser.prod.js +1 -1
- package/lib/ngw-map.esm-browser.prod.js.map +1 -1
- package/lib/ngw-map.global.js +22 -13
- package/lib/ngw-map.global.js.map +1 -1
- package/lib/ngw-map.global.prod.js +1 -1
- package/lib/ngw-map.global.prod.js.map +1 -1
- package/package.json +9 -9
package/lib/ngw-map.cjs.js
CHANGED
|
@@ -680,6 +680,6 @@ async function createNgwMap(options) {
|
|
|
680
680
|
exports.NgwMap = NgwMap;
|
|
681
681
|
exports.createNgwMap = createNgwMap;
|
|
682
682
|
Object.keys(webmap).forEach(function (k) {
|
|
683
|
-
if (k !== 'default' && !
|
|
683
|
+
if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = webmap[k];
|
|
684
684
|
});
|
|
685
685
|
//# sourceMappingURL=ngw-map.cjs.js.map
|
package/lib/ngw-map.cjs.prod.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@nextgis/icons"),t=require("@nextgis/ngw-connector"),s=require("@nextgis/ngw-kit"),r=require("@nextgis/utils"),o=require("@nextgis/webmap"),i=require("events"),n=require("@nextgis/qms-kit");function a(e,t,s,r){if("number"==typeof t||"string"==typeof t)t=Number(t),e.push({...s,resource:t});else if(Array.isArray(t)){const[o,i]=t;e.push({...s,resource:o,id:i,...r})}else"object"==typeof t&&e.push({...s,...t,...r})}const c={target:"map",baseUrl:"",whitlabel:!1,controls:o.getDefaultControls(),controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};var h=Object.defineProperty,l=(e,t,s)=>((e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class d extends o.WebMap{constructor(e){super(function(e){const o=[new n.QmsKit];return e.starterKits&&e.starterKits.forEach((e=>{o.push(e)})),e.connector?e.connector&&(e.baseUrl=e.connector.options.baseUrl):e.connector=new t({baseUrl:e.baseUrl||"",auth:e.auth,withCredentials:e.withCredentials}),(e=r.deepmerge(c,e)).center||e.bounds||(e.bounds=[-179,-90,180,90]),e.connector&&o.push(new s.NgwKit({connector:e.connector,auth:e.auth})),{...e,starterKits:o,create:!1}}(e)),l(this,"emitter",new i.EventEmitter),l(this,"connector"),l(this,"_ngwLayers",{}),l(this,"$$selectFromNgwRaster"),l(this,"$$selectFromNgwVector"),l(this,"_promises",{select:[],identify:[]}),e.connector&&(this.connector=e.connector),this._createWebMap().then((()=>{const e=this.getContainer();e&&e.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}async addControl(e,t,s){return await this.onLoad("controls:create"),super.addControl(e,t,s)}async addNgwLayer(e){await this.onMapLoad();const{keyname:t,resourceId:o}=e;(t||void 0!==o)&&r.deprecatedWarn("set `resource` options instead of `keyname` or `resourceId`");const i=e.resource;if(!t&&!o&&!i)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(r.defined(this.options.baseUrl))try{r.defined(this.options.setViewDelay)&&(e.adapterOptions=e.adapterOptions||{},r.defined(e.adapterOptions.setViewDelay)||(e.adapterOptions.setViewDelay=this.options.setViewDelay));const t=s.createNgwLayerAdapter(e,this,this.connector),o={visibility:!0,...e,...e.adapterOptions},i=await this.addLayer(t,o),n=i&&this.getLayerId(i);if(i&&n&&(this._ngwLayers[n]={layer:i,resourceId:i.resourceId},i.options.name=i.options.name||i.item&&i.item.resource.display_name,i.options.baselayer)){if(this.getActiveBaseLayer())return i}return i}catch(n){const e=r.isObject(i)&&"id"in i?i.id:t||o||i;console.error(`Can't add NGW layer ${e}.`,n)}}fit(){const{center:e,zoom:t,bounds:s}=this.options;e?(this.setCenter(e),t&&this.setZoom(t)):s&&this.fitBounds(s)}fetchNgwLayerItem(e){return s.fetchNgwLayerItem({connector:this.connector,...e})}fetchNgwLayerItems(e){return s.fetchNgwLayerItems({connector:this.connector,...e})}fetchNgwLayerFeature(e){return s.fetchNgwLayerFeature({connector:this.connector,...e})}fetchNgwLayerFeatures(e){return s.fetchNgwLayerFeatureCollection({connector:this.connector,...e})}fetchIdentifyItem(e,t){const r=new AbortController,o=r.signal;(null==t?void 0:t.signal)&&t.signal.addEventListener("abort",r.abort),(t=t||{}).signal=o;const i=s.fetchIdentifyItem({identify:e,connector:this.connector,requestOptions:t});return this._addPromise("identify",i,r),i}fetchIdentifyGeoJson(e,{multiple:r,signal:o}={}){const i=new AbortController;if(o){if(o.aborted)return Promise.reject(new t.errors.AbortError);o.addEventListener("abort",(()=>{i.abort("AbortError")}))}const n=s.fetchIdentifyGeoJson({identify:e,connector:this.connector,multiple:r,requestOptions:{signal:i.signal}});return n&&"then"in n?(this._addPromise("identify",n,i),n):Promise.resolve(n)}getIdentifyGeoJson(e,t=!1){return this.fetchIdentifyGeoJson(e,{multiple:t})}async getNgwLayers(){return await this.onLoad(),this._ngwLayers}async getNgwLayerByResourceId(e){for(const t in this._ngwLayers){const s=this._ngwLayers[t];if(s.resourceId===e)return s&&s.layer;if(s.layer.getIdentificationIds){const t=await s.layer.getIdentificationIds();if(t&&t.some((t=>t===e)))return s.layer}if(s.layer.getDependLayers){const t=s.layer.getDependLayers().find((t=>t.item&&"style_parent_id"in t.item&&void 0!==t.item.style_parent_id&&t.item.style_parent_id===e));if(t)return t.layer}}}async fitLayer(e,t){let s;s="string"==typeof e||"number"==typeof e?String(s):e.id;const r=s&&this._ngwLayers[s];if(r)if(r.layer.getBounds){const e=await r.layer.getBounds();e&&this.fitBounds(e,t)}else{let e;if(r.layer.item)e=r.layer.item;else{const t=r.resourceId;e=await this.connector.getResource(t)}e&&this.fitResource(e.resource.id)}else super.fitLayer("number"==typeof e?String(e):e,t)}async fitResource(e,t){const r=await this.connector.resources.getIdOrFail(e),o=await s.fetchNgwExtent({resourceId:r,connector:this.connector});o&&this.fitBounds(o,t)}async zoomToLayer(e){return this.fitLayer(e)}onLoad(e="ngw-map:create"){return super.onLoad(e)}removeLayer(e){const t=this.getLayer(e);if(t){const e=this.getLayerId(t);e&&delete this._ngwLayers[e],super.removeLayer(t)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=e=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(e)},this.$$selectFromNgwVector=e=>{this._getSelectListenersCount()&&this._selectFromNgwVector(e)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(e){return this.fetchNgwLayerItem(e)}getNgwLayerItems(e){return this.fetchNgwLayerItems(e)}getNgwLayerFeature(e){return this.fetchNgwLayerFeature(e)}getNgwLayerFeatures(e){return this.fetchNgwLayerFeatures(e)}cancelPromise(...e){this.cancelPromises(...e)}cancelPromises(...e){e.length||(e=Object.keys(this._promises)),e.forEach((e=>{const t=this._promises[e];t&&(t.forEach((e=>e[1].abort())),this._promises[e]=[])}))}async selectFromNgwRaster(e){var t;this._emitStatusEvent("ngw:preselect");const o=[],i=Object.values(this._ngwLayers);i.sort(((e,t)=>e.layer.order&&t.layer.order?t.layer.order-e.layer.order:1));for(const s of i){const e=s.layer,r="function"==typeof e.getIdentificationIds&&e.getIdentificationIds,i=null==(t=e.options.interactive)||t;if(r&&e.options.selectable&&i&&this.isLayerVisible(e)){const t=r.call(e);o.push(t)}}const n=Promise.all(o),a=await n,c=[];for(const s of a)s&&c.push(...s);if(!c.length)return void this._emitStatusEvent("ngw:select",null);const h=this.options.pixelRadius||10,l=this.getCenter();let d=this.getZoom();if(d=void 0!==d?d:20,!l||!d)return void this._emitStatusEvent("ngw:select",null);const u=r.getIdentifyRadius(l,d,h);let y;if(this.options.highlightIdentification){const t=this.options.highlightIdentification,s="number"==typeof t?t:1e3,[o,i]=e.lngLat;y={type:"Polygon",coordinates:[r.getCirclePolygonCoordinates(o,i,u)]};const n=await this.addGeoJsonLayer({data:{type:"Feature",geometry:y}});s!==1/0&&setTimeout((()=>{this.removeLayer(n)}),s)}const g=new AbortController,m=s.sendIdentifyRequest(e,{layers:c,connector:this.connector,radius:u,geom:y,signal:g.signal}).then((t=>{const s={...t,resources:c,sourceType:"raster",event:e},r=this._prepareToIdentify(s);return this._emitStatusEvent("ngw:select",r),r}));return this._addPromise("select",m,g),m}_addPromise(e,t,s){const r=this._promises[e];if(r&&-1===r.findIndex((e=>e[0]===t))){const e=()=>{const e=r.findIndex((e=>e[0]===t));-1!==e&&r.splice(e,1)};t.then(e,e),r.push([t,s])}}_isFitFromResource(){const e=this._initMapState;return!e.zoom||!e.center}async _createWebMap(){await this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const e=[],t=this._isFitFromResource();if(this.options.webmapId&&a(e,this.options.webmapId,{fit:t}),this.options.resources&&Array.isArray(this.options.resources))for(const r of this.options.resources){const s={};t||(s.fit=!1),a(e,r,{},s)}for(const r of e)try{await this.addNgwLayer(r)}catch(s){console.warn(s)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let e,t;Array.isArray(this.options.qmsId)?(e=this.options.qmsId[0],t=this.options.qmsId[1]):e=Number(this.options.qmsId);const s={qmsId:e};t&&(s.id=t),this.addBaseLayer("QMS",s)}_selectFromNgwVector(e){const t=e.layer;if(!(t.options.selectable&&this.isLayerVisible(t)))return;const s=t.item&&t.item.resource.id,r=e.feature;if(void 0!==s&&r){const e=r.id;if(e){const t={featureCount:1,features:[{id:Number(e),fields:r.properties||{},label:`#${s}`,layerId:Number(s),parent:"",geom:r.geometry}]},o={featureCount:1,[s]:t};return this._emitStatusEvent("ngw:select",this._prepareToIdentify({...o,resources:[s],sourceType:"vector"})),o}}}_prepareToIdentify(e){return{...e,getIdentifyItems:()=>s.getIdentifyItems(e,!0).map((e=>s.createIdentifyItem({feature:e.feature,connector:this.connector})))}}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}async _whiteLabel(){const e=this.getContainer();if(e){const t=await s.getCompanyLogo(this.connector,this.options.companyLogoOptions);t&&e.appendChild(t)}}}l(d,"getIcon",e.getIcon),exports.NgwMap=d,exports.createNgwMap=async function(e){return new d(e).onLoad()},Object.keys(o).forEach((function(e){"default"===e||
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@nextgis/icons"),t=require("@nextgis/ngw-connector"),s=require("@nextgis/ngw-kit"),r=require("@nextgis/utils"),o=require("@nextgis/webmap"),i=require("events"),n=require("@nextgis/qms-kit");function a(e,t,s,r){if("number"==typeof t||"string"==typeof t)t=Number(t),e.push({...s,resource:t});else if(Array.isArray(t)){const[o,i]=t;e.push({...s,resource:o,id:i,...r})}else"object"==typeof t&&e.push({...s,...t,...r})}const c={target:"map",baseUrl:"",whitlabel:!1,controls:o.getDefaultControls(),controlsOptions:{ZOOM:{position:"top-left"},ATTRIBUTION:{position:"bottom-right",customAttribution:['<a href="https://nextgis.com" target="_blank">©NextGIS</a>']}},pixelRadius:10};var h=Object.defineProperty,l=(e,t,s)=>((e,t,s)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);class d extends o.WebMap{constructor(e){super(function(e){const o=[new n.QmsKit];return e.starterKits&&e.starterKits.forEach((e=>{o.push(e)})),e.connector?e.connector&&(e.baseUrl=e.connector.options.baseUrl):e.connector=new t({baseUrl:e.baseUrl||"",auth:e.auth,withCredentials:e.withCredentials}),(e=r.deepmerge(c,e)).center||e.bounds||(e.bounds=[-179,-90,180,90]),e.connector&&o.push(new s.NgwKit({connector:e.connector,auth:e.auth})),{...e,starterKits:o,create:!1}}(e)),l(this,"emitter",new i.EventEmitter),l(this,"connector"),l(this,"_ngwLayers",{}),l(this,"$$selectFromNgwRaster"),l(this,"$$selectFromNgwVector"),l(this,"_promises",{select:[],identify:[]}),e.connector&&(this.connector=e.connector),this._createWebMap().then((()=>{const e=this.getContainer();e&&e.classList.add("ngw-map-container"),this.options.whitlabel&&this._whiteLabel()}))}async addControl(e,t,s){return await this.onLoad("controls:create"),super.addControl(e,t,s)}async addNgwLayer(e){await this.onMapLoad();const{keyname:t,resourceId:o}=e;(t||void 0!==o)&&r.deprecatedWarn("set `resource` options instead of `keyname` or `resourceId`");const i=e.resource;if(!t&&!o&&!i)throw new Error("resource, resourceId or keyname is required parameter to add NGW layer");if(r.defined(this.options.baseUrl))try{r.defined(this.options.setViewDelay)&&(e.adapterOptions=e.adapterOptions||{},r.defined(e.adapterOptions.setViewDelay)||(e.adapterOptions.setViewDelay=this.options.setViewDelay));const t=s.createNgwLayerAdapter(e,this,this.connector),o={visibility:!0,...e,...e.adapterOptions},i=await this.addLayer(t,o),n=i&&this.getLayerId(i);if(i&&n&&(this._ngwLayers[n]={layer:i,resourceId:i.resourceId},i.options.name=i.options.name||i.item&&i.item.resource.display_name,i.options.baselayer)){if(this.getActiveBaseLayer())return i}return i}catch(n){const e=r.isObject(i)&&"id"in i?i.id:t||o||i;console.error(`Can't add NGW layer ${e}.`,n)}}fit(){const{center:e,zoom:t,bounds:s}=this.options;e?(this.setCenter(e),t&&this.setZoom(t)):s&&this.fitBounds(s)}fetchNgwLayerItem(e){return s.fetchNgwLayerItem({connector:this.connector,...e})}fetchNgwLayerItems(e){return s.fetchNgwLayerItems({connector:this.connector,...e})}fetchNgwLayerFeature(e){return s.fetchNgwLayerFeature({connector:this.connector,...e})}fetchNgwLayerFeatures(e){return s.fetchNgwLayerFeatureCollection({connector:this.connector,...e})}fetchIdentifyItem(e,t){const r=new AbortController,o=r.signal;(null==t?void 0:t.signal)&&t.signal.addEventListener("abort",r.abort),(t=t||{}).signal=o;const i=s.fetchIdentifyItem({identify:e,connector:this.connector,requestOptions:t});return this._addPromise("identify",i,r),i}fetchIdentifyGeoJson(e,{multiple:r,signal:o}={}){const i=new AbortController;if(o){if(o.aborted)return Promise.reject(new t.errors.AbortError);o.addEventListener("abort",(()=>{i.abort("AbortError")}))}const n=s.fetchIdentifyGeoJson({identify:e,connector:this.connector,multiple:r,requestOptions:{signal:i.signal}});return n&&"then"in n?(this._addPromise("identify",n,i),n):Promise.resolve(n)}getIdentifyGeoJson(e,t=!1){return this.fetchIdentifyGeoJson(e,{multiple:t})}async getNgwLayers(){return await this.onLoad(),this._ngwLayers}async getNgwLayerByResourceId(e){for(const t in this._ngwLayers){const s=this._ngwLayers[t];if(s.resourceId===e)return s&&s.layer;if(s.layer.getIdentificationIds){const t=await s.layer.getIdentificationIds();if(t&&t.some((t=>t===e)))return s.layer}if(s.layer.getDependLayers){const t=s.layer.getDependLayers().find((t=>t.item&&"style_parent_id"in t.item&&void 0!==t.item.style_parent_id&&t.item.style_parent_id===e));if(t)return t.layer}}}async fitLayer(e,t){let s;s="string"==typeof e||"number"==typeof e?String(s):e.id;const r=s&&this._ngwLayers[s];if(r)if(r.layer.getBounds){const e=await r.layer.getBounds();e&&this.fitBounds(e,t)}else{let e;if(r.layer.item)e=r.layer.item;else{const t=r.resourceId;e=await this.connector.getResource(t)}e&&this.fitResource(e.resource.id)}else super.fitLayer("number"==typeof e?String(e):e,t)}async fitResource(e,t){const r=await this.connector.resources.getIdOrFail(e),o=await s.fetchNgwExtent({resourceId:r,connector:this.connector});o&&this.fitBounds(o,t)}async zoomToLayer(e){return this.fitLayer(e)}onLoad(e="ngw-map:create"){return super.onLoad(e)}removeLayer(e){const t=this.getLayer(e);if(t){const e=this.getLayerId(t);e&&delete this._ngwLayers[e],super.removeLayer(t)}}enableSelection(){this.$$selectFromNgwRaster||(this.$$selectFromNgwRaster=e=>{this._getSelectListenersCount()&&this.selectFromNgwRaster(e)},this.$$selectFromNgwVector=e=>{this._getSelectListenersCount()&&this._selectFromNgwVector(e)},this.emitter.on("click",this.$$selectFromNgwRaster),this.emitter.on("layer:click",this.$$selectFromNgwVector))}disableSelection(){this.$$selectFromNgwRaster&&(this.emitter.removeListener("click",this.$$selectFromNgwRaster),this.$$selectFromNgwRaster=void 0),this.$$selectFromNgwVector&&(this.emitter.removeListener("layer:click",this.$$selectFromNgwVector),this.$$selectFromNgwVector=void 0)}getNgwLayerItem(e){return this.fetchNgwLayerItem(e)}getNgwLayerItems(e){return this.fetchNgwLayerItems(e)}getNgwLayerFeature(e){return this.fetchNgwLayerFeature(e)}getNgwLayerFeatures(e){return this.fetchNgwLayerFeatures(e)}cancelPromise(...e){this.cancelPromises(...e)}cancelPromises(...e){e.length||(e=Object.keys(this._promises)),e.forEach((e=>{const t=this._promises[e];t&&(t.forEach((e=>e[1].abort())),this._promises[e]=[])}))}async selectFromNgwRaster(e){var t;this._emitStatusEvent("ngw:preselect");const o=[],i=Object.values(this._ngwLayers);i.sort(((e,t)=>e.layer.order&&t.layer.order?t.layer.order-e.layer.order:1));for(const s of i){const e=s.layer,r="function"==typeof e.getIdentificationIds&&e.getIdentificationIds,i=null==(t=e.options.interactive)||t;if(r&&e.options.selectable&&i&&this.isLayerVisible(e)){const t=r.call(e);o.push(t)}}const n=Promise.all(o),a=await n,c=[];for(const s of a)s&&c.push(...s);if(!c.length)return void this._emitStatusEvent("ngw:select",null);const h=this.options.pixelRadius||10,l=this.getCenter();let d=this.getZoom();if(d=void 0!==d?d:20,!l||!d)return void this._emitStatusEvent("ngw:select",null);const u=r.getIdentifyRadius(l,d,h);let y;if(this.options.highlightIdentification){const t=this.options.highlightIdentification,s="number"==typeof t?t:1e3,[o,i]=e.lngLat;y={type:"Polygon",coordinates:[r.getCirclePolygonCoordinates(o,i,u)]};const n=await this.addGeoJsonLayer({data:{type:"Feature",geometry:y}});s!==1/0&&setTimeout((()=>{this.removeLayer(n)}),s)}const g=new AbortController,m=s.sendIdentifyRequest(e,{layers:c,connector:this.connector,radius:u,geom:y,signal:g.signal}).then((t=>{const s={...t,resources:c,sourceType:"raster",event:e},r=this._prepareToIdentify(s);return this._emitStatusEvent("ngw:select",r),r}));return this._addPromise("select",m,g),m}_addPromise(e,t,s){const r=this._promises[e];if(r&&-1===r.findIndex((e=>e[0]===t))){const e=()=>{const e=r.findIndex((e=>e[0]===t));-1!==e&&r.splice(e,1)};t.then(e,e),r.push([t,s])}}_isFitFromResource(){const e=this._initMapState;return!e.zoom||!e.center}async _createWebMap(){await this.create(),this.options.qmsId&&this._addQmsBaseLayer(),this.options.osm&&this._addOsmBaseLayer();const e=[],t=this._isFitFromResource();if(this.options.webmapId&&a(e,this.options.webmapId,{fit:t}),this.options.resources&&Array.isArray(this.options.resources))for(const r of this.options.resources){const s={};t||(s.fit=!1),a(e,r,{},s)}for(const r of e)try{await this.addNgwLayer(r)}catch(s){console.warn(s)}this._emitStatusEvent("ngw-map:create",this),this.enableSelection()}_addOsmBaseLayer(){this.addBaseLayer("OSM")}_addQmsBaseLayer(){let e,t;Array.isArray(this.options.qmsId)?(e=this.options.qmsId[0],t=this.options.qmsId[1]):e=Number(this.options.qmsId);const s={qmsId:e};t&&(s.id=t),this.addBaseLayer("QMS",s)}_selectFromNgwVector(e){const t=e.layer;if(!(t.options.selectable&&this.isLayerVisible(t)))return;const s=t.item&&t.item.resource.id,r=e.feature;if(void 0!==s&&r){const e=r.id;if(e){const t={featureCount:1,features:[{id:Number(e),fields:r.properties||{},label:`#${s}`,layerId:Number(s),parent:"",geom:r.geometry}]},o={featureCount:1,[s]:t};return this._emitStatusEvent("ngw:select",this._prepareToIdentify({...o,resources:[s],sourceType:"vector"})),o}}}_prepareToIdentify(e){return{...e,getIdentifyItems:()=>s.getIdentifyItems(e,!0).map((e=>s.createIdentifyItem({feature:e.feature,connector:this.connector})))}}_getSelectListenersCount(){return this.emitter.listenerCount("ngw:select")}async _whiteLabel(){const e=this.getContainer();if(e){const t=await s.getCompanyLogo(this.connector,this.options.companyLogoOptions);t&&e.appendChild(t)}}}l(d,"getIcon",e.getIcon),exports.NgwMap=d,exports.createNgwMap=async function(e){return new d(e).onLoad()},Object.keys(o).forEach((function(e){"default"===e||exports.hasOwnProperty(e)||(exports[e]=o[e])}));
|
|
2
2
|
//# sourceMappingURL=ngw-map.cjs.prod.js.map
|
|
@@ -291,7 +291,7 @@ function isLngLatBoundsArray(array) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
function round(val, toFixed) {
|
|
294
|
-
const n = 1;
|
|
294
|
+
const n = toFixed ? Number("1e+" + toFixed) : 1;
|
|
295
295
|
return Math.round((val + Number.EPSILON) * n) / n;
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -621,7 +621,7 @@ EventEmitter.init = function() {
|
|
|
621
621
|
this.domain = null;
|
|
622
622
|
if (EventEmitter.usingDomains) {
|
|
623
623
|
// if there is an active domain, then attach to it.
|
|
624
|
-
if (domain.active) ;
|
|
624
|
+
if (domain.active ) ;
|
|
625
625
|
}
|
|
626
626
|
|
|
627
627
|
if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
|
|
@@ -1074,15 +1074,15 @@ var pkg = {
|
|
|
1074
1074
|
jsdelivr: "lib/ngw-connector.global.prod.js",
|
|
1075
1075
|
types: "lib/index.d.ts",
|
|
1076
1076
|
dependencies: {
|
|
1077
|
-
"@nextgis/cache": "
|
|
1078
|
-
"@nextgis/cancelable-promise": "
|
|
1079
|
-
"@nextgis/utils": "
|
|
1077
|
+
"@nextgis/cache": "3.0.0-alpha.17",
|
|
1078
|
+
"@nextgis/cancelable-promise": "3.0.0-alpha.17",
|
|
1079
|
+
"@nextgis/utils": "3.0.0-alpha.17",
|
|
1080
1080
|
"@types/events": "^3.0.0",
|
|
1081
1081
|
events: "*",
|
|
1082
1082
|
"form-data": "^4.0.0"
|
|
1083
1083
|
},
|
|
1084
1084
|
devDependencies: {
|
|
1085
|
-
"@nextgis/build-tools": "
|
|
1085
|
+
"@nextgis/build-tools": "3.0.0-alpha.17"
|
|
1086
1086
|
},
|
|
1087
1087
|
scripts: {
|
|
1088
1088
|
clean: "rimraf ./lib",
|
|
@@ -1207,7 +1207,7 @@ function isError(error) {
|
|
|
1207
1207
|
|
|
1208
1208
|
var __defProp$M = Object.defineProperty;
|
|
1209
1209
|
var __defNormalProp$M = (obj, key, value) => key in obj ? __defProp$M(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1210
|
-
var __publicField$w = (obj, key, value) => __defNormalProp$M(obj, key + "" , value);
|
|
1210
|
+
var __publicField$w = (obj, key, value) => __defNormalProp$M(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1211
1211
|
class NetworkError extends Error {
|
|
1212
1212
|
constructor(url) {
|
|
1213
1213
|
super();
|
|
@@ -2463,7 +2463,7 @@ class ResourcesControl {
|
|
|
2463
2463
|
|
|
2464
2464
|
var __defProp$F = Object.defineProperty;
|
|
2465
2465
|
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2466
|
-
var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, key + "" , value);
|
|
2466
|
+
var __publicField$r = (obj, key, value) => __defNormalProp$F(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
2467
2467
|
class NgwConnectorExtended extends NgwConnector {
|
|
2468
2468
|
constructor(options) {
|
|
2469
2469
|
super(options);
|
|
@@ -3812,7 +3812,7 @@ var __spreadValues$m = (a, b) => {
|
|
|
3812
3812
|
}
|
|
3813
3813
|
return a;
|
|
3814
3814
|
};
|
|
3815
|
-
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, key + "" , value);
|
|
3815
|
+
var __publicField$m = (obj, key, value) => __defNormalProp$v(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
3816
3816
|
const _CheckProperty = class _CheckProperty extends BaseProperty {
|
|
3817
3817
|
constructor(name, item, options) {
|
|
3818
3818
|
super(name, item, __spreadValues$m(__spreadValues$m({}, _CheckProperty.options), options));
|
|
@@ -4022,20 +4022,22 @@ __publicField$l(_ItemProperties, "handlers", {
|
|
|
4022
4022
|
let ItemProperties = _ItemProperties;
|
|
4023
4023
|
|
|
4024
4024
|
function treeEvery(item, filter, relation, itemPrepare) {
|
|
4025
|
-
return !!treeWrapper(item, filter, relation, treeEvery_);
|
|
4025
|
+
return !!treeWrapper(item, filter, relation, treeEvery_, itemPrepare);
|
|
4026
4026
|
}
|
|
4027
4027
|
function treeSome(item, filter, relation, itemPrepare) {
|
|
4028
|
-
return !!treeWrapper(item, filter, relation, treeFind_);
|
|
4028
|
+
return !!treeWrapper(item, filter, relation, treeFind_, itemPrepare);
|
|
4029
4029
|
}
|
|
4030
4030
|
function treeFind(item, filter, relation, itemPrepare) {
|
|
4031
|
-
return treeWrapper(item, filter, relation, treeFind_);
|
|
4031
|
+
return treeWrapper(item, filter, relation, treeFind_, itemPrepare);
|
|
4032
4032
|
}
|
|
4033
4033
|
function treeFilter(item, filter, relation, itemPrepare) {
|
|
4034
4034
|
return treeWrapper(
|
|
4035
4035
|
item,
|
|
4036
4036
|
filter,
|
|
4037
4037
|
relation,
|
|
4038
|
-
treeFilter_
|
|
4038
|
+
treeFilter_,
|
|
4039
|
+
itemPrepare
|
|
4040
|
+
);
|
|
4039
4041
|
}
|
|
4040
4042
|
function getChildren(item, relation = "children") {
|
|
4041
4043
|
let children = [];
|
|
@@ -4052,6 +4054,13 @@ function getChildren(item, relation = "children") {
|
|
|
4052
4054
|
}
|
|
4053
4055
|
function treeWrapper(item, filter = (x) => !!x, relation = "children", treeFunction, itemPrepare) {
|
|
4054
4056
|
const filterFunction = typeof filter === "function" ? filter : (i) => propertiesFilter(i, filter);
|
|
4057
|
+
if (itemPrepare) {
|
|
4058
|
+
return treeFunction(
|
|
4059
|
+
item,
|
|
4060
|
+
(i) => filterFunction(itemPrepare(i)),
|
|
4061
|
+
relation
|
|
4062
|
+
);
|
|
4063
|
+
}
|
|
4055
4064
|
return treeFunction(item, filterFunction, relation);
|
|
4056
4065
|
}
|
|
4057
4066
|
function treeFind_(item, filterFunc = (x) => !!x, relation, _filtered = []) {
|