Skip to content
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

LIDAR desktop example #443

Draft
wants to merge 1 commit into
base: prod-2-7-advance
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,47 @@ import gmfControllersAbstractDesktopController, {
AbstractDesktopController,
} from 'gmf/controllers/AbstractDesktopController';
import geomapfishBase from '../geomapfishmodule';
import ngeoMiscToolActivate from 'ngeo/misc/ToolActivate';
import panels from 'gmfapi/store/panels';

/**
* @private
*/
class Controller extends AbstractDesktopController {
constructor($scope, $injector) {
super($scope, $injector);

const $timeout = $injector.get('$timeout');

// Open the 'web-component' lidar panel
$scope.$watch(
() => this.drawLidarprofilePanelActive,
(newVal) => {
if (newVal) {
panels.openToolPanel('lidar');
} else {
panels.closeToolPanel();
}
}
);

// Make visible the footer
panels.getActiveFooterPanel().subscribe({
next: (panel) => {
this.lidarProfileFooterActive = panel === 'lidar';
$timeout(() => {}); // this triggered on DOM click, we call $timeout to force Angular diggest
},
});

/**
* @type {boolean}
*/
this.drawLidarprofilePanelActive = false;

const drawLidarprofilePanelActive = new ngeoMiscToolActivate(this, 'drawLidarprofilePanelActive');
this.ngeoToolActivateMgr.registerTool('mapTools', drawLidarprofilePanelActive, false);
}

/**
* @param {JQuery.Event} event keydown event.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<% } %>
<link href="<%= htmlWebpackPlugin.options.vars.entry_point %>static/<%= htmlWebpackPlugin.options.vars.cache_version %>/css/desktop.css" rel="stylesheet" crossorigin="anonymous">
</head>
<body ng-class="{'gmf-profile-chart-active': !!profileChartActive, 'gmf-query-grid-active': !!mainCtrl.queryGridActive}" ng-keydown="mainCtrl.onKeydown($event)" tabindex="0">
<body ng-class="{'gmf-profile-chart-active': !!profileChartActive, 'gmf-lidarprofile-chart-active': !!mainCtrl.lidarProfileFooterActive, 'gmf-query-grid-active': !!mainCtrl.queryGridActive}" ng-keydown="mainCtrl.onKeydown($event)" tabindex="0">
<div ng-show="mainCtrl.loading" class="loading-mask">
<i class="fa custom-spinner-loading fa-spin spinner-loading-mask">
<%=require('gmf/icons/spinner.svg?viewbox&height=1em')%>
Expand Down Expand Up @@ -82,6 +82,10 @@
data-toggle="tooltip" data-placement="left" data-original-title="{{'Profile'|translate}}">
<span class="fa fa-chart-area"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.drawLidarprofilePanelActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'LIDAR'|translate}}">
<span class="fa fa-chart-line"></span>
</button>
<button ngeo-btn class="btn btn-default" ng-model="mainCtrl.queryPanelActive"
data-toggle="tooltip" data-placement="left" data-original-title="{{'Selection'|translate}}">
<span>
Expand Down Expand Up @@ -219,6 +223,12 @@
</gmf-importdatasource>
</div>
</div>
<div ng-show="mainCtrl.drawLidarprofilePanelActive" class="row">
<div class="col-sm-12">
<a class="btn close gmf-close" ng-click="mainCtrl.drawLidarprofilePanelActive = false">&times;</a>
<gmf-lidar-panel></gmf-lidar-panel>
</div>
</div>
</div>
</div>
<div class="gmf-app-map-container" ng-class="{'gmf-app-infobar-active': mainCtrl.options.showInfobar}">
Expand Down Expand Up @@ -316,6 +326,7 @@
</ngeo-modal>
</main>
<footer>
<gmf-lidar-footer id="lidar-footer"></gmf-lidar-footer>
<gmf-profile
gmf-profile-active="profileChartActive"
gmf-profile-line="mainCtrl.profileLine"
Expand Down