@@ -52,7 +52,6 @@ let envExamplePath;
5252// Write to ./src/lib/config/index.js
5353// Prompts user for:
5454// portalUrl
55- // appId
5655// webmapId
5756// base
5857// appName
@@ -150,7 +149,7 @@ const base = await prompts([
150149 {
151150 type: 'text',
152151 name: 'base',
153- message: 'Enter your baseUrl (e.g. /)',
152+ message: 'Enter your base URL (e.g. /)',
154153 validate: value => {
155154 global.baseIsNull = value.length === 0;
156155 return true;
@@ -160,7 +159,7 @@ const base = await prompts([
160159 {
161160 type: () => global.baseIsNull ? 'text' : null,
162161 name: 'base',
163- message: 'base_URL is required. It will default to "/"',
162+ message: 'Base URL is required. Otherwise, it defaults to "/"',
164163 initial: '/',
165164 format: value => value.startsWith('/') ? value : \`/\${value}\`
166165 }
@@ -178,23 +177,10 @@ const portalUrl = await prompts([
178177 }
179178 },
180179 {
181- // type: () => global.portalUrlIsNull ? 'text' : null,
182- // name: 'portalUrl',
183- // message: 'portalUrl is required. If proceeding it\'ll be set to: ',
184- // initial: 'https://prof-services.maps.arcgis.com/',
185- }
186- ], { onCancel });
187- console.log("");
188-
189- const appId = await prompts([
190- {
191- type: 'text',
192- name: 'appId',
193- message: 'Enter your appId',
194- validate: value => {
195- global.appIdIsNull = value.length === 0;
196- return true;
197- }
180+ type: () => global.portalUrlIsNull ? 'text' : null,
181+ name: 'portalUrl',
182+ message: 'Portal URL is required. Otherwise, it defaults to "arcgis.com"',
183+ initial: 'https://www.arcgis.com',
198184 }
199185], { onCancel });
200186console.log("");
@@ -417,9 +403,7 @@ if (demo.DEMO === true) {
417403 if (browser) {
418404 import("@arcgis/map-components/dist/loader").then(
419405 ({ defineCustomElements }) => {
420- defineCustomElements(window, {
421- resourcesUrl: "https://js.arcgis.com/map-components/4.34.8/assets",
422- });
406+ defineCustomElements(window);
423407 }
424408 );
425409 }
@@ -439,11 +423,15 @@ if (demo.DEMO === true) {
439423 {/if}
440424 <div class="e-demo-container">
441425 <div class="e-demo-header">
442- <h1>🗺️ SV + ArcGIS Demo</h1>
426+ {#if config.appName}
427+ {config.appName}
428+ {:else}
429+ <h1>🗺️ SV-ArcGIS Demo</h1>
430+ {/if}
443431 </div>
444432 <div class="e-demo-map-wrap">
445- <arcgis-map bind:this={mapView} item-id="05e015c5f0314db9a487a9b46cb37eca">
446- <arcgis-zoom position ="top-left"></arcgis-zoom>
433+ <arcgis-map bind:this={mapView} item-id={config.portal.webmapId ? config.portal.webmapId : "05e015c5f0314db9a487a9b46cb37eca"} >
434+ <arcgis-zoom slot ="top-left"></arcgis-zoom>
447435 </arcgis-map>
448436 {#if config.calcite}
449437 <calcite-button appearance="solid" scale="m" type="button" onclick={() => {document.body.classList.toggle('calcite-mode-dark')}}>
@@ -491,7 +479,7 @@ if (demo.DEMO === true) {
491479
492480 .e-demo-header {
493481 padding: 1rem;
494- color: #f1f1f1 ;
482+ color: #212121 ;
495483
496484 translate: 0 0;
497485 transition: translate 1s ease-out;
@@ -534,7 +522,7 @@ if (demo.DEMO === true) {
534522 align-items: center;
535523 justify-content: center;
536524 inset-block-start: 0;
537- height: 22px ;
525+ height: 24px ;
538526 background-color: #000;
539527 color: #fff;
540528 margin: 0;
@@ -596,9 +584,7 @@ if (demo.DEMO === true) {
596584
597585 import("@arcgis/map-components/dist/loader").then(
598586 ({ defineCustomElements }) => {
599- defineCustomElements(window, {
600- resourcesUrl: "https://js.arcgis.com/map-components/4.34.8/assets",
601- });
587+ defineCustomElements(window);
602588 }
603589 );
604590 </script>
@@ -617,11 +603,15 @@ if (demo.DEMO === true) {
617603 {/if}
618604 <div class="e-demo-container">
619605 <div class="e-demo-header">
620- <h1>🗺️ SV + ArcGIS Demo</h1>
606+ {#if config.appName}
607+ {config.appName}
608+ {:else}
609+ <h1>🗺️ SV-ArcGIS Demo</h1>
610+ {/if}
621611 </div>
622612 <div class="e-demo-map-wrap">
623- <arcgis-map bind:this={mapView} item-id="05e015c5f0314db9a487a9b46cb37eca">
624- <arcgis-zoom position ="top-left"></arcgis-zoom>
613+ <arcgis-map bind:this={mapView} item-id={config.portal.webmapId ? config.portal.webmapId : "05e015c5f0314db9a487a9b46cb37eca"} >
614+ <arcgis-zoom slot ="top-left"></arcgis-zoom>
625615 </arcgis-map>
626616 {#if config.calcite}
627617 <calcite-button appearance="solid" scale="m" type="button" onclick={() => {document.body.classList.toggle('calcite-mode-dark')}}>
@@ -669,7 +659,7 @@ if (demo.DEMO === true) {
669659
670660 .e-demo-header {
671661 padding: 1rem;
672- color: #f1f1f1 ;
662+ color: #212121 ;
673663
674664 translate: 0 0;
675665 transition: translate 1s ease-out;
@@ -712,7 +702,7 @@ if (demo.DEMO === true) {
712702 align-items: center;
713703 justify-content: center;
714704 inset-block-start: 0;
715- height: 22px ;
705+ height: 24px ;
716706 background-color: #000;
717707 color: #fff;
718708 margin: 0;
@@ -812,7 +802,6 @@ const config = {
812802 ...appName,
813803 ...base,
814804 portal: {
815- appId: appId.appId,
816805 webmapId: webmapId.webmapId,
817806 url: portalUrl.portalUrl
818807 },
@@ -858,7 +847,6 @@ generateConfig()
858847
859848 // Create and write to config file
860849 const configFileText = usesTypeScript ? \`interface PortalConfiguration {
861- appId: string;
862850 webmapId: string;
863851 url: string;
864852}
@@ -879,7 +867,6 @@ export const config: StaticConfiguration = {
879867 appName: "\${data.config.appName}",
880868 base: "\${data.config.base}",
881869 portal: {
882- appId: "\${data.config.portal.appId}",
883870 webmapId: "\${data.config.portal.webmapId}",
884871 url: "\${data.config.portal.url}",
885872 },
@@ -893,7 +880,6 @@ export default config;\` : \`export const config = {
893880 appName: "\${data.config.appName}",
894881 base: "\${data.config.base}",
895882 portal: {
896- appId: "\${data.config.portal.appId}",
897883 webmapId: "\${data.config.portal.webmapId}",
898884 url: "\${data.config.portal.url}",
899885 },
0 commit comments