diff --git a/amd/package.json b/amd/package.json index e00296d..e6d4fe7 100644 --- a/amd/package.json +++ b/amd/package.json @@ -1,6 +1,6 @@ { "name": "templates-common-library", - "version": "0.0.232", + "version": "0.0.266", "files": [ "/*" ], diff --git a/esm/package.json b/esm/package.json index 996b899..8746593 100644 --- a/esm/package.json +++ b/esm/package.json @@ -1,6 +1,6 @@ { "name": "templates-common-library", - "version": "0.0.232-esm", + "version": "0.0.266-esm", "files": [ "/*" ], diff --git a/package-lock.json b/package-lock.json index c4ffe64..9452326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,7 +4,6 @@ "requires": true, "packages": { "": { - "name": "templates-common-library", "license": "ISC", "devDependencies": { "@types/arcgis-js-api": "^4.27.0", diff --git a/src/baseClasses/support/itemUtils.ts b/src/baseClasses/support/itemUtils.ts index c764d67..eca6e06 100644 --- a/src/baseClasses/support/itemUtils.ts +++ b/src/baseClasses/support/itemUtils.ts @@ -41,6 +41,11 @@ import { parseLevel, parseBasemap, } from "./urlUtils"; +import MapView from "esri/views/MapView"; +import SceneView from "esri/views/SceneView"; +import WebMap from "esri/WebMap"; +import WebScene from "esri/WebScene"; +import Search from "esri/widgets/Search"; import esri = __esri; //-------------------------------------------------------------------------- // @@ -94,11 +99,9 @@ export async function createView( return Promise.reject(`map is not a "WebMap" or "WebScene"`); } if (isWebMap) { - const MapView = await import("esri/views/MapView"); - return new MapView.default(properties); + return new MapView(properties); } else { - const SceneView = await import("esri/views/SceneView"); - return new SceneView.default(properties); + return new SceneView(properties); } } @@ -122,8 +125,7 @@ export async function createWebMapFromItem( options: CreateMapFromItemOptions ): Promise { const { item, appProxies, mapParams } = options; - const WebMap = await import("esri/WebMap"); - const wm = new WebMap.default({ + const wm = new WebMap({ portalItem: item, ...mapParams, }); @@ -136,8 +138,7 @@ export async function createWebSceneFromItem( options: CreateMapFromItemOptions ): Promise { const { item, appProxies } = options; - const WebScene = await import("esri/WebScene"); - const ws = new WebScene.default({ + const ws = new WebScene({ portalItem: item, }); await ws.load(); @@ -207,9 +208,7 @@ export async function findQuery( return Promise.resolve(); } - const Search = await import("esri/widgets/Search"); - - const search = new Search.default({ + const search = new Search({ view, }); const result = await search.search(query);