@itwin/map-layers 5.2.2 → 5.2.4
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/CHANGELOG.md +18 -1
- package/lib/cjs/public/locales/en/mapLayers.json +9 -2
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js +1 -1
- package/lib/cjs/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/cjs/ui/Interfaces.d.ts +4 -2
- package/lib/cjs/ui/Interfaces.d.ts.map +1 -1
- package/lib/cjs/ui/Interfaces.js.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/cjs/ui/widget/BasemapPanel.js +79 -52
- package/lib/cjs/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts +1 -0
- package/lib/cjs/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js +17 -1
- package/lib/cjs/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.d.ts +4 -1
- package/lib/cjs/ui/widget/MapLayerManager.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapLayerManager.js +10 -6
- package/lib/cjs/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/cjs/ui/widget/MapUrlDialog.js +22 -11
- package/lib/cjs/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/esm/public/locales/en/mapLayers.json +9 -2
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js +1 -1
- package/lib/esm/ui/FeatureInfoUiItemsProvider.js.map +1 -1
- package/lib/esm/ui/Interfaces.d.ts +4 -2
- package/lib/esm/ui/Interfaces.d.ts.map +1 -1
- package/lib/esm/ui/Interfaces.js.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.d.ts.map +1 -1
- package/lib/esm/ui/widget/BasemapPanel.js +80 -53
- package/lib/esm/ui/widget/BasemapPanel.js.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts +1 -0
- package/lib/esm/ui/widget/FeatureInfoWidget.d.ts.map +1 -1
- package/lib/esm/ui/widget/FeatureInfoWidget.js +15 -0
- package/lib/esm/ui/widget/FeatureInfoWidget.js.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.d.ts +4 -1
- package/lib/esm/ui/widget/MapLayerManager.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapLayerManager.js +10 -6
- package/lib/esm/ui/widget/MapLayerManager.js.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.d.ts.map +1 -1
- package/lib/esm/ui/widget/MapUrlDialog.js +22 -11
- package/lib/esm/ui/widget/MapUrlDialog.js.map +1 -1
- package/lib/public/locales/en/mapLayers.json +9 -2
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,8BAA8B;;;AAE9B,0DAAmD;AACnD,wDAAgG;AAEhG,wDAG8B;AAC9B,kDAAgE;AAChE,+BAA+B;AAC/B,mEAAgE;AAChE,+CAA8C;AAE9C,sDAAoD;AACpD,uDAAoD;AACpD,+BAA6B;AAC7B,gFAAoE;AAEvD,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;CAC/B,CAAC;AAqBF,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE9C,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAChD,IAAI,KAAK,CAAC,oBAAoB,EAA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Q,EAAE,aAAa,GAAI,CACzB,CACJ,CACF,CACF;YAGL,oBAAoB,EAAE;YAGtB,CAAC,kBAAkB,IAAI,gBAAgB,CAAC;gBACvC,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AA1hBD,oCA0hBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { Button, Icon, Input, LabeledInput, ProgressLinear, Radio } from \"@itwin/itwinui-react\";\nimport { ImageMapLayerProps } from \"@itwin/core-common\";\nimport {\n IModelApp, MapLayerAccessClient, MapLayerSource,\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\n} from \"@itwin/core-frontend\";\nimport { Dialog, useCrossOriginPopup } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapTypesOptions } from \"../Interfaces\";\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { SelectMapFormat } from \"./SelectMapFormat\";\nimport \"./MapUrlDialog.scss\";\nimport { SvgStatusWarning } from \"@itwin/itwinui-icons-color-react\";\n\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\nexport type LayerCreationMode = \"single\"|\"multiple\";\ninterface MapUrlDialogProps {\n activeViewport?: ScreenViewport;\n isOverlay: boolean;\n onOkResult: (result?: SourceState) => void;\n onCancelResult?: () => void;\n mapTypesOptions?: MapTypesOptions;\n\n // An optional layer definition can be provide to enable the edit mode\n layerRequiringCredentials?: ImageMapLayerProps;\n\n mapLayerSourceToEdit?: MapLayerSource;\n}\n\nexport interface SourceState {\n source: MapLayerSource;\n validation: MapLayerSourceValidation;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapUrlDialog(props: MapUrlDialogProps) {\n const { onOkResult, mapTypesOptions } = props;\n\n const getMapUrlFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.url;\n } else if (props.layerRequiringCredentials?.url) {\n return props.layerRequiringCredentials.url;\n }\n return \"\";\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const getMapNameFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.name;\n } else if (props.layerRequiringCredentials?.name) {\n return props.layerRequiringCredentials.name;\n }\n return \"\";\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const getFormatFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.formatId;\n } else if (props.layerRequiringCredentials?.formatId) {\n return props.layerRequiringCredentials.formatId;\n }\n return undefined;\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\n const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\n const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\n const [userName, setUserName] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined | boolean>(undefined);\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string | undefined>();\n const [onOauthProcessEnd] = React.useState(new BeEvent());\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\n\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\n const [hasImodelContext] = React.useState(\n props?.activeViewport?.iModel?.iTwinId !== undefined\n && props.activeViewport.iModel.iTwinId !== Guid.empty\n && props?.activeViewport?.iModel?.iModelId !== undefined\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\n\n const handleCancel = React.useCallback(() => {\n if (props.onCancelResult) {\n props.onCancelResult();\n return;\n }\n }, [props]);\n\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUserName(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setPassword(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const handleArcGisLogin = React.useCallback(() => {\n setLayerAuthPending(true);\n setShowOauthPopup(true);\n if (oauthProcessSucceeded === false) {\n setOAuthProcessSucceeded(undefined);\n }\n\n }, [oauthProcessSucceeded]);\n\n // return true if authorization is needed\n const updateAuthState = React.useCallback(async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\n const invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\n if (sourceRequireAuth) {\n const settings = source.toLayerSettings();\n\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\n try {\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\n if (tokenEndpoint !== undefined) {\n const loginUrl = tokenEndpoint.getLoginUrl();\n setExternalLoginUrl(loginUrl);\n }\n\n } catch (_error) {\n\n }\n }\n\n }\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\n if (invalidCredentials) {\n setInvalidCredentialsProvided(true);\n } else if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false); // flag reset\n }\n\n return sourceRequireAuth || invalidCredentials;\n }, [accessClient, invalidCredentialsProvided]);\n\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapName(event.target.value);\n }, [setMapName]);\n\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSettingsStorageRadio(event.target.value);\n }, [setSettingsStorageRadio]);\n\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapUrl(event.target.value);\n }, [setMapUrl]);\n\n const createSource = React.useCallback(() => {\n let source: MapLayerSource | undefined;\n if (mapUrl && mapName) {\n source = MapLayerSource.fromJSON({\n url: mapUrl,\n name: mapName,\n formatId: mapType,\n });\n\n // Set credentials separately since they are not part of JSON\n if (source) {\n source.userName = userName || undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\n source.password = password || undefined;\n }\n\n }\n return source;\n }, [mapName, mapType, mapUrl, password, userName]);\n\n const handleOk = React.useCallback(() => {\n const source = createSource();\n if (source === undefined || props.mapLayerSourceToEdit) {\n onOkResult();\n\n if (source === undefined) {\n // Close the dialog and inform end user something went wrong.\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceName: mapName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n // Simply change the source definition in the setting service\n if (props.mapLayerSourceToEdit !== undefined) {\n const vp = props.activeViewport;\n void (async () => {\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\n try {\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\n } catch (err: any) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return;\n }\n }\n })();\n return;\n }\n }\n\n // Attach source asynchronously.\n void (async () => {\n\n try {\n setLayerAttachPending(true);\n const validation = await source.validateSource(true);\n\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n // Update service settings if storage is available and we are not prompting user for credentials\n if (isSettingsStorageAvailable && !props.layerRequiringCredentials) {\n const storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\n const vp = props.activeViewport;\n if (vp?.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\n }\n }\n\n onOkResult({source, validation});\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult({source, validation});\n } else {\n const authNeeded = await updateAuthState(source, validation);\n if (!authNeeded) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\n onOkResult({source, validation});\n }\n }\n } catch (error) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult();\n }\n })();\n\n }, [createSource, mapName, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, isSettingsStorageAvailable, updateAuthState, hasImodelContext, props.layerRequiringCredentials, settingsStorage]);\n\n React.useEffect(() => {\n const handleOAuthProcessEnd = (success: boolean, _state: any) => {\n onOauthProcessEnd.raiseEvent(success, _state);\n };\n\n // Currently only arcgis support AccessClient\n\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(MAP_TYPES.arcGis);\n if (ac?.onOAuthProcessEnd) {\n setAccessClient(ac); // cache it, so we dont need to make another lookup;\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\n }\n setAccessClientInitialized(true);\n return () => {\n if (ac?.onOAuthProcessEnd) {\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\n }\n\n setAccessClient(undefined);\n setAccessClientInitialized(false);\n };\n }, [mapType, onOauthProcessEnd, setAccessClient]);\n\n // After a map type change, make sure the different Oauth states are reset.\n React.useEffect(() => {\n // Reset few states\n setServerRequireCredentials(false);\n setInvalidCredentialsProvided(false);\n setShowOauthPopup(false);\n setOAuthProcessSucceeded(undefined);\n setExternalLoginUrl(undefined);\n\n }, [mapType]);\n\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\n React.useEffect(() => {\n // Attach source asynchronously.\n void (async () => {\n if (isAccessClientInitialized && props.layerRequiringCredentials?.url !== undefined && props.layerRequiringCredentials?.name !== undefined) {\n try {\n const source = MapLayerSource.fromJSON({\n url: props.layerRequiringCredentials.url,\n name: props.layerRequiringCredentials.name,\n formatId: props.layerRequiringCredentials.formatId,\n });\n\n if (source !== undefined) {\n setLayerAttachPending(true);\n const validation = await source.validateSource(true);\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n await updateAuthState(source, validation);\n }\n } catch (_error) { }\n }\n })();\n\n }, [isAccessClientInitialized,\n props.layerRequiringCredentials?.formatId,\n props.layerRequiringCredentials?.name,\n props.layerRequiringCredentials?.url,\n updateAuthState]);\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const readyToSave = React.useCallback(() => {\n const credentialsSet = !!userName && !!password;\n return (!!mapUrl && !!mapName)\n && !layerAttachPending\n && (!serverRequireCredentials || credentialsSet)\n && !invalidCredentialsProvided\n && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided, externalLoginUrl, oauthProcessSucceeded]);\n\n // const buttonCluster = React.useMemo(() => [\n // { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\n // { type: DialogButtonType.Cancel, onClick: handleCancel },\n // ], [readyToSave, handleCancel, handleOk]);\n\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === SpecialKey.Enter) {\n if (readyToSave())\n handleOk();\n }\n }, [handleOk, readyToSave]);\n\n // onOauthProcessEnd events handler\n React.useEffect(() => {\n const handleOauthProcess = (success: boolean, _state: any) => {\n setLayerAuthPending(false);\n if (success) {\n setOAuthProcessSucceeded(true);\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\n } else {\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n setOAuthProcessSucceeded(false);\n }\n };\n\n onOauthProcessEnd.addListener(handleOauthProcess);\n return () => {\n onOauthProcessEnd.removeListener(handleOauthProcess);\n };\n }, [handleOk, onOauthProcessEnd]);\n\n //\n // Monitors authentication method changes\n React.useEffect(() => {\n\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\n handleArcGisLogin();\n }\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\n\n // Monitors Oauth2 popup was closed\n const handleOAuthPopupClose = React.useCallback(() => {\n setShowOauthPopup(false);\n setLayerAuthPending(false);\n if (oauthProcessSucceeded === undefined)\n setOAuthProcessSucceeded(false); // indicates there was a failed attempt\n }, [oauthProcessSucceeded]);\n\n // Utility function to get warning message section\n function renderWarningMessage(): React.ReactNode {\n let node: React.ReactNode;\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (showOauthPopup) {\n warningMessage = externalLoginWaitingMsg;\n } else if (oauthProcessSucceeded === false) {\n warningMessage = externalLoginFailedMsg;\n } else if (oauthProcessSucceeded === true) {\n warningMessage = externalLoginSucceededMsg;\n } else if (invalidCredentialsProvided) {\n warningMessage = invalidCredentialsLabel;\n } else if (serverRequireCredentials && (!userName || !password)) {\n warningMessage = missingCredentialsLabel;\n }\n\n // Sometimes we want to add an extra node, such as a button\n let extraNode: React.ReactNode;\n if (oauthProcessSucceeded === false) {\n extraNode = <div>\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\n </div>;\n }\n\n if (warningMessage !== undefined) {\n return (\n <div className=\"map-layer-source-warnMessage\">\n <Icon size=\"small\"><SvgStatusWarning></SvgStatusWarning></Icon>\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\n {extraNode}\n </div>);\n } else {\n return (<span className=\"map-layer-source-placeholder\"> </span>);\n }\n return node;\n }\n\n // Use a hook to display the popup.\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\n\n function getFooter() {\n\n return (\n <div className=\"map-layer-source-footer\">\n <div className=\"map-layer-source-footer-status\"/>\n <div>\n <Button\n className=\"map-layer-features-footer-button\"\n styleType='high-visibility'\n onClick={handleOk}\n disabled={!readyToSave()}\n >\n {props?.mapLayerSourceToEdit ? MapLayersUI.translate(\"Dialog.Edit\") : MapLayersUI.translate(\"Dialog.Add\")}\n </Button>\n <Button\n className=\"map-layer-source-footer-button\"\n styleType='default'\n onClick={handleCancel}\n >\n {MapLayersUI.translate(\"Dialog.Cancel\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-url-dialog\"\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n footer={getFooter()}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={120}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n <div className=\"map-layer-url-dialog-content\">\n <div className=\"map-layer-source-url\">\n <span className=\"map-layer-source-label\">{typeLabel}</span>\n <SelectMapFormat\n value={mapType}\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\n onChange={setMapType}\n mapTypesOptions={mapTypesOptions}\n />\n <span className=\"map-layer-source-label\">{nameLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending || layerAuthPending} />\n <span className=\"map-layer-source-label\">{urlLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending} value={mapUrl} />\n {serverRequireCredentials\n && externalLoginUrl === undefined // external login is handled in popup\n && props.mapLayerSourceToEdit === undefined &&\n <>\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onUsernameChange}\n value={userName}\n size=\"small\" />\n\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n\n displayStyle=\"inline\"\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onPasswordChange}\n onKeyPress={handleOnKeyDown}\n value={password}\n size=\"small\" />\n\n </>\n }\n\n {/* Store settings options, not shown when editing a layer */}\n {!props.layerRequiringCredentials\n && !props.mapLayerSourceToEdit\n && <div title={!isSettingsStorageAvailable ? noSaveSettingsWarning : \"\"}>\n {hasImodelContext &&\n <div>\n <Radio disabled={!isSettingsStorageAvailable}\n name=\"settingsStorage\" value=\"iTwin\"\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\n onChange={onRadioChange} />\n <Radio disabled={!isSettingsStorageAvailable}\n name=\"settingsStorage\" value=\"Model\"\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\n onChange={onRadioChange} />\n </div>}\n </div>}\n </div>\n </div>\n\n {/* Warning message */}\n {renderWarningMessage()}\n\n {/* Progress bar */}\n {(layerAttachPending || layerAuthPending) &&\n <div className=\"map-layer-source-progressBar\">\n <ProgressLinear indeterminate />\n </div>\n }\n </Dialog>\n </div >\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"MapUrlDialog.js","sourceRoot":"","sources":["../../../../src/ui/widget/MapUrlDialog.tsx"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F,8BAA8B;;;AAE9B,0DAAmD;AACnD,wDAAgG;AAEhG,wDAG8B;AAC9B,kDAAgE;AAChE,+BAA+B;AAC/B,mEAAgE;AAChE,+CAA8C;AAE9C,sDAAoD;AACpD,uDAAoD;AACpD,+BAA6B;AAC7B,gFAAoE;AAEvD,QAAA,SAAS,GAAG;IACvB,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,aAAa,EAAE,eAAe;CAC/B,CAAC;AAqBF,gEAAgE;AAChE,SAAgB,YAAY,CAAC,KAAwB;IACnD,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAE9C,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QAChD,IAAI,KAAK,CAAC,oBAAoB,EAAE;YAC9B,OAAO,KAAK,CAAC,oBAAoB,CAAC,GAAG,CAAC;SACvC;aAAM,IAAI,KAAK,CAAC,yBAAyB,EAAE,GAAG,EAAE;YAC/C,OAAO,KAAK,CAAC,yBAAyB,CAAC,GAAG,CAAC;SAC5C;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,EAAE,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAElE,MAAM,mBAAmB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG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AO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI;gCAC7B,oBAAC,qBAAK,IAAC,QAAQ,EAAE,CAAC,0BAA0B,EAC1C,IAAI,EAAC,iBAAiB,EAAC,KAAK,EAAC,OAAO,EACpC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,KAAK,OAAO,EAC/D,QAAQ,EAAE,aAAa,GAAI,CACzB,CACJ,CACF,CACF;YAGL,oBAAoB,EAAE;YAGtB,CAAC,kBAAkB,IAAI,gBAAgB,CAAC;gBACvC,6BAAK,SAAS,EAAC,8BAA8B;oBAC3C,oBAAC,8BAAc,IAAC,aAAa,SAAG,CAC5B,CAED,CACJ,CACR,CAAC;AACJ,CAAC;AApiBD,oCAoiBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n// cSpell:ignore Modeless WMTS\n\nimport { SpecialKey } from \"@itwin/appui-abstract\";\nimport { Button, Icon, Input, LabeledInput, ProgressLinear, Radio } from \"@itwin/itwinui-react\";\nimport { ImageMapLayerProps } from \"@itwin/core-common\";\nimport {\n IModelApp, MapLayerAccessClient, MapLayerSource,\n MapLayerSourceStatus, MapLayerSourceValidation, NotifyMessageDetails, OutputMessagePriority, ScreenViewport,\n} from \"@itwin/core-frontend\";\nimport { Dialog, useCrossOriginPopup } from \"@itwin/core-react\";\nimport * as React from \"react\";\nimport { MapLayerPreferences } from \"../../MapLayerPreferences\";\nimport { MapLayersUI } from \"../../mapLayers\";\nimport { MapTypesOptions } from \"../Interfaces\";\nimport { BeEvent, Guid } from \"@itwin/core-bentley\";\nimport { SelectMapFormat } from \"./SelectMapFormat\";\nimport \"./MapUrlDialog.scss\";\nimport { SvgStatusWarning } from \"@itwin/itwinui-icons-color-react\";\n\nexport const MAP_TYPES = {\n wms: \"WMS\",\n arcGis: \"ArcGIS\",\n wmts: \"WMTS\",\n tileUrl: \"TileURL\",\n arcGisFeature: \"ArcGISFeature\",\n};\n\nexport type LayerCreationMode = \"single\"|\"multiple\";\ninterface MapUrlDialogProps {\n activeViewport?: ScreenViewport;\n isOverlay: boolean;\n onOkResult: (result?: SourceState) => void;\n onCancelResult?: () => void;\n mapTypesOptions?: MapTypesOptions;\n\n // An optional layer definition can be provide to enable the edit mode\n layerRequiringCredentials?: ImageMapLayerProps;\n\n mapLayerSourceToEdit?: MapLayerSource;\n}\n\nexport interface SourceState {\n source: MapLayerSource;\n validation: MapLayerSourceValidation;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function MapUrlDialog(props: MapUrlDialogProps) {\n const { onOkResult, mapTypesOptions } = props;\n\n const getMapUrlFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.url;\n } else if (props.layerRequiringCredentials?.url) {\n return props.layerRequiringCredentials.url;\n }\n return \"\";\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const getMapNameFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.name;\n } else if (props.layerRequiringCredentials?.name) {\n return props.layerRequiringCredentials.name;\n }\n return \"\";\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const getFormatFromProps = React.useCallback(() => {\n if (props.mapLayerSourceToEdit) {\n return props.mapLayerSourceToEdit.formatId;\n } else if (props.layerRequiringCredentials?.formatId) {\n return props.layerRequiringCredentials.formatId;\n }\n return undefined;\n }, [props.layerRequiringCredentials, props.mapLayerSourceToEdit]);\n\n const [dialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString(props.layerRequiringCredentials || props.mapLayerSourceToEdit ? \"mapLayers:CustomAttach.EditCustomLayer\" : \"mapLayers:CustomAttach.AttachCustomLayer\"));\n const [typeLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Type\"));\n const [nameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.Name\"));\n const [nameInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NameInputPlaceHolder\"));\n const [urlLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.URL\"));\n const [urlInputPlaceHolder] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.UrlInputPlaceHolder\"));\n const [iTwinSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnITwinSettings\"));\n const [modelSettingsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.StoreOnModelSettings\"));\n const [missingCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.MissingCredentials\"));\n const [invalidCredentialsLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCredentials\"));\n const [externalLoginTitle] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLogin\"));\n const [externalLoginFailedMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginFailed\"));\n const [externalLoginSucceededMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginSucceeded\"));\n const [externalLoginWaitingMsg] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginWaiting\"));\n const [externalLoginTryAgainLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ExternalLoginTryAgain\"));\n const [serverRequireCredentials, setServerRequireCredentials] = React.useState(false);\n const [invalidCredentialsProvided, setInvalidCredentialsProvided] = React.useState(false);\n const [layerAttachPending, setLayerAttachPending] = React.useState(false);\n const [layerAuthPending, setLayerAuthPending] = React.useState(false);\n const [mapUrl, setMapUrl] = React.useState(getMapUrlFromProps());\n const [mapName, setMapName] = React.useState(getMapNameFromProps());\n const [userName, setUserName] = React.useState(\"\");\n const [password, setPassword] = React.useState(\"\");\n const [noSaveSettingsWarning] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.NoSaveSettingsWarning\"));\n const [passwordLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Password\"));\n const [passwordRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.PasswordRequired\"));\n const [userNameLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.Username\"));\n const [userNameRequiredLabel] = React.useState(MapLayersUI.localization.getLocalizedString(\"mapLayers:AuthenticationInputs.UsernameRequired\"));\n const [settingsStorage, setSettingsStorageRadio] = React.useState(\"iTwin\");\n const [oauthProcessSucceeded, setOAuthProcessSucceeded] = React.useState<undefined | boolean>(undefined);\n const [showOauthPopup, setShowOauthPopup] = React.useState(false);\n const [externalLoginUrl, setExternalLoginUrl] = React.useState<string | undefined>();\n const [onOauthProcessEnd] = React.useState(new BeEvent());\n const [accessClient, setAccessClient] = React.useState<MapLayerAccessClient | undefined>();\n const [isAccessClientInitialized, setAccessClientInitialized] = React.useState(false);\n const [shouldAutoAttachSource, setShouldAutoAttachSource] = React.useState(true);\n\n const [mapType, setMapType] = React.useState(getFormatFromProps() ?? \"ArcGIS\");\n\n // 'isMounted' is used to prevent any async operation once the hook has been\n // unloaded. Otherwise we get a 'Can't perform a React state update on an unmounted component.' warning in the console.\n const isMounted = React.useRef(false);\n React.useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n const [isSettingsStorageAvailable] = React.useState(MapLayersUI.iTwinConfig && props?.activeViewport?.iModel?.iTwinId);\n const [hasImodelContext] = React.useState(\n props?.activeViewport?.iModel?.iTwinId !== undefined\n && props.activeViewport.iModel.iTwinId !== Guid.empty\n && props?.activeViewport?.iModel?.iModelId !== undefined\n && props?.activeViewport.iModel.iModelId !== Guid.empty);\n\n const handleCancel = React.useCallback(() => {\n if (props.onCancelResult) {\n props.onCancelResult();\n return;\n }\n }, [props]);\n\n const onUsernameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setUserName(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setUserName, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const onPasswordChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setPassword(event.target.value);\n if (invalidCredentialsProvided)\n setInvalidCredentialsProvided(false);\n }, [setPassword, invalidCredentialsProvided, setInvalidCredentialsProvided]);\n\n const handleArcGisLogin = React.useCallback(() => {\n setLayerAuthPending(true);\n setShowOauthPopup(true);\n if (oauthProcessSucceeded === false) {\n setOAuthProcessSucceeded(undefined);\n }\n\n }, [oauthProcessSucceeded]);\n\n // return true if authorization is needed\n const updateAuthState = React.useCallback(async (source: MapLayerSource, sourceValidation: MapLayerSourceValidation) => {\n const sourceRequireAuth = (sourceValidation.status === MapLayerSourceStatus.RequireAuth);\n let invalidCredentials = (sourceValidation.status === MapLayerSourceStatus.InvalidCredentials);\n if (sourceRequireAuth) {\n let hasTokenEndPoint = false;\n const settings = source.toLayerSettings();\n\n if (accessClient !== undefined && accessClient.getTokenServiceEndPoint !== undefined && settings !== undefined) {\n try {\n const tokenEndpoint = await accessClient.getTokenServiceEndPoint(settings.url);\n if (tokenEndpoint !== undefined) {\n const loginUrl = tokenEndpoint.getLoginUrl();\n setExternalLoginUrl(loginUrl);\n hasTokenEndPoint = true;\n }\n\n } catch (_error) {\n\n }\n } else if (userName.length > 0 || password.length > 0 ) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n\n if (!hasTokenEndPoint && (userName.length > 0 || password.length > 0 )) {\n // This is a patch until @itwin\\core-frontend return the expected 'InvalidCredentials' status.\n invalidCredentials = true;\n }\n }\n setServerRequireCredentials(sourceRequireAuth || invalidCredentials);\n if (invalidCredentials) {\n setInvalidCredentialsProvided(true);\n } else if (invalidCredentialsProvided) {\n setInvalidCredentialsProvided(false); // flag reset\n }\n\n return sourceRequireAuth || invalidCredentials;\n }, [accessClient, invalidCredentialsProvided, password.length, userName.length]);\n\n const onNameChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapName(event.target.value);\n }, [setMapName]);\n\n const onRadioChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setSettingsStorageRadio(event.target.value);\n }, [setSettingsStorageRadio]);\n\n const onUrlChange = React.useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n setMapUrl(event.target.value);\n }, [setMapUrl]);\n\n const createSource = React.useCallback(() => {\n let source: MapLayerSource | undefined;\n if (mapUrl && mapName) {\n source = MapLayerSource.fromJSON({\n url: mapUrl,\n name: mapName,\n formatId: mapType,\n });\n\n // Set credentials separately since they are not part of JSON\n if (source) {\n source.userName = userName || undefined; // When there is no value, empty string is always returned, in this case force it to undefined,\n source.password = password || undefined;\n }\n\n }\n return source;\n }, [mapName, mapType, mapUrl, password, userName]);\n\n const handleOk = React.useCallback(() => {\n const source = createSource();\n if (source === undefined || props.mapLayerSourceToEdit) {\n onOkResult();\n\n if (source === undefined) {\n // Close the dialog and inform end user something went wrong.\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerLayerSourceCreationFailed\");\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error: msgError, sourceName: mapName });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n return;\n }\n\n // Simply change the source definition in the setting service\n if (props.mapLayerSourceToEdit !== undefined) {\n const vp = props.activeViewport;\n void (async () => {\n if (isSettingsStorageAvailable && vp?.iModel?.iTwinId) {\n try {\n await MapLayerPreferences.replaceSource(props.mapLayerSourceToEdit!, source, vp.iModel.iTwinId, vp?.iModel.iModelId);\n } catch (err: any) {\n const errorMessage = IModelApp.localization.getLocalizedString(\"mapLayers:Messages.MapLayerEditError\", { layerName: props.mapLayerSourceToEdit?.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, errorMessage));\n return;\n }\n }\n })();\n return;\n }\n }\n\n // Attach source asynchronously.\n void (async () => {\n\n try {\n setLayerAttachPending(true);\n const validation = await source.validateSource(true);\n\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n\n if (validation.status === MapLayerSourceStatus.Valid) {\n // Update service settings if storage is available and we are not prompting user for credentials\n if (isSettingsStorageAvailable && !props.layerRequiringCredentials) {\n const storeOnIModel = (hasImodelContext ? \"Model\" === settingsStorage : undefined);\n const vp = props.activeViewport;\n if (vp?.iModel.iTwinId && !(await MapLayerPreferences.storeSource(source, vp.iModel.iTwinId, vp.iModel.iModelId, storeOnIModel))) {\n const msgError = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerPreferencesStoreFailed\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msgError));\n }\n }\n\n onOkResult({source, validation});\n } else if (validation.status === MapLayerSourceStatus.InvalidCoordinateSystem) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.InvalidCoordinateSystem\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult({source, validation});\n } else {\n const authNeeded = await updateAuthState(source, validation);\n if (!authNeeded) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:CustomAttach.ValidationError\");\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, `${msg} ${source.url}`));\n onOkResult({source, validation});\n }\n }\n } catch (error) {\n const msg = MapLayersUI.localization.getLocalizedString(\"mapLayers:Messages.MapLayerAttachError\", { error, sourceName: source.name });\n IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Error, msg));\n onOkResult();\n }\n })();\n\n }, [createSource, mapName, props.mapLayerSourceToEdit, props.activeViewport, onOkResult, isSettingsStorageAvailable, updateAuthState, hasImodelContext, props.layerRequiringCredentials, settingsStorage]);\n\n React.useEffect(() => {\n const handleOAuthProcessEnd = (success: boolean, _state: any) => {\n onOauthProcessEnd.raiseEvent(success, _state);\n };\n\n const ac = IModelApp.mapLayerFormatRegistry.getAccessClient(mapType);\n if (ac?.onOAuthProcessEnd) {\n setAccessClient(ac); // cache it, so we dont need to make another lookup;\n ac.onOAuthProcessEnd.addListener(handleOAuthProcessEnd);\n }\n setAccessClientInitialized(true);\n return () => {\n if (ac?.onOAuthProcessEnd) {\n ac.onOAuthProcessEnd.removeListener(handleOAuthProcessEnd);\n }\n\n setAccessClient(undefined);\n setAccessClientInitialized(false);\n };\n }, [mapType, onOauthProcessEnd, setAccessClient]);\n\n // After a map type change, make sure the different Oauth states are reset.\n React.useEffect(() => {\n // Reset few states\n setServerRequireCredentials(false);\n setInvalidCredentialsProvided(false);\n setShowOauthPopup(false);\n setOAuthProcessSucceeded(undefined);\n setExternalLoginUrl(undefined);\n\n }, [mapType]);\n\n // The first time the dialog is loaded and we already know the layer requires auth. (i.e ImageryProvider already made an attempt)\n // makes a request to discover the authentification types and adjust UI accordingly (i.e. username/password fields, Oauth popup)\n // Without this effect, user would have to manually click the 'OK' button in order to trigger the layer connection.\n React.useEffect(() => {\n // Attach source asynchronously.\n void (async () => {\n if (isAccessClientInitialized\n && shouldAutoAttachSource\n && props.layerRequiringCredentials?.url !== undefined\n && props.layerRequiringCredentials?.name !== undefined) {\n try {\n\n const source = MapLayerSource.fromJSON({\n url: props.layerRequiringCredentials.url,\n name: props.layerRequiringCredentials.name,\n formatId: props.layerRequiringCredentials.formatId,\n });\n\n if (source !== undefined) {\n setLayerAttachPending(true);\n setShouldAutoAttachSource(false);\n const validation = await source.validateSource(true);\n if (isMounted.current) {\n setLayerAttachPending(false);\n }\n await updateAuthState(source, validation);\n }\n } catch (_error) { }\n }\n })();\n\n }, [isAccessClientInitialized, props.layerRequiringCredentials?.formatId, props.layerRequiringCredentials?.name, props.layerRequiringCredentials?.url, shouldAutoAttachSource, updateAuthState]);\n\n const dialogContainer = React.useRef<HTMLDivElement>(null);\n\n const readyToSave = React.useCallback(() => {\n const credentialsSet = !!userName && !!password;\n const ready = (!!mapUrl && !!mapName)\n && !layerAttachPending\n && (!serverRequireCredentials || credentialsSet)\n && !invalidCredentialsProvided\n && (externalLoginUrl === undefined || (externalLoginUrl !== undefined && oauthProcessSucceeded));\n return ready;\n }, [userName, password, mapUrl, mapName, serverRequireCredentials, layerAttachPending, invalidCredentialsProvided, externalLoginUrl, oauthProcessSucceeded]);\n\n // const buttonCluster = React.useMemo(() => [\n // { type: DialogButtonType.OK, onClick: handleOk, disabled: !readyToSave() },\n // { type: DialogButtonType.Cancel, onClick: handleCancel },\n // ], [readyToSave, handleCancel, handleOk]);\n\n const handleOnKeyDown = React.useCallback((event: React.KeyboardEvent<HTMLInputElement>) => {\n if (event.key === SpecialKey.Enter) {\n if (readyToSave())\n handleOk();\n }\n }, [handleOk, readyToSave]);\n\n // onOauthProcessEnd events handler\n React.useEffect(() => {\n const handleOauthProcess = (success: boolean, _state: any) => {\n setLayerAuthPending(false);\n if (success) {\n setOAuthProcessSucceeded(true);\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n handleOk(); // Add the layer the same way the user would do by clicking 'ok'\n } else {\n setShowOauthPopup(false);\n setLayerAttachPending(false);\n setOAuthProcessSucceeded(false);\n }\n };\n\n onOauthProcessEnd.addListener(handleOauthProcess);\n return () => {\n onOauthProcessEnd.removeListener(handleOauthProcess);\n };\n }, [handleOk, onOauthProcessEnd]);\n\n //\n // Monitors authentication method changes\n React.useEffect(() => {\n\n if (serverRequireCredentials && oauthProcessSucceeded === undefined && externalLoginUrl !== undefined) {\n handleArcGisLogin();\n }\n }, [oauthProcessSucceeded, externalLoginUrl, handleArcGisLogin, serverRequireCredentials]);\n\n // Monitors Oauth2 popup was closed\n const handleOAuthPopupClose = React.useCallback(() => {\n setShowOauthPopup(false);\n setLayerAuthPending(false);\n if (oauthProcessSucceeded === undefined)\n setOAuthProcessSucceeded(false); // indicates there was a failed attempt\n }, [oauthProcessSucceeded]);\n\n // Utility function to get warning message section\n function renderWarningMessage(): React.ReactNode {\n let node: React.ReactNode;\n let warningMessage: string | undefined;\n\n // Get the proper warning message\n if (showOauthPopup) {\n warningMessage = externalLoginWaitingMsg;\n } else if (oauthProcessSucceeded === false) {\n warningMessage = externalLoginFailedMsg;\n } else if (oauthProcessSucceeded === true) {\n warningMessage = externalLoginSucceededMsg;\n } else if (invalidCredentialsProvided) {\n warningMessage = invalidCredentialsLabel;\n } else if (serverRequireCredentials && (!userName || !password)) {\n warningMessage = missingCredentialsLabel;\n }\n\n // Sometimes we want to add an extra node, such as a button\n let extraNode: React.ReactNode;\n if (oauthProcessSucceeded === false) {\n extraNode = <div>\n <Button onClick={handleArcGisLogin}>{externalLoginTryAgainLabel}</Button>\n </div>;\n }\n\n if (warningMessage !== undefined) {\n return (\n <div className=\"map-layer-source-warnMessage\">\n <Icon size=\"small\"><SvgStatusWarning></SvgStatusWarning></Icon>\n <span className=\"map-layer-source-warnMessage-label\">{warningMessage}</span >\n {extraNode}\n </div>);\n } else {\n return (<span className=\"map-layer-source-placeholder\"> </span>);\n }\n return node;\n }\n\n // Use a hook to display the popup.\n // The display of the popup is controlled by the 'showOauthPopup' state variable.\n useCrossOriginPopup(showOauthPopup, externalLoginUrl, externalLoginTitle, 450, 450, handleOAuthPopupClose);\n\n function getFooter() {\n\n return (\n <div className=\"map-layer-source-footer\">\n <div className=\"map-layer-source-footer-status\"/>\n <div>\n <Button\n className=\"map-layer-features-footer-button\"\n styleType='high-visibility'\n onClick={handleOk}\n disabled={!readyToSave()}\n >\n {props?.mapLayerSourceToEdit ? MapLayersUI.translate(\"Dialog.Edit\") : MapLayersUI.translate(\"Dialog.Add\")}\n </Button>\n <Button\n className=\"map-layer-source-footer-button\"\n styleType='default'\n onClick={handleCancel}\n >\n {MapLayersUI.translate(\"Dialog.Cancel\")}\n </Button>\n </div>\n </div>\n );\n }\n\n return (\n <div ref={dialogContainer}>\n <Dialog\n className=\"map-layer-url-dialog\"\n title={dialogTitle}\n opened={true}\n resizable={true}\n movable={true}\n modal={true}\n footer={getFooter()}\n onClose={handleCancel}\n onEscape={handleCancel}\n minHeight={120}\n maxWidth={600}\n titleStyle={{ paddingLeft: \"10px\" }}\n footerStyle={{ paddingBottom: \"10px\", paddingRight: \"10px\" }}\n trapFocus={false}\n >\n <div className=\"map-layer-url-dialog-content\">\n <div className=\"map-layer-source-url\">\n <span className=\"map-layer-source-label\">{typeLabel}</span>\n <SelectMapFormat\n value={mapType}\n disabled={props.layerRequiringCredentials !== undefined || props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending}\n onChange={setMapType}\n mapTypesOptions={mapTypesOptions}\n />\n <span className=\"map-layer-source-label\">{nameLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={nameInputPlaceHolder} onChange={onNameChange} value={mapName} disabled={props.layerRequiringCredentials !== undefined || layerAttachPending || layerAuthPending} />\n <span className=\"map-layer-source-label\">{urlLabel}</span>\n <Input className=\"map-layer-source-input\" placeholder={urlInputPlaceHolder} onKeyPress={handleOnKeyDown} onChange={onUrlChange} disabled={props.mapLayerSourceToEdit !== undefined || layerAttachPending || layerAuthPending} value={mapUrl} />\n {serverRequireCredentials\n && externalLoginUrl === undefined // external login is handled in popup\n && props.mapLayerSourceToEdit === undefined &&\n <>\n <span className=\"map-layer-source-label\">{userNameLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n displayStyle=\"inline\"\n placeholder={serverRequireCredentials ? userNameRequiredLabel : userNameLabel}\n status={(!userName && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onUsernameChange}\n value={userName}\n size=\"small\" />\n\n <span className=\"map-layer-source-label\">{passwordLabel}</span>\n <LabeledInput className=\"map-layer-source-input\"\n\n displayStyle=\"inline\"\n type=\"password\" placeholder={serverRequireCredentials ? passwordRequiredLabel : passwordLabel}\n status={(!password && serverRequireCredentials) || invalidCredentialsProvided ? \"warning\" : undefined}\n disabled={layerAttachPending || layerAuthPending}\n onChange={onPasswordChange}\n onKeyPress={handleOnKeyDown}\n value={password}\n size=\"small\" />\n\n </>\n }\n\n {/* Store settings options, not shown when editing a layer */}\n {!props.layerRequiringCredentials\n && !props.mapLayerSourceToEdit\n && <div title={!isSettingsStorageAvailable ? noSaveSettingsWarning : \"\"}>\n {hasImodelContext &&\n <div>\n <Radio disabled={!isSettingsStorageAvailable}\n name=\"settingsStorage\" value=\"iTwin\"\n label={iTwinSettingsLabel} checked={settingsStorage === \"iTwin\"}\n onChange={onRadioChange} />\n <Radio disabled={!isSettingsStorageAvailable}\n name=\"settingsStorage\" value=\"Model\"\n label={modelSettingsLabel} checked={settingsStorage === \"Model\"}\n onChange={onRadioChange} />\n </div>}\n </div>}\n </div>\n </div>\n\n {/* Warning message */}\n {renderWarningMessage()}\n\n {/* Progress bar */}\n {(layerAttachPending || layerAuthPending) &&\n <div className=\"map-layer-source-progressBar\">\n <ProgressLinear indeterminate />\n </div>\n }\n </Dialog>\n </div >\n );\n}\n"]}
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
"Close": "Close source map layers pop-up"
|
|
5
5
|
},
|
|
6
6
|
"Basemap": {
|
|
7
|
-
"BaseLayer": "Base
|
|
7
|
+
"BaseLayer": "Base",
|
|
8
8
|
"BaseMapPanelTitle": "Map Layers",
|
|
9
9
|
"ColorFill": "Solid Fill Color",
|
|
10
|
-
"SelectBaseMap": "Select
|
|
10
|
+
"SelectBaseMap": "Select base layer"
|
|
11
11
|
},
|
|
12
12
|
"ColorDialog": {
|
|
13
13
|
"Title": "Specify Base Color"
|
|
@@ -147,5 +147,12 @@
|
|
|
147
147
|
},
|
|
148
148
|
"TransparencyPopup": {
|
|
149
149
|
"SetTransparency": "Set transparency"
|
|
150
|
+
},
|
|
151
|
+
"WellKnownBaseMaps" : {
|
|
152
|
+
"BingProvider" : {
|
|
153
|
+
"Aerial" : "Bing Maps: Aerial Imagery",
|
|
154
|
+
"Hybrid" : "Bing Maps: Aerial Imagery with labels",
|
|
155
|
+
"Street" : "Bing Maps: Streets"
|
|
156
|
+
}
|
|
150
157
|
}
|
|
151
158
|
}
|
|
@@ -41,7 +41,7 @@ export class FeatureInfoUiItemsProvider {
|
|
|
41
41
|
label: MapLayersUI.localization.getLocalizedString("mapLayers:FeatureInfoWidget.Label"),
|
|
42
42
|
icon: React.createElement(SvgMapInfo, null),
|
|
43
43
|
content: React.createElement(MapFeatureInfoWidget, { featureInfoOpts: this._featureInfoOpts }),
|
|
44
|
-
defaultState: WidgetState.
|
|
44
|
+
defaultState: WidgetState.Hidden,
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
return widgets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAe,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAmB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChM,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAA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AE,0BAA0B,CAAC,QAAQ;gBACvC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,mCAAmC,CAAC;gBACvF,IAAI,EAAE,oBAAC,UAAU,OAAE;gBACnB,OAAO,EAAE,oBAAC,oBAAoB,IAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,GAAI;gBACzE,YAAY,EAAE,WAAW,CAAC,MAAM;aACjC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AAvCsB,mCAAQ,GAAG,iCAAiC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport * as React from \"react\";\nimport { StagePanelLocation, StagePanelSection, StageUsage, ToolbarHelper, ToolbarItem, ToolbarOrientation, ToolbarUsage, ToolItemDef, UiItemsProvider, WidgetState } from \"@itwin/appui-react\";\nimport { MapFeatureInfoWidget } from \"./widget/FeatureInfoWidget\";\nimport { MapFeatureInfoOptions } from \"./Interfaces\";\nimport { MapLayersUI } from \"../mapLayers\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { MapFeatureInfoTool } from \"@itwin/map-layers-formats\";\nimport { SvgMapInfo } from \"@itwin/itwinui-icons-react\";\n\nexport const getMapFeatureInfoToolItemDef = (): ToolItemDef =>\n new ToolItemDef({\n toolId: MapFeatureInfoTool.toolId,\n iconSpec: <SvgMapInfo/>,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n description: () => MapFeatureInfoTool.description,\n execute: async () => { await IModelApp.tools.run(MapFeatureInfoTool.toolId); },\n });\n\nexport class FeatureInfoUiItemsProvider implements UiItemsProvider { // eslint-disable-line deprecation/deprecation\n public readonly id = \"FeatureInfoUiItemsProvider\";\n public static readonly widgetId = \"map-layers:mapFeatureInfoWidget\";\n\n public constructor(private _featureInfoOpts: MapFeatureInfoOptions) { }\n\n public provideToolbarItems(\n _stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n ): ReadonlyArray<ToolbarItem> {\n if (\n !this._featureInfoOpts?.disableDefaultFeatureInfoTool &&\n stageUsage === StageUsage.General &&\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n return [\n ToolbarHelper.createToolbarItemFromItemDef(60, getMapFeatureInfoToolItemDef()),\n ];\n }\n\n return [];\n }\n\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) {\n const widgets = [];\n\n const tmpSection = section ?? StagePanelSection.End;\n if (tmpSection === StagePanelSection.End && stageUsage === StageUsage.General && location === StagePanelLocation.Right ) {\n widgets.push({\n id: FeatureInfoUiItemsProvider.widgetId,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n icon: <SvgMapInfo/>,\n content: <MapFeatureInfoWidget featureInfoOpts={this._featureInfoOpts} />,\n defaultState: WidgetState.
|
|
1
|
+
{"version":3,"file":"FeatureInfoUiItemsProvider.js","sourceRoot":"","sources":["../../../src/ui/FeatureInfoUiItemsProvider.tsx"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,UAAU,EAAE,aAAa,EAAe,kBAAkB,EAAE,YAAY,EAAE,WAAW,EAAmB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAChM,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,UAAU,EA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kB,CAAC,KAAK,EAAI;YACzH,OAAO,CAAC,IAAI,CAAC;gBACX,EAAE,EAAE,0BAA0B,CAAC,QAAQ;gBACvC,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,mCAAmC,CAAC;gBACvF,IAAI,EAAE,oBAAC,UAAU,OAAE;gBACnB,OAAO,EAAE,oBAAC,oBAAoB,IAAC,eAAe,EAAE,IAAI,CAAC,gBAAgB,GAAI;gBACzE,YAAY,EAAE,WAAW,CAAC,MAAM;aACjC,CAAC,CAAC;SACJ;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;;AAvCsB,mCAAQ,GAAG,iCAAiC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport * as React from \"react\";\nimport { StagePanelLocation, StagePanelSection, StageUsage, ToolbarHelper, ToolbarItem, ToolbarOrientation, ToolbarUsage, ToolItemDef, UiItemsProvider, WidgetState } from \"@itwin/appui-react\";\nimport { MapFeatureInfoWidget } from \"./widget/FeatureInfoWidget\";\nimport { MapFeatureInfoOptions } from \"./Interfaces\";\nimport { MapLayersUI } from \"../mapLayers\";\nimport { IModelApp } from \"@itwin/core-frontend\";\nimport { MapFeatureInfoTool } from \"@itwin/map-layers-formats\";\nimport { SvgMapInfo } from \"@itwin/itwinui-icons-react\";\n\nexport const getMapFeatureInfoToolItemDef = (): ToolItemDef =>\n new ToolItemDef({\n toolId: MapFeatureInfoTool.toolId,\n iconSpec: <SvgMapInfo/>,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n description: () => MapFeatureInfoTool.description,\n execute: async () => { await IModelApp.tools.run(MapFeatureInfoTool.toolId); },\n });\n\nexport class FeatureInfoUiItemsProvider implements UiItemsProvider { // eslint-disable-line deprecation/deprecation\n public readonly id = \"FeatureInfoUiItemsProvider\";\n public static readonly widgetId = \"map-layers:mapFeatureInfoWidget\";\n\n public constructor(private _featureInfoOpts: MapFeatureInfoOptions) { }\n\n public provideToolbarItems(\n _stageId: string,\n stageUsage: string,\n toolbarUsage: ToolbarUsage,\n toolbarOrientation: ToolbarOrientation,\n ): ReadonlyArray<ToolbarItem> {\n if (\n !this._featureInfoOpts?.disableDefaultFeatureInfoTool &&\n stageUsage === StageUsage.General &&\n toolbarUsage === ToolbarUsage.ContentManipulation &&\n toolbarOrientation === ToolbarOrientation.Vertical\n ) {\n return [\n ToolbarHelper.createToolbarItemFromItemDef(60, getMapFeatureInfoToolItemDef()),\n ];\n }\n\n return [];\n }\n\n public provideWidgets(_stageId: string, stageUsage: string, location: StagePanelLocation, section?: StagePanelSection) {\n const widgets = [];\n\n const tmpSection = section ?? StagePanelSection.End;\n if (tmpSection === StagePanelSection.End && stageUsage === StageUsage.General && location === StagePanelLocation.Right ) {\n widgets.push({\n id: FeatureInfoUiItemsProvider.widgetId,\n label: MapLayersUI.localization.getLocalizedString(\"mapLayers:FeatureInfoWidget.Label\"),\n icon: <SvgMapInfo/>,\n content: <MapFeatureInfoWidget featureInfoOpts={this._featureInfoOpts} />,\n defaultState: WidgetState.Hidden,\n });\n }\n\n return widgets;\n }\n}\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BeEvent } from "@itwin/core-bentley";
|
|
2
|
-
import { MapSubLayerProps } from "@itwin/core-common";
|
|
2
|
+
import { BaseMapLayerSettings, MapSubLayerProps } from "@itwin/core-common";
|
|
3
3
|
import { HitDetail, MapLayerImageryProvider, MapTileTreeScaleRangeVisibility } from "@itwin/core-frontend";
|
|
4
4
|
export interface StyleMapLayerSettings {
|
|
5
5
|
/** Name */
|
|
6
6
|
name: string;
|
|
7
|
-
/** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings)
|
|
7
|
+
/** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings) */
|
|
8
8
|
source: string;
|
|
9
9
|
/** Controls visibility of layer */
|
|
10
10
|
visible: boolean;
|
|
@@ -33,6 +33,8 @@ export interface MapLayerOptions {
|
|
|
33
33
|
hideExternalMapLayers?: boolean;
|
|
34
34
|
fetchPublicMapLayerSources?: boolean;
|
|
35
35
|
mapTypeOptions?: MapTypesOptions;
|
|
36
|
+
/** Optional list of base map-layers to display in the base map select control */
|
|
37
|
+
baseMapLayers?: BaseMapLayerSettings[];
|
|
36
38
|
}
|
|
37
39
|
export interface MapFeatureInfoPropertyGridOptions {
|
|
38
40
|
isPropertySelectionEnabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.d.ts","sourceRoot":"","sources":["../../../src/ui/Interfaces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAG,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Interfaces.d.ts","sourceRoot":"","sources":["../../../src/ui/Interfaces.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAG,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AAE3G,MAAM,WAAW,qBAAqB;IACpC,WAAW;IACX,IAAI,EAAE,MAAM,CAAC;IACb,qFAAqF;IACrF,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,+BAA+B,CAAC;IAChD,2MAA2M;IAC3M,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,qCAAqC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,iCAAiC;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IAEnC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,wBAAwB,EAAE,OAAO,CAAC;CAC5C;AAED,MAAM,WAAW,eAAe;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,cAAc,CAAC,EAAE,eAAe,CAAC;IAEjC,iFAAiF;IACjF,aAAa,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,iCAAiC;IAChD,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACtC;AAED,oBAAY,WAAW,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC;AAE5D,MAAM,WAAW,qBAAqB;IACpC,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,mBAAmB,CAAC,EAAE,iCAAiC,CAAC;CACzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../../src/ui/Interfaces.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { MapSubLayerProps } from \"@itwin/core-common\";\nimport { HitDetail, MapLayerImageryProvider, MapTileTreeScaleRangeVisibility } from \"@itwin/core-frontend\";\n\nexport interface StyleMapLayerSettings {\n /** Name */\n name: string;\n /** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings)
|
|
1
|
+
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../../../src/ui/Interfaces.ts"],"names":[],"mappings":"","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { BeEvent } from \"@itwin/core-bentley\";\nimport { BaseMapLayerSettings, MapSubLayerProps } from \"@itwin/core-common\";\nimport { HitDetail, MapLayerImageryProvider, MapTileTreeScaleRangeVisibility } from \"@itwin/core-frontend\";\n\nexport interface StyleMapLayerSettings {\n /** Name */\n name: string;\n /** source (i.URL for ImageMapLayerSettings or modelId for ModelMapLayerSettings) */\n source: string;\n /** Controls visibility of layer */\n visible: boolean;\n treeVisibility: MapTileTreeScaleRangeVisibility;\n /** A transparency value from 0.0 (fully opaque) to 1.0 (fully transparent) to apply to map graphics when drawing, or false to indicate the transparency should not be overridden. Default value: false. */\n transparency: number;\n /** Transparent background */\n transparentBackground: boolean;\n /** set map as underlay or overlay */\n isOverlay: boolean;\n /** layer index in the viewport */\n layerIndex: number;\n /** Available map sub-layer */\n subLayers?: MapSubLayerProps[];\n /** sub-layer panel displayed. */\n showSubLayers: boolean;\n /** Some format can publish only a single layer at a time (i.e WMTS) */\n provider?: MapLayerImageryProvider;\n\n selected: boolean;\n}\n\nexport interface MapTypesOptions {\n readonly supportTileUrl: boolean;\n readonly supportWmsAuthentication: boolean;\n}\n\nexport interface MapLayerOptions {\n hideExternalMapLayers?: boolean;\n fetchPublicMapLayerSources?: boolean;\n mapTypeOptions?: MapTypesOptions;\n\n /** Optional list of base map-layers to display in the base map select control */\n baseMapLayers?: BaseMapLayerSettings[];\n}\n\nexport interface MapFeatureInfoPropertyGridOptions {\n isPropertySelectionEnabled?: boolean;\n}\n\nexport type MapHitEvent = BeEvent<(hit: HitDetail) => void>;\n\nexport interface MapFeatureInfoOptions {\n disableDefaultFeatureInfoTool?: boolean;\n showLoadProgressAnimation?: boolean;\n propertyGridOptions?: MapFeatureInfoPropertyGridOptions;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasemapPanel.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/BasemapPanel.tsx"],"names":[],"mappings":"AAgBA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"BasemapPanel.d.ts","sourceRoot":"","sources":["../../../../src/ui/widget/BasemapPanel.tsx"],"names":[],"mappings":"AAgBA,OAAO,qBAAqB,CAAC;AAM7B,UAAU,iBAAiB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,gBAAgB;AAEhB,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,eAmNpD"}
|
|
@@ -5,28 +5,23 @@
|
|
|
5
5
|
/* eslint-disable deprecation/deprecation */
|
|
6
6
|
// cSpell:ignore droppable Sublayer Basemap
|
|
7
7
|
import { UiFramework } from "@itwin/appui-react";
|
|
8
|
-
import { BaseMapLayerSettings, ColorByName, ColorDef, ImageMapLayerSettings } from "@itwin/core-common";
|
|
8
|
+
import { BackgroundMapType, BaseMapLayerSettings, ColorByName, ColorDef, ImageMapLayerSettings } from "@itwin/core-common";
|
|
9
9
|
import { WebFontIcon } from "@itwin/core-react";
|
|
10
10
|
import { ColorPickerDialog, ColorSwatch } from "@itwin/imodel-components-react";
|
|
11
11
|
import { Button, Select } from "@itwin/itwinui-react";
|
|
12
|
-
import * as React from "react";
|
|
13
12
|
import { MapLayersUI } from "../../mapLayers";
|
|
14
13
|
import { useSourceMapContext } from "./MapLayerManager";
|
|
15
14
|
import { TransparencyPopupButton } from "./TransparencyPopupButton";
|
|
15
|
+
import * as React from "react";
|
|
16
16
|
import "./BasemapPanel.scss";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return undefined;
|
|
20
|
-
if (backgroundBase instanceof ImageMapLayerSettings || backgroundBase instanceof ColorDef)
|
|
21
|
-
return backgroundBase.toJSON();
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
17
|
+
const customBaseMapValue = "customBaseMap";
|
|
18
|
+
const getSelectKeyFromProvider = (base) => `${base.provider ? `${base.provider.name}.${BackgroundMapType[base.provider.type]}` : `${base.name}`}`;
|
|
24
19
|
/** @internal */
|
|
25
20
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
21
|
export function BasemapPanel(props) {
|
|
27
22
|
const [useColorLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Basemap.ColorFill"));
|
|
28
23
|
const { activeViewport, bases } = useSourceMapContext();
|
|
29
|
-
const [selectedBaseMap, setSelectedBaseMap] = React.useState(
|
|
24
|
+
const [selectedBaseMap, setSelectedBaseMap] = React.useState(activeViewport?.displayStyle.settings.mapImagery.backgroundBase);
|
|
30
25
|
const [baseMapTransparencyValue, setBaseMapTransparencyValue] = React.useState(() => {
|
|
31
26
|
if (activeViewport) {
|
|
32
27
|
const mapImagery = activeViewport.displayStyle.settings.mapImagery;
|
|
@@ -44,6 +39,7 @@ export function BasemapPanel(props) {
|
|
|
44
39
|
return 0;
|
|
45
40
|
}
|
|
46
41
|
});
|
|
42
|
+
const [customBaseMap, setCustomBaseMap] = React.useState();
|
|
47
43
|
const [baseMapVisible, setBaseMapVisible] = React.useState(() => {
|
|
48
44
|
if (activeViewport && activeViewport.displayStyle.backgroundMapBase instanceof ImageMapLayerSettings) {
|
|
49
45
|
return activeViewport.displayStyle.backgroundMapBase.visible;
|
|
@@ -51,27 +47,34 @@ export function BasemapPanel(props) {
|
|
|
51
47
|
return false;
|
|
52
48
|
});
|
|
53
49
|
const handleMapImageryChanged = React.useCallback((args) => {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (JSON.stringify(baseMap)
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
50
|
+
const baseMap = args.backgroundBase;
|
|
51
|
+
// Optimization: If serialized 'backgroundBase' objects are identical, skip refresh
|
|
52
|
+
if (JSON.stringify(baseMap.toJSON()) === JSON.stringify(selectedBaseMap?.toJSON()))
|
|
53
|
+
return;
|
|
54
|
+
setSelectedBaseMap(baseMap); // cache current base map objects
|
|
55
|
+
if (baseMap instanceof ImageMapLayerSettings) {
|
|
56
|
+
if (baseMap.transparency !== baseMapTransparencyValue)
|
|
57
|
+
setBaseMapTransparencyValue(baseMap.transparency);
|
|
58
|
+
if (baseMap.visible !== baseMapVisible)
|
|
59
|
+
setBaseMapVisible(baseMap.visible);
|
|
64
60
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
61
|
+
else if (baseMap instanceof ColorDef) {
|
|
62
|
+
if (baseMap.getAlpha() !== baseMapTransparencyValue) {
|
|
63
|
+
setBaseMapTransparencyValue(baseMap.getAlpha() / 255);
|
|
64
|
+
}
|
|
68
65
|
}
|
|
69
|
-
}, [baseMapTransparencyValue, baseMapVisible, selectedBaseMap
|
|
66
|
+
}, [baseMapTransparencyValue, baseMapVisible, selectedBaseMap]);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
const handleDisplayStyleChange = (vp) => {
|
|
69
|
+
handleMapImageryChanged(vp.displayStyle.settings.mapImagery);
|
|
70
|
+
};
|
|
71
|
+
return activeViewport?.onDisplayStyleChanged.addListener(handleDisplayStyleChange);
|
|
72
|
+
}, [activeViewport, handleMapImageryChanged]);
|
|
70
73
|
// Monitor display style's onMapImageryChanged event
|
|
71
74
|
React.useEffect(() => {
|
|
72
75
|
return activeViewport?.displayStyle.settings.onMapImageryChanged.addListener(handleMapImageryChanged);
|
|
73
76
|
}, [activeViewport, handleMapImageryChanged]);
|
|
74
|
-
// Monitor viewport updates, and refresh the widget accordingly.
|
|
77
|
+
// Monitor viewport updates, and refresh the widget accordingly .
|
|
75
78
|
// Note: This is needed for multiple viewport applications.
|
|
76
79
|
React.useEffect(() => {
|
|
77
80
|
if (activeViewport) {
|
|
@@ -87,10 +90,18 @@ export function BasemapPanel(props) {
|
|
|
87
90
|
const baseMapOptions = React.useMemo(() => {
|
|
88
91
|
const baseOptions = [];
|
|
89
92
|
baseOptions.push({ value: useColorLabel, label: useColorLabel });
|
|
90
|
-
if (bases)
|
|
91
|
-
baseOptions.push(...bases.map((
|
|
93
|
+
if (bases) {
|
|
94
|
+
baseOptions.push(...bases.map((bgProvider) => {
|
|
95
|
+
const value = getSelectKeyFromProvider(bgProvider);
|
|
96
|
+
const label = MapLayersUI.translate(`WellKnownBaseMaps.${value}`);
|
|
97
|
+
return { value, label };
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
if (customBaseMap) {
|
|
101
|
+
baseOptions.push({ value: customBaseMapValue, label: customBaseMap.name });
|
|
102
|
+
}
|
|
92
103
|
return baseOptions;
|
|
93
|
-
}, [bases, useColorLabel]);
|
|
104
|
+
}, [bases, useColorLabel, customBaseMap]);
|
|
94
105
|
const [presetColors] = React.useState([
|
|
95
106
|
ColorDef.create(ColorByName.grey),
|
|
96
107
|
ColorDef.create(ColorByName.lightGrey),
|
|
@@ -101,26 +112,36 @@ export function BasemapPanel(props) {
|
|
|
101
112
|
ColorDef.create(ColorByName.tan),
|
|
102
113
|
ColorDef.create(ColorByName.darkBrown),
|
|
103
114
|
]);
|
|
104
|
-
const baseIsColor = React.useMemo(() =>
|
|
115
|
+
const baseIsColor = React.useMemo(() => selectedBaseMap instanceof ColorDef, [selectedBaseMap]);
|
|
105
116
|
const baseIsMap = React.useMemo(() => !baseIsColor && (selectedBaseMap !== undefined), [baseIsColor, selectedBaseMap]);
|
|
106
|
-
const bgColor = React.useMemo(() => baseIsColor ? selectedBaseMap : presetColors[0].toJSON(), [baseIsColor, selectedBaseMap, presetColors]);
|
|
117
|
+
const bgColor = React.useMemo(() => baseIsColor ? selectedBaseMap.toJSON() : presetColors[0].toJSON(), [baseIsColor, selectedBaseMap, presetColors]);
|
|
107
118
|
const [colorDialogTitle] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:ColorDialog.Title"));
|
|
108
119
|
const selectedBaseMapValue = React.useMemo(() => {
|
|
109
120
|
if (baseIsMap) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
121
|
+
if (selectedBaseMap instanceof BaseMapLayerSettings && selectedBaseMap.provider) {
|
|
122
|
+
const mapName = getSelectKeyFromProvider(selectedBaseMap);
|
|
123
|
+
const foundItem = baseMapOptions.find((value) => value.value === mapName);
|
|
124
|
+
if (foundItem)
|
|
125
|
+
return foundItem;
|
|
126
|
+
}
|
|
127
|
+
else if (selectedBaseMap instanceof BaseMapLayerSettings) {
|
|
128
|
+
// We got a custom base map, create en entry for it.
|
|
129
|
+
setCustomBaseMap(selectedBaseMap);
|
|
130
|
+
return { value: customBaseMapValue, label: selectedBaseMap.name };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
else if (baseIsColor) {
|
|
134
|
+
return baseMapOptions[0];
|
|
114
135
|
}
|
|
115
|
-
return
|
|
116
|
-
}, [selectedBaseMap, baseMapOptions
|
|
136
|
+
return { value: "", label: "" }; // will display the place holder
|
|
137
|
+
}, [baseIsMap, baseIsColor, selectedBaseMap, baseMapOptions]);
|
|
117
138
|
const handleBackgroundColorDialogOk = React.useCallback((bgColorDef) => {
|
|
118
139
|
UiFramework.dialogs.modal.close();
|
|
119
140
|
if (activeViewport) {
|
|
120
141
|
// change color and make sure previously set transparency is not lost.
|
|
121
142
|
const curTransparency = activeViewport.displayStyle.backgroundMapBase instanceof ColorDef ? activeViewport.displayStyle.backgroundMapBase.getTransparency() : 0;
|
|
122
143
|
activeViewport.displayStyle.backgroundMapBase = bgColorDef.withTransparency(curTransparency);
|
|
123
|
-
setSelectedBaseMap(bgColorDef
|
|
144
|
+
setSelectedBaseMap(bgColorDef);
|
|
124
145
|
}
|
|
125
146
|
}, [activeViewport]);
|
|
126
147
|
const handleBackgroundColorDialogCancel = React.useCallback(() => {
|
|
@@ -131,26 +152,32 @@ export function BasemapPanel(props) {
|
|
|
131
152
|
UiFramework.dialogs.modal.open(React.createElement(ColorPickerDialog, { dialogTitle: colorDialogTitle, color: newColor, colorPresets: presetColors, colorInputType: "rgb", onOkResult: handleBackgroundColorDialogOk, onCancelResult: handleBackgroundColorDialogCancel }));
|
|
132
153
|
}, [presetColors, handleBackgroundColorDialogOk]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
133
154
|
const handleBaseMapSelection = React.useCallback((value) => {
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
if (activeViewport && value) {
|
|
156
|
+
if (value === customBaseMapValue && customBaseMap) {
|
|
157
|
+
setSelectedBaseMap(customBaseMap);
|
|
158
|
+
activeViewport.displayStyle.backgroundMapBase = customBaseMap;
|
|
159
|
+
}
|
|
160
|
+
else if (bases) {
|
|
161
|
+
const baseMap = bases.find((provider) => getSelectKeyFromProvider(provider) === value);
|
|
162
|
+
if (baseMap) {
|
|
163
|
+
const baseProps = baseMap.toJSON();
|
|
164
|
+
if (activeViewport.displayStyle.backgroundMapBase instanceof BaseMapLayerSettings) {
|
|
165
|
+
activeViewport.displayStyle.backgroundMapBase = activeViewport.displayStyle.backgroundMapBase.clone({ ...baseProps, visible: baseMapVisible });
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
activeViewport.displayStyle.backgroundMapBase = BaseMapLayerSettings.fromJSON({ ...baseProps, visible: baseMapVisible });
|
|
169
|
+
}
|
|
170
|
+
setSelectedBaseMap(baseMap);
|
|
140
171
|
}
|
|
141
172
|
else {
|
|
142
|
-
|
|
173
|
+
const bgColorDef = ColorDef.fromJSON(bgColor);
|
|
174
|
+
const curTransparency = activeViewport.displayStyle.backgroundMapBase instanceof ColorDef ? activeViewport.displayStyle.backgroundMapBase.getTransparency() : 0;
|
|
175
|
+
activeViewport.displayStyle.backgroundMapBase = bgColorDef.withTransparency(curTransparency);
|
|
176
|
+
setSelectedBaseMap(bgColorDef);
|
|
143
177
|
}
|
|
144
|
-
setSelectedBaseMap(baseProps);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
const bgColorDef = ColorDef.fromJSON(bgColor);
|
|
148
|
-
const curTransparency = activeViewport.displayStyle.backgroundMapBase instanceof ColorDef ? activeViewport.displayStyle.backgroundMapBase.getTransparency() : 0;
|
|
149
|
-
activeViewport.displayStyle.backgroundMapBase = bgColorDef.withTransparency(curTransparency);
|
|
150
|
-
setSelectedBaseMap(bgColorDef.toJSON());
|
|
151
178
|
}
|
|
152
179
|
}
|
|
153
|
-
}, [
|
|
180
|
+
}, [activeViewport, bases, customBaseMap, baseMapVisible, bgColor]);
|
|
154
181
|
const handleVisibilityChange = React.useCallback(() => {
|
|
155
182
|
if (activeViewport) {
|
|
156
183
|
const newState = !baseMapVisible;
|
|
@@ -165,10 +192,10 @@ export function BasemapPanel(props) {
|
|
|
165
192
|
const [selectBaseMapLabel] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Basemap.SelectBaseMap"));
|
|
166
193
|
const [toggleVisibility] = React.useState(MapLayersUI.localization.getLocalizedString("mapLayers:Widget.ToggleVisibility"));
|
|
167
194
|
return (React.createElement(React.Fragment, null,
|
|
195
|
+
React.createElement("span", { className: "map-manager-base-label" }, baseLayerLabel),
|
|
168
196
|
React.createElement("div", { className: "map-manager-base-item" },
|
|
169
197
|
React.createElement(Button, { className: "map-manager-basemap-visibility map-manager-visibility-icon", size: "small", styleType: "borderless", title: toggleVisibility, onClick: handleVisibilityChange, disabled: props.disabled || !activeViewport || !(activeViewport.displayStyle.backgroundMapBase instanceof ImageMapLayerSettings) },
|
|
170
198
|
React.createElement(WebFontIcon, { iconName: baseMapVisible ? "icon-visibility" : "icon-visibility-hide-2" })),
|
|
171
|
-
React.createElement("span", { className: "map-manager-base-label" }, baseLayerLabel),
|
|
172
199
|
React.createElement(Select, { className: "map-manager-base-item-select", options: baseMapOptions, placeholder: selectBaseMapLabel, value: selectedBaseMapValue.value, onChange: handleBaseMapSelection, size: "small", disabled: props.disabled }),
|
|
173
200
|
baseIsColor &&
|
|
174
201
|
React.createElement(ColorSwatch, { className: "map-manager-base-item-color", colorDef: ColorDef.fromJSON(bgColor), round: false, onColorPick: handleBgColorClick }),
|