@geoscene/core 4.23.10 → 4.23.13
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/assets/geoscene/core/workers/chunks/6f827a32646bab0a8777.js +1 -1
- package/assets/geoscene/core/workers/chunks/7f91f70ef69a7e24f8e2.js +1 -1
- package/assets/geoscene/core/workers/chunks/85fde4b92b0c212f5ff6.js +1 -1
- package/assets/geoscene/core/workers/chunks/9f458f10dc65b185f66e.js +1 -1
- package/identity/IdentityManagerBase.js +1 -1
- package/interfaces.d.ts +16322 -16322
- package/package.json +1 -1
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/sceneLayerItem.js +1 -1
- package/support/basemapDefinitions.js +1 -1
- package/support/groundUtils.js +1 -1
- package/symbols/support/styleUtils.js +1 -1
- package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
- package/widgets/Editor/deprecationUtils.js +1 -1
- package/widgets/Widget.js +1 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{schema_definitions as e}from"./definitions.js";const i={title:"Scene Layer config on layer item",type:"object",properties:{layers:{type:"array",items:{properties:{disablePopup:{type:"boolean",description:"disablePopups allows a client to ignore popups defined by the service item."},id:{type:"integer",description:"ID of the service layer."},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{definitionExpression:{},drawingInfo:{allOf:[{$ref:"#/definitions/drawingInfo_schema.json"},{properties:{labelingInfo:{},renderer:{},transparency:{}},additionalProperties:!1}]},elevationInfo:{},excludeObjectIds:{},featureReduction:{},floorInfo:{},maxScale:{},minScale:{},rangeInfos:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},popupInfo:{description:"A popupInfo object defining the content of pop-up windows when you click or query a feature.",$ref:"#/definitions/popupInfo_schema.json"},screenSizePerspective:{type:"boolean",description:"Apply [perspective scaling](https://
|
|
5
|
+
import{schema_definitions as e}from"./definitions.js";const i={title:"Scene Layer config on layer item",type:"object",properties:{layers:{type:"array",items:{properties:{disablePopup:{type:"boolean",description:"disablePopups allows a client to ignore popups defined by the service item."},id:{type:"integer",description:"ID of the service layer."},layerDefinition:{type:"object",description:"A layerDefinition object defining the attribute schema and drawing information for the layer.",allOf:[{$ref:"#/definitions/layerDefinition_schema.json"},{properties:{definitionExpression:{},drawingInfo:{allOf:[{$ref:"#/definitions/drawingInfo_schema.json"},{properties:{labelingInfo:{},renderer:{},transparency:{}},additionalProperties:!1}]},elevationInfo:{},excludeObjectIds:{},featureReduction:{},floorInfo:{},maxScale:{},minScale:{},rangeInfos:{}},additionalProperties:!1}]},listMode:{type:"string",description:"To show or hide layers in the layer list",enum:["hide","show"],default:"show"},opacity:{type:"number",description:"The degree of transparency applied to the layer on the client side, where 0 is full transparency and 1 is no transparency.",minimum:0,maximum:1,default:1},popupInfo:{description:"A popupInfo object defining the content of pop-up windows when you click or query a feature.",$ref:"#/definitions/popupInfo_schema.json"},screenSizePerspective:{type:"boolean",description:"Apply [perspective scaling](https://doc.geoscene.cn/javascript/4.23/api-reference/geoscene-layers-FeatureLayer.html#screenSizePerspectiveEnabled) to screen-size symbols.",default:!0},showLabels:{type:"boolean",description:"If the layer has a labelingInfo property then labels show on the scene only if the showLabels property it true.",default:!1},showLegend:{type:"boolean",description:"Boolean value indicating whether to display the layer in the legend. Default value is `true`.",default:!0},visibility:{type:"boolean",description:"Boolean property determining whether the layer is initially visible in the web scene",default:!0}},additionalProperties:!1}}},additionalProperties:!1,$schema:"http://json-schema.org/draft-07/schema",definitions:e};export{i as json};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function a(e){if(!e)return;const a=e.indexOf("-vector")>-1?e.slice(0,e.indexOf("-vector")):e,s=await r("geoscene/t9n/basemaps");return s[e]||s[a]}const s ={"
|
|
5
|
+
import{getAssetUrl as e}from"../assets.js";import{fetchMessageBundle as r}from"../intl/messages.js";async function a(e){if(!e)return;const a=e.indexOf("-vector")>-1?e.slice(0,e.indexOf("-vector")):e,s=await r("geoscene/t9n/basemaps");return s[e]||s[a]}const s ={"geoscene-community":{get thumbnailUrl(){return e("geoscene/images/basemap/community.jpg")},id:"geoscene-community",classic:true,title:"彩色版基础底图",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"彩色版基础底图",url:"//map.geoq.cn/arcgis/rest/services/ChinaOnlineCommunity/MapServer"}]},"geoscene-gray":{get thumbnailUrl(){return e("geoscene/images/basemap/gray.jpg")},id:"geoscene-gray",classic:true,title:"灰色不含兴趣点版中国基础地图",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"灰色不含兴趣点版中国基础地图",url:"//map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetGray/MapServer"}]},"geoscene-blue":{get thumbnailUrl(){return e("geoscene/images/basemap/blue.jpg")},id:"geoscene-blue",classic:true,title:"蓝黑色不含兴趣点版中国基础地图",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"蓝黑色不含兴趣点版中国基础地图",url:"//map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer"}]},"geoscene-warm":{get thumbnailUrl(){return e("geoscene/images/basemap/warm.jpg")},id:"geoscene-warm",classic:true,title:"暖色不含兴趣点版中国基础地图",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"暖色不含兴趣点版中国基础地图",url:"//map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetWarm/MapServer"}]},"tianditu-topography":{classic:true,title:"天地图-地形地图(球面墨卡托投影)",baseMapLayers:[{"templateUrl":"https://{subDomain}.tianditu.gov.cn/ter_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=ter&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_6884","title":"天地图-地形地图(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"},{"templateUrl":"https://{subDomain}.tianditu.gov.cn/cta_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cta&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_4525","title":"天地图-地形注记(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"}]},"tianditu-image":{classic:true,title:"天地图-影像地图(球面墨卡托投影)",baseMapLayers:[{"templateUrl":"https://{subDomain}.tianditu.gov.cn/img_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=img&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_3572","title":"天地图-影像地图(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"},{"templateUrl":"https://{subDomain}.tianditu.gov.cn/cia_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cia&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_5882","title":"天地图-影像注记(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"}]},"tianditu-vector":{classic:true,title:"天地图-矢量(含注记)(球面墨卡托投影)",baseMapLayers:[{"templateUrl":"https://{subDomain}.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=vec&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_8803","title":"天地图-矢量地图(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"},{"templateUrl":"https://{subDomain}.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&VERSION=1.0.0&REQUEST=GetTile&LAYER=cva&STYLE=default&FORMAT=tiles&TILEMATRIXSET=w&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}&tk=4267820f43926eaf808d61dc07269beb","copyright":"天地图","fullExtent":{"xmin":-20037508.342787,"ymin":-20037508.34278,"xmax":20037508.34278,"ymax":20037508.342787,"spatialReference":{"wkid":102100}},"subDomains":["t0","t1","t2","t3","t4","t5","t6","t7"],"opacity":1,"visibility":true,"id":"WebTiled_2198","title":"天地图-矢量注记(球面墨卡托投影)","type":"WebTiledLayer","layerType":"WebTiledLayer"}]}};export{s as esriBasemapDefinitions,a as getBasemapTitle};
|
package/support/groundUtils.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../Ground.js";import r from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";const i=r.getLogger("geoscene.support.groundUtils"),t={"world-elevation":{id:"worldElevation",url:"//
|
|
5
|
+
import e from"../Ground.js";import r from"../core/Logger.js";import{ensureType as o}from"../core/accessorSupport/ensureType.js";const i=r.getLogger("geoscene.support.groundUtils"),t={"world-elevation":{id:"worldElevation",url:"//links.geoscene.cn/geoscene/rest/services/elevation3d/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//links.geoscene.cn/geoscene/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function a(r){let a=null;if("string"==typeof r)if(r in t){const o=t[r];a=new e({resourceInfo:{data:{layers:[o]}}})}else i.warn(`Unable to find ground definition for: ${r}. Try "world-elevation"`);else a=o(e,r);return a}export{a as ensureType,t as groundElevationLayers};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../request.js";import t from"../../core/Error.js";import{throwIfAbortError as r}from"../../core/promiseUtils.js";import{normalize as o,removeFile as s}from"../../core/urlUtils.js";import n from"../../portal/Portal.js";import l from"../../portal/PortalQueryParams.js";import{enableWebStyleForceWOSR as a}from"../../support/featureFlags.js";const f={};async function u(e,t){try{return{data:(await b(e,t)).data,baseUrl:s(e),styleUrl:e}}catch(o){return r(o),null}}function i(e,t,r){const o=t&&t.portal||n.getDefault();let s;const l=`${o.url} - ${o.user&&o.user.username} - ${e}`;return f[l]||(f[l]=y(e,o,r).then((e=>(s=e,e.fetchData()))).then((t=>({data:t,baseUrl:s.itemUrl,styleName:e})))),f[l]}function y(e,r,o){return r.load(o).then((()=>{const t=new l({disableExtraQuery:!0,query:`owner:${w} AND type:${h} AND typekeywords:"${e}"`});return r.queryItems(t,o)})).then((({results:r})=>{let s=null;const n=e.toLowerCase();if(r&&Array.isArray(r))for(const e of r){if(e.typeKeywords.some((e=>e.toLowerCase()===n))&&e.type===h&&e.owner===w){s=e;break}}if(!s)throw new t("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(o)}))}function m(e,r,o){return e.styleUrl?u(e.styleUrl,o):e.styleName?i(e.styleName,r,o):Promise.reject(new t("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function c(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function p(e,t){if("cimRef"===t)return e.cimRef;if(e.formatInfos&&!a())for(const r of e.formatInfos)if("gltf"===r.type)return r.href;return e.webRef}function d(e){for(const t of e.typeKeywords)if(/^Esri.*Style$/.test(t)&&"Esri Style"!==t)return t}function b(t,r){const s={responseType:"json",query:{f:"json"},...r};return e(o(t),s)}const w="esri_en",h="Style",j="https://
|
|
5
|
+
import e from"../../request.js";import t from"../../core/Error.js";import{throwIfAbortError as r}from"../../core/promiseUtils.js";import{normalize as o,removeFile as s}from"../../core/urlUtils.js";import n from"../../portal/Portal.js";import l from"../../portal/PortalQueryParams.js";import{enableWebStyleForceWOSR as a}from"../../support/featureFlags.js";const f={};async function u(e,t){try{return{data:(await b(e,t)).data,baseUrl:s(e),styleUrl:e}}catch(o){return r(o),null}}function i(e,t,r){const o=t&&t.portal||n.getDefault();let s;const l=`${o.url} - ${o.user&&o.user.username} - ${e}`;return f[l]||(f[l]=y(e,o,r).then((e=>(s=e,e.fetchData()))).then((t=>({data:t,baseUrl:s.itemUrl,styleName:e})))),f[l]}function y(e,r,o){return r.load(o).then((()=>{const t=new l({disableExtraQuery:!0,query:`owner:${w} AND type:${h} AND typekeywords:"${e}"`});return r.queryItems(t,o)})).then((({results:r})=>{let s=null;const n=e.toLowerCase();if(r&&Array.isArray(r))for(const e of r){if(e.typeKeywords.some((e=>e.toLowerCase()===n))&&e.type===h&&e.owner===w){s=e;break}}if(!s)throw new t("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return s.load(o)}))}function m(e,r,o){return e.styleUrl?u(e.styleUrl,o):e.styleName?i(e.styleName,r,o):Promise.reject(new t("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function c(e){return null===e||"CIMSymbolReference"===e.type?e:{type:"CIMSymbolReference",symbol:e}}function p(e,t){if("cimRef"===t)return e.cimRef;if(e.formatInfos&&!a())for(const r of e.formatInfos)if("gltf"===r.type)return r.href;return e.webRef}function d(e){for(const t of e.typeKeywords)if(/^Esri.*Style$/.test(t)&&"Esri Style"!==t)return t}function b(t,r){const s={responseType:"json",query:{f:"json"},...r};return e(o(t),s)}const w="esri_en",h="Style",j="https://links.geoscene.cn/geoscene/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";export{j as Style2DUrlTemplate,m as fetchStyle,c as makeCIMSymbolRef,b as requestJSON,d as styleNameFromItem,p as symbolUrlFromStyleItem};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{typeCast as t}from"../../core/compilerUtils.js";import a from"../../core/Evented.js";import{isSome as s}from"../../core/maybe.js";import{watch as i,whenOnce as r,initial as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{cast as p}from"../../core/accessorSupport/decorators/cast.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{isLoaded as c,canProjectWithoutEngine as m,load as h}from"../../geometry/projection.js";import{equals as u}from"../../geometry/support/spatialReferenceUtils.js";import{esriBasemapDefinitions as f}from"../../support/basemapDefinitions.js";import{ensureType as d,destroyCache as g,findSpatialReference as v,getWellKnownBasemapId as B}from"../../support/basemapUtils.js";let b=class extends a.EventedAccessor{constructor(e){super(e),this._basemapCache={},this._loadingProjectionEngine=!1,this.nextBasemap=d("
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{typeCast as t}from"../../core/compilerUtils.js";import a from"../../core/Evented.js";import{isSome as s}from"../../core/maybe.js";import{watch as i,whenOnce as r,initial as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{cast as p}from"../../core/accessorSupport/decorators/cast.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import{isLoaded as c,canProjectWithoutEngine as m,load as h}from"../../geometry/projection.js";import{equals as u}from"../../geometry/support/spatialReferenceUtils.js";import{esriBasemapDefinitions as f}from"../../support/basemapDefinitions.js";import{ensureType as d,destroyCache as g,findSpatialReference as v,getWellKnownBasemapId as B}from"../../support/basemapUtils.js";let b=class extends a.EventedAccessor{constructor(e){super(e),this._basemapCache={},this._loadingProjectionEngine=!1,this.nextBasemap=d("tianditu-topography",this._basemapCache),this.view=null,this.toggle=this.toggle.bind(this)}initialize(){i((()=>this.nextBasemap),(e=>{e&&!e.loaded&&e.load().catch((()=>{}))}),o)}destroy(){this.view=null,g(this._basemapCache),this._basemapCache=null}get _nextBasemapSpatialReferenceTask(){return v(this.view,this.nextBasemap)}get activeBasemap(){var e,t,a;return d(null!=(e=null==(t=this.view)||null==(a=t.map)?void 0:a.basemap)?e:"topo",this._basemapCache)}castNextBasemap(e){return d(e,this._basemapCache)}get state(){var e;return null!=(e=this.view)&&e.ready?this._loadingProjectionEngine?"loading":"ready":"disabled"}async toggle(){if("disabled"===this.state)return;const{activeBasemap:e,nextBasemap:t}=this,a=!("spatialReferenceLocked"in this.view)||this.view.spatialReferenceLocked;if(!a){if(await r((()=>!this._nextBasemapSpatialReferenceTask.updating)),t!==this.nextBasemap||e!==this.activeBasemap)return;const{spatialReference:a}=this._nextBasemapSpatialReferenceTask;if(!s(a)||u(this.view.spatialReference,a)||c()||m(this.view.spatialReference,a)||(this._loadingProjectionEngine=!0,await h(),this._loadingProjectionEngine=!1),t!==this.nextBasemap||e!==this.activeBasemap)return}this.view.map.basemap=t,a||!s(this._nextBasemapSpatialReferenceTask.spatialReference)||u(this.view.spatialReference,this._nextBasemapSpatialReferenceTask.spatialReference)||(this.view.spatialReference=this._nextBasemapSpatialReferenceTask.spatialReference),this.nextBasemap=e,this.emit("toggle",{previous:e,current:t})}static getThumbnailUrl(e){if(!e)return null;const{thumbnailUrl:a}=e;if(a)return a;const s=B(e);if(s)return f[s].thumbnailUrl;const i=e.baseLayers.find((e=>!!t(e)().get("portalItem.thumbnailUrl")));return i?t(i)().get("portalItem.thumbnailUrl"):null}};e([n()],b.prototype,"_loadingProjectionEngine",void 0),e([n({readOnly:!0})],b.prototype,"_nextBasemapSpatialReferenceTask",null),e([n({readOnly:!0})],b.prototype,"activeBasemap",null),e([n()],b.prototype,"nextBasemap",void 0),e([p("nextBasemap")],b.prototype,"castNextBasemap",null),e([n({readOnly:!0})],b.prototype,"state",null),e([n()],b.prototype,"view",void 0),e([n()],b.prototype,"toggle",null),b=e([l("geoscene.widgets.BasemapToggle.BasemapToggleViewModel")],b);const y=b;export{y as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deprecated as e}from"../../core/deprecate.js";function t(t,r,s){e(t,"`"+r+"` is deprecated, because it instantiates the deprecated class 'geoscene.widgets.Editor.CreateWorkflow'",{replacement:s,version:"4.23",see:"https://
|
|
5
|
+
import{deprecated as e}from"../../core/deprecate.js";function t(t,r,s){e(t,"`"+r+"` is deprecated, because it instantiates the deprecated class 'geoscene.widgets.Editor.CreateWorkflow'",{replacement:s,version:"4.23",see:"https://doc.geoscene.cn/javascript/4.23/api-reference/geoscene-widgets-Editor-CreateFeaturesWorkflow.html"})}export{t as workflowDeprecation};
|
package/widgets/Widget.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.geoscene.cn/4.23/geoscene/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecated as t}from"../core/deprecate.js";import{byId as r}from"../core/domUtils.js";import o from"../core/Evented.js";import s from"../core/Handles.js";import"../core/has.js";import{clone as i}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as c,eachAlways as p}from"../core/promiseUtils.js";import{watch as h,when as m,initial as u}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as f}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as j}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as w}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as b,processWidgets as R,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{getVNodeCache as C,setVNodeCache as T,deleteVNodeCache as H,clearVNodeCache as P}from"./support/vnodeCache.js";import{classes as E}from"./support/widgetUtils.js";import{getThemeName as L}from"./support/widgetThemeUtils.js";import{onLocaleChange as N}from"../intl/locale.js";import{fetchMessageBundle as I}from"../intl/messages.js";const U="geoscene.widgets.Widget",F=n.getLogger(U);let $=0;const x={widgetIcon:"geoscene-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t[r]):e[r]=t[r]);return e}const A=w({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),d=i.afterRemoved;i.afterRemoved=e=>{null==d||d(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const d=t.properties;(a in d||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,a in d))&&(P(),e.scheduleRender(),d[a].call(d.bind||r,o))}});let M=!1,O=class extends(d(o.EventedAccessor)){constructor(e,r){super(e,r),this._attached=!1,this._internalHandles=new s,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.visible=!0,this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await p(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await I(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(i(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&F.error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const o=["light","dark"],n=L()||"light";o.includes(n)||t(F,"The following themes are deprecated: light-blue, dark-blue, light-green, dark-green, light-purple, dark-purple, light-red, and dark-red.",{version:"4.19",warnOnce:!0,see:"https://
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{deprecated as t}from"../core/deprecate.js";import{byId as r}from"../core/domUtils.js";import o from"../core/Evented.js";import s from"../core/Handles.js";import"../core/has.js";import{clone as i}from"../core/lang.js";import n from"../core/Logger.js";import{destroyMaybe as a}from"../core/maybe.js";import{EsriPromiseMixin as d}from"../core/Promise.js";import{debounce as l,throwIfNotAbortError as c,eachAlways as p}from"../core/promiseUtils.js";import{watch as h,when as m,initial as u}from"../core/reactiveUtils.js";import{generateUUID as g}from"../core/uuid.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import{cast as v}from"../core/accessorSupport/decorators/cast.js";import{subclass as _}from"../core/accessorSupport/decorators/subclass.js";import{runTracked as f}from"../core/accessorSupport/tracking.js";import{SimpleTrackingTarget as j}from"../core/accessorSupport/tracking/SimpleTrackingTarget.js";import{createAdvancedProjector as w}from"../libs/maquette-advanced-projector/projector.js";import{commitAssetPath as k}from"./support/componentsUtils.js";import{isWidgetConstructor as b,processWidgets as R,WIDGET_SYMBOL as S}from"./support/jsxWidgetSupport.js";import{getVNodeCache as C,setVNodeCache as T,deleteVNodeCache as H,clearVNodeCache as P}from"./support/vnodeCache.js";import{classes as E}from"./support/widgetUtils.js";import{getThemeName as L}from"./support/widgetThemeUtils.js";import{onLocaleChange as N}from"../intl/locale.js";import{fetchMessageBundle as I}from"../intl/messages.js";const U="geoscene.widgets.Widget",F=n.getLogger(U);let $=0;const x={widgetIcon:"geoscene-icon-checkbox-unchecked"};function z(e,t){for(const r in t)null!=e[r]&&("object"==typeof e[r]&&"object"==typeof t[r]?z(e[r],t[r]):e[r]=t[r]);return e}const A=w({postProcessProjectionOptions(e){const t=e.eventHandlerInterceptor,r=/capture$/i;e.eventHandlerInterceptor=(e,o,s,i)=>{const n=t(e,o,s,i),a=r.test(e);if(!((e=e.replace(r,"")).toLowerCase()in s)||a){const t=e[2].toLowerCase()+e.slice(3),r=e=>n.call(s,e);s.addEventListener(t,r,a);const o=()=>s.removeEventListener(t,r,a),d=i.afterRemoved;i.afterRemoved=e=>{null==d||d(e),o()}}return n}},handleInterceptedEvent(e,t,r,o){const{eventPhase:s,type:i}=o,n=s===Event.CAPTURING_PHASE;let a=`on${i}${n?"capture":""}`;const d=t.properties;(a in d||(a=`on${i[0].toUpperCase()}${i.slice(1)}${n?"Capture":""}`,a in d))&&(P(),e.scheduleRender(),d[a].call(d.bind||r,o))}});let M=!1,O=class extends(d(o.EventedAccessor)){constructor(e,r){super(e,r),this._attached=!1,this._internalHandles=new s,this._projector=A,this._readyForTrueRender=!1,this.domNode=null,this.iconClass=x.widgetIcon,this.label=this.declaredClass.split(".").pop(),this.visible=!0,this.key=this,this._loadLocale=l((async()=>{if(this._messageBundleProps&&this._messageBundleProps.length){const e=await p(this._messageBundleProps.map((async({bundlePath:e,propertyName:t})=>{let r=await I(e);this.uiStrings&&Object.keys(this.uiStrings)&&(r=z(i(r),this.uiStrings)),this[t]=r})));for(const t of e)t.error&&F.error("widget-intl:locale-error",this.declaredClass,t.error)}await this.loadLocale()})),k();const o=["light","dark"],n=L()||"light";o.includes(n)||t(F,"The following themes are deprecated: light-blue, dark-blue, light-green, dark-green, light-purple, dark-purple, light-red, and dark-red.",{version:"4.19",warnOnce:!0,see:"https://doc.geoscene.cn/javascript/4.23/styling/"});const a="geoscene-widget-uid-"+g(),d=this.render.bind(this);this._trackingTarget=new j((()=>this.scheduleRender()));const c=()=>{var e;if(!this._readyForTrueRender||this.destroyed)return null;if(!this.visible)return{vnodeSelector:"div",properties:{key:a,class:"",styles:{display:"none"}},domNode:void 0,children:void 0,text:void 0};const t=d();let{properties:r}=t;r||(t.properties=r={});let{key:o,styles:s}=r;o||(r.key=a),s||(r.styles=s={}),s.display||(s.display="");let i=0;return null==(e=t.children)||e.forEach((e=>{if(b(e.vnodeSelector))return;let{properties:t}=e;t||(e.properties=t={}),t.key||(t.key=`${this.id}--${i++}`)})),R(this,t)};this.render=()=>{if(M)return c();let e=C(this);if(e)return e;this._trackingTarget.clear(),M=!0;try{e=f(this._trackingTarget,c)}finally{M=!1}return T(this,e),e},this.addResolvingPromise(this._resourcesFetch=this.beforeFirstRender().then((()=>{this._readyForTrueRender=!0,this._postInitialize()})))}normalizeCtorArgs(e,t){const r={...e};return t&&(r.container=t),r}postInitialize(){}beforeFirstRender(){return Promise.all([this.loadDependencies(),this._loadLocale()]).then((()=>{})).catch(c)}async loadDependencies(){}async loadLocale(){}destroy(){this.destroyed||(this._trackingTarget=a(this._trackingTarget),this.viewModel=a(this.viewModel),this._detach(this.container),this._set("container",null),this._internalHandles.destroy(),this._emitter.clear(),this.render=()=>null,this._projector=null,H(this))}set container(e){this._get("container")||this._set("container",e)}castContainer(e){return r(e)}get id(){return this._get("id")||this.get("container.id")||Date.now().toString(16)+"-widget-"+$++}set id(e){e&&this._set("id",e)}get renderable(){return this._resourcesFetch}get test(){return{projector:this._projector,handles:this._internalHandles}}render(){throw new Error("not implemented")}scheduleRender(){this.destroyed||(H(this),this._projector.scheduleRender())}classes(...e){return E.apply(this,e)}own(e){arguments.length>1&&(e=Array.prototype.slice.call(arguments)),this._internalHandles.add(e)}renderNow(){H(this),this._projector.renderNow()}_postInitialize(){var e;if(this.destroyed)return;this.scheduleRender(),null!=(e=this._delegatedEventNames)&&e.length&&this._internalHandles.add(h((()=>this.viewModel),((e,t)=>{t&&this._internalHandles.remove("delegated-events"),e&&this._internalHandles.add(this._delegatedEventNames.map((t=>e.on(t,(e=>{this.emit(t,e)})))),"delegated-events")}),u)),this.postInitialize();const t=async()=>{await this._loadLocale().catch(c),this.scheduleRender()};this._internalHandles.add([N(t),h((()=>this.uiStrings),t),m((()=>this.container),(e=>{this.destroyed||this._attach(e)}),{initial:!0,once:!0})])}_attach(e){e&&(this._projector.merge(e,this.render),this._attached=!0)}_detach(e){e&&this._attached&&(this._projector.detach(this.render),e.parentNode&&e.parentNode.removeChild(e),this._attached=!1)}};O[S]=!0,e([y()],O.prototype,"_readyForTrueRender",void 0),e([y({value:null})],O.prototype,"container",null),e([v("container")],O.prototype,"castContainer",null),e([y({aliasOf:"container"})],O.prototype,"domNode",void 0),e([y()],O.prototype,"iconClass",void 0),e([y()],O.prototype,"id",null),e([y()],O.prototype,"label",void 0),e([y()],O.prototype,"renderable",null),e([y()],O.prototype,"uiStrings",void 0),e([y()],O.prototype,"viewModel",void 0),e([y()],O.prototype,"visible",void 0),e([y()],O.prototype,"key",void 0),e([y()],O.prototype,"children",void 0),e([y()],O.prototype,"afterCreate",void 0),e([y()],O.prototype,"afterUpdate",void 0),e([y()],O.prototype,"afterRemoved",void 0),O=e([_(U)],O);const B=O;export{B as default};
|