contribs/gmf/src/raster/component.js
function rasterComponent() {
  return {
    restrict: 'A',
    controller: 'GmfElevationController as ctrl',
    bindToController: true,
    scope: {
      'active': '<gmfElevationActive',
      'elevation': '=gmfElevationElevation',
      'layersconfig': '=gmfElevationLayersconfig',
      'loading': '=?gmfElevationLoading',
      'layer': '<gmfElevationLayer',
      'map': '=gmfElevationMap'
    },
    link: (scope, element, attr) => {
      const ctrl = scope['ctrl'];

      // Watch active or not.
      scope.$watch(() => ctrl.active, (active) => {
        ctrl.toggleActive_(active);
      });

      // Watch current layer.
      scope.$watch(() => ctrl.layer, (layer) => {
        ctrl.layer = layer;
        ctrl.elevation = null;
      });
    }
  };
}
function rasterComponent() {
  return {
    restrict: 'A',
    controller: 'GmfElevationController as ctrl',
    bindToController: true,
    scope: {
      'active': '<gmfElevationActive',
      'elevation': '=gmfElevationElevation',
      'layersconfig': '=gmfElevationLayersconfig',
      'loading': '=?gmfElevationLoading',
      'layer': '<gmfElevationLayer',
      'map': '=gmfElevationMap'
    },
    link: (scope, element, attr) => {
      const ctrl = scope['ctrl'];

      // Watch active or not.
      scope.$watch(() => ctrl.active, (active) => {
        ctrl.toggleActive_(active);
      });

      // Watch current layer.
      scope.$watch(() => ctrl.layer, (layer) => {
        ctrl.layer = layer;
        ctrl.elevation = null;
      });
    }
  };
}
function rasterComponent ( ) { return { restrict : 'A' , controller : 'GmfElevationController as ctrl' , bindToController : true , scope : { 'active' : '<gmfElevationActive' , 'elevation' : '=gmfElevationElevation' , 'layersconfig' : '=gmfElevationLayersconfig' , 'loading' : '=?gmfElevationLoading' , 'layer' : '<gmfElevationLayer' , 'map' : '=gmfElevationMap' } , link : ( scope , element , attr ) => { const ctrl = scope [ 'ctrl' ] ; // Watch active or not. scope . $watch ( ( ) => ctrl . active , ( active ) => { ctrl . toggleActive_ ( active ) ; } ) ; // Watch current layer. scope . $watch ( ( ) => ctrl . layer , ( layer ) => { ctrl . layer = layer ; ctrl . elevation = null ; } ) ; } } ; }
Provide a directive that set a value each 500ms with the elevation under the
mouse cursor position on the map. The value must come from the elevation
service of a c2cgeoportal server. The server's URL must be defined as
config value of the application.

Example:

<span gmf-elevation
gmf-elevation-active="elevationActive"
gmf-elevation-elevation="elevationValue"
gmf-elevation-layer="mainCtrl.elevationLayer"
gmf-elevation-layersconfig="::mainCtrl.elevationLayersConfig"
gmf-elevation-map="::mainCtrl.map">
{{elevationValue}}
</span>

For value in meter `elevationLayersConfig` can be an empty object, complex example:

elevationLayersConfig = {
'<layer>': {
'filter': 'ngeoUnitPrefix',
'args': ['m²', 'square'],
'postfix': '<notice>',
'separator': ''
}
};


@htmlAttribute {boolean} gmf-elevation-active A boolean to set active or
deactivate the component.
@htmlAttribute {number} gmf-elevation-elevation The value to set with the
elevation value.
@htmlAttribute {string} gmf-elevation-layer Elevation layer to use.
@htmlAttribute {Object.<string, LayerConfig>} gmf-elevation-layersconfig Elevation layer configurations.
@htmlAttribute {import("ol/Map.js").default} gmf-elevation-map The map.
@return {angular.IDirective} Directive Definition Object.
@ngdoc directive
@ngname gmfElevation
Provide a directive that set a value each 500ms with the elevation under the mouse cursor position on the map . The value must come from the elevation service of a c2cgeoportal server . The server s URL must be defined as config value of the application .