Skip to content

Commit

Permalink
Be able to limit layers on raster service
Browse files Browse the repository at this point in the history
With the option `gmfContextualdataOptions`:

{
    'rasterParams': {
        'layers': 'srtm'
    }
}
  • Loading branch information
sbrunner committed Feb 18, 2019
1 parent bd9ef30 commit 1d64f4b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions contribs/gmf/src/contextualdata/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ exports.directive('gmfContextualdata',
* @ngdoc controller
* @ngInject
*/
exports.Controller_ = function($compile, $timeout, $scope, gmfRaster) {
exports.Controller_ = function($compile, $timeout, $scope, gmfRaster, $injector) {

/**
* @type {ol.Map}
Expand Down Expand Up @@ -139,6 +139,13 @@ exports.Controller_ = function($compile, $timeout, $scope, gmfRaster) {
*/
this.gmfRaster_ = gmfRaster;

/**
* @type {Object}
* @private
*/
this.gmfContextualdataOptions_ = $injector.has('gmfContextualdataOptions') ?
$injector.get('gmfContextualdataOptions') : {};

angular.element('body').on('mousedown', this.hidePopover.bind(this));
};

Expand Down Expand Up @@ -196,7 +203,7 @@ exports.Controller_.prototype.setContent_ = function(coordinate) {
const getRasterError = function(resp) {
console.error('Error on getting the raster.');
};
this.gmfRaster_.getRaster(coordinate).then(
this.gmfRaster_.getRaster(coordinate, this.gmfContextualdataOptions_.rasterParams).then(
getRasterSuccess,
getRasterError
);
Expand Down

0 comments on commit 1d64f4b

Please sign in to comment.