Skip to content

Commit

Permalink
Add missing contextual data on renovated interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 10, 2024
1 parent c251474 commit ebb26f6
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/desktop.html
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@
gmf-map-map="mainCtrl.map"
gmf-map-manage-resize="mainCtrl.manageResize"
gmf-map-resize-transition="mainCtrl.resizeTransition"
gmf-contextualdata=""
gmf-contextualdata-display="mainCtrl.contextualdataActive"
gmf-contextualdata-map="::mainCtrl.map"
>
</gmf-map>
<ngeo-query
Expand Down
15 changes: 15 additions & 0 deletions ui/src/interfaces/ControllerDesktop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import ngeoStreetviewModule from 'ngeo/streetview/module';
import ngeoRoutingModule from 'ngeo/routing/module';
import ngeoStatemanagerWfsPermalink from 'ngeo/statemanager/WfsPermalink';
import '../webcomponents/index';
import contextualDataHtmlTemplate from './contextualdata.html';

/**
* @private
Expand Down Expand Up @@ -76,6 +77,20 @@ const geomapfishModule = angular.module('Desktop', [
ngeoStatemanagerWfsPermalink.name,
]);

geomapfishModule.value('gmfContextualdatacontentTemplateUrl', 'gmf/contextualdata');
geomapfishModule.run(
/**
* @param {angular.ITemplateCacheService} $templateCache
*/
[
'$templateCache',
($templateCache) => {
// @ts-ignore: webpack
$templateCache.put('gmf/contextualdata', contextualDataHtmlTemplate);
},
],
);

geomapfishModule.controller('DesktopController', Controller);

export default geomapfishModule;
31 changes: 31 additions & 0 deletions ui/src/interfaces/contextualdata.html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export default `<table>
<tr>
<td translate>Swiss grid (LV95)</td>
<td>{{coord_2056|ngeoNumberCoordinates:0:'{x} / {y}'}}</td>
</tr>
<tr>
<td translate>Swiss grid (LV03)</td>
<td>{{coord_21781|ngeoNumberCoordinates:0:'{x} / {y}'}}</td>
</tr>
<tr>
<td translate>Wgs Coord.</td>
<td>{{coord_4326|ngeoNumberCoordinates:2:'{y} / {x}'}}</td>
</tr>
<tr>
<td translate>Wgs Coord. DMS</td>
<td>{{coord_4326|ngeoDMSCoordinates:0:'{y} {x}'}}</td>
</tr>
<tr>
<td translate>Elevation (SRTM)</td>
<td ng-if="srtm">{{srtm | number}} [m]</td>
</tr>
<tr>
<td translate>Elevation (Aster)</td>
<td ng-if="aster">{{aster | number}} [m]</td>
</tr>
</table>
<a
ng-href="https://maps.google.ch/?ie=UTF8&ll={{coord_4326_northern}},{{coord_4326_eastern}}&layer=c&cbll={{coord_4326_northern}},{{coord_4326_eastern}}&cbp=12,57.78,,0,8.1"
target="_blank"
>Google StreetView</a
>`;

0 comments on commit ebb26f6

Please sign in to comment.