-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cesium2d viewer #7234
base: main
Are you sure you want to change the base?
Cesium2d viewer #7234
Conversation
…iewers to show in `SettingPanel`
@glughi - Thanks for this and other PRs you have created. We currently have a bit of a backlog but will hopefully be able to review yours soon :) |
@@ -173,6 +179,8 @@ export default class TerriaViewer { | |||
viewerFromPromise = leafletFromPromise.get(); | |||
} else if (this.attached && this.viewerMode === ViewerMode.Cesium) { | |||
viewerFromPromise = cesiumFromPromise.get(); | |||
} else if (this.attached && this.viewerMode === ViewerMode.Cesium2D) { | |||
viewerFromPromise = cesium2dFromPromise.get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, the body of cesiumFromPromise
looks identical to the body of cesium2dFromPromise
. Can't this entire else-if be folded into the previous else if, but with the condition this.attached && (this.viewerMode === ViewerMode.Cesium || this.viewerMode === ViewerMode.Cesium2D)
?
@@ -373,6 +373,11 @@ export interface ConfigParameters { | |||
*/ | |||
searchBarConfig?: ModelPropertiesFromTraits<SearchBarTraits>; | |||
searchProviders: ModelPropertiesFromTraits<SearchProviderTraits>[]; | |||
|
|||
/** | |||
* List of the enabled MapViewers: 3d, 3dsmooth, 2d, cesium2d |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type says this is an array rather than a list. The JSDoc for the other array-options seems to start with just "The", so "The enabled MapViewers .." in this case.
cesium2d: { | ||
viewerMode: ViewerMode.Cesium2D, | ||
terrain: false, | ||
label: "settingPanel.viewerModeLabels.Leaflet", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other entries have unique labels, so I'm guessing this entry shouldn't use the already used Leaflet-label.
<Text mini>{t(viewerMode.label)}</Text> | ||
</SettingsButton> | ||
))} | ||
{Object.entries(MapViewers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous line contains elementsNo={3}
, which coincides with MapViewers.length
. Does this work as intended when the filtering filters out some objects?
And even without filtering, why does the previous line not need to be updated to contain 4 since there is one more item in MapViewers in this PR?
What this PR does
Added Cesium in 2D mode (
SCENE2D
) to possible map viewers; WebMercator is set as map projection when using this mode. Cesium 2D is faster than Leaflet and the behavior of the two views (3d and 2d) in this way is homogeneous. Leaflet is not removed from the project and you can use one, the other or both.Added the parameter
mapViewers
with which inconfig.json
you can indicate which map viewers must be enabled and available in the MapSettings panel (the possible values are now "3d", "3dsmooth", "2d" and "cesium2d"). By default it keeps the known behavior.Test me
Put
"mapViewers":["3d", "cesium2d"],
in yourconfig.json
and reload. In MapSettings panel you should see the new option.Checklist
doc/
.