Skip to content

Commit

Permalink
#10225: Enhance UX for simple 3D navigation in touch devices [Impleme…
Browse files Browse the repository at this point in the history
…ntation via Config-level] (#10261)
  • Loading branch information
mahmoudadel54 committed May 17, 2024
1 parent 13fe763 commit 37343a1
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion web/client/components/buttons/ZoomToMaxExtentButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class ZoomToMaxExtentButton extends React.Component {
// zooming to the initial extent based on initial map configuration
var mapConfig = this.props.mapInitialConfig;
let bbox = getBbox(mapConfig.center, mapConfig.zoom, this.props.mapConfig.size);
this.props.changeMapView(mapConfig.center, mapConfig.zoom, bbox, this.props.mapConfig.size, null, this.props.mapConfig.projection);
this.props.changeMapView(mapConfig.center, mapConfig.zoom, bbox, this.props.mapConfig.size, null, this.props.mapConfig.projection, mapConfig?.viewerOptions);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe('This test for ZoomToMaxExtentButton', () => {
componentSpy.restore();

expect(actionsSpy.calls.length).toBe(1);
expect(actionsSpy.calls[0].arguments.length).toBe(6);
expect(actionsSpy.calls[0].arguments.length).toBe(7);
expect(actionsSpy.calls[0].arguments[0]).toExist();
expect(actionsSpy.calls[0].arguments[1]).toExist();
// the bbox is null since no hook was registered
Expand Down
11 changes: 11 additions & 0 deletions web/client/components/map/cesium/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,17 @@ class CesiumMap extends React.Component {

// this is needed to display correctly intersection between terrain and primitives
scene.globe.depthTestAgainstTerrain = this.props.mapOptions?.depthTestAgainstTerrain ?? false;
// set zoom limits if found
if (this.props.mapOptions?.minimumZoomDistance || this.props.mapOptions?.maximumZoomDistance) {
const minZoomLevel = this.props.mapOptions?.minimumZoomDistance;
const maxZoomLevel = this.props.mapOptions?.maximumZoomDistance;
if (minZoomLevel) {
map.scene.screenSpaceCameraController.minimumZoomDistance = minZoomLevel;
}
if (maxZoomLevel) {
map.scene.screenSpaceCameraController.maximumZoomDistance = maxZoomLevel;
}
}

this.forceUpdate();
map.scene.requestRender();
Expand Down
2 changes: 2 additions & 0 deletions web/client/plugins/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ import {getHighlightLayerOptions} from "../utils/HighlightUtils";
* @prop {boolean} mapOptions.cesium.showGroundAtmosphere enable ground atmosphere of the globe (default false)
* @prop {boolean} mapOptions.cesium.enableFog enable fog in the view (default false)
* @prop {boolean} mapOptions.cesium.depthTestAgainstTerrain if true all primitive 3d features will be tested against the terrain while if false they will be drawn on top of the terrain even if hidden by it (default true)
* @prop {number} mapOptions.cesium.maximumZoomDistance max zoom limit (in meter unit) to restrict the zoom out operation based on it
* @prop {number} mapOptions.cesium.minimumZoomDistance min zoom limit (in meter unit) to restrict the zoom in operation based on it
* @static
* @example
* // Adding a layer to be used as a source for the elevation (shown in the MousePosition plugin configured with showElevation = true)
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@
"zoombuttons": {
"zoomInTooltip": "Zoom vergrößern",
"zoomOutTooltip": "Zoom verringern",
"zoomAllTooltip": "Zoom auf maximale Ausdehnung"
"zoomAllTooltip": "Zoom auf zur Anfangsansicht"
},
"fullscreen": {
"tooltipActivate": "Umschalten auf Vollbild",
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@
"zoombuttons": {
"zoomInTooltip": "Increase zoom",
"zoomOutTooltip": "Decrease zoom",
"zoomAllTooltip": "Zoom to max extent"
"zoomAllTooltip": "Zoom to initial view"
},
"fullscreen": {
"tooltipActivate": "Switch to full screen",
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.es-ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@
"zoombuttons": {
"zoomInTooltip": "Acercar",
"zoomOutTooltip": "Alejar",
"zoomAllTooltip": "Ajustar a la máxima extensión"
"zoomAllTooltip": "Ajustar a la vista inicial"
},
"fullscreen": {
"tooltipActivate": "Cambiar a pantalla completa",
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@
"zoombuttons": {
"zoomInTooltip": "Zoomer vers l'avant",
"zoomOutTooltip": "Zoomer vers l'arrière",
"zoomAllTooltip": "Agrandir à l'extension maximale"
"zoomAllTooltip": "Agrandir à la vue initiale"
},
"fullscreen": {
"tooltipActivate": "Passer en plein écran",
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.is-IS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
"zoombuttons": {
"zoomInTooltip": "Increase zoom",
"zoomOutTooltip": "Decrease zoom",
"zoomAllTooltip": "Zoom to max extent"
"zoomAllTooltip": "Zoom to initial view"
},
"fullscreen": {
"tooltipActivate": "Switch to full screen",
Expand Down
2 changes: 1 addition & 1 deletion web/client/translations/data.it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@
"zoombuttons": {
"zoomInTooltip": "Aumenta Zoom",
"zoomOutTooltip": "Diminuisci Zoom",
"zoomAllTooltip": "Zoom Alla Massima Estensione"
"zoomAllTooltip": "Zoom Alla vista iniziale"
},
"fullscreen": {
"tooltipActivate": "Passa a schermo intero",
Expand Down

0 comments on commit 37343a1

Please sign in to comment.