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

Be able to limit layers on raster service #4651

Merged
merged 1 commit into from Feb 18, 2019
Merged

Conversation

sbrunner
Copy link
Member

@sbrunner sbrunner commented Feb 18, 2019

With the option gmfContextualdataOptions:

{
    "rasterParams": {
        "layers": "srtm"
    }
}

Fix https://jira.camptocamp.com/browse/GSGMF-781

@sbrunner sbrunner added this to the 2.3 milestone Feb 18, 2019
@sbrunner sbrunner requested a review from fredj February 18, 2019 11:51
@@ -196,7 +199,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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.gmfRaster_.getRaster(coordinate, this.gmfContextualdataOptions.rasterParams || {}).then(
this.gmfRaster_.getRaster(coordinate, this.gmfContextualdataOptions.rasterParams).then(

The getRaster function can already accept undefined as param

@@ -139,6 +139,9 @@ exports.Controller_ = function($compile, $timeout, $scope, gmfRaster) {
*/
this.gmfRaster_ = gmfRaster;

this.gmfContextualdataOptions = $injector.has('gmfContextualdataOptions') ?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a @type and set it to @private

With the option `gmfContextualdataOptions`:

{
    'rasterParams': {
        'layers': 'srtm'
    }
}
@sbrunner sbrunner merged commit c076c31 into 2.3 Feb 18, 2019
@sbrunner sbrunner deleted the contextualdata-raster-layers branch February 18, 2019 12:23
@rbovard
Copy link
Contributor

rbovard commented Feb 27, 2019

Thanks @sbrunner, it's working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants