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

setOpacity on RasterLayers #908

Closed
Saulzi opened this issue Jan 3, 2017 · 4 comments
Closed

setOpacity on RasterLayers #908

Saulzi opened this issue Jan 3, 2017 · 4 comments

Comments

@Saulzi
Copy link
Contributor

Saulzi commented Jan 3, 2017

  • Browser and version:

ie: NA

  • Version of Leaflet (L.version):

1.02

  • Version of esri Leaflet (L.esri.VERSION):

2.0.6

Steps to reproduce the error:

  1. Create a layer which inherits RasterLayer
  2. Immediatly set its opacity

What happens is A exception is raised because this._currentImage is null

I was expecting everything to be fine and dandy.

fix is to wrap this._currentImage in if statement.

@jgravois
Copy link
Contributor

jgravois commented Jan 3, 2017

99% sure this was fixed in #903.

@Saulzi
Copy link
Contributor Author

Saulzi commented Jan 3, 2017

Nope. basically issue is in rasterlayer.js

  setOpacity: function (opacity) {
    this.options.opacity = opacity;
    this._currentImage.setOpacity(opacity);
    return this;
  },

should be

  setOpacity: function (opacity) {
    this.options.opacity = opacity;
    if (this._currentImage)
    {
        this._currentImage.setOpacity(opacity);
     }
    return this;
  },

I will shortly have a pr with fix and test,

@jgravois
Copy link
Contributor

jgravois commented Jan 3, 2017

I will shortly have a pr with fix and test.

that would be fantastic. 🍪 thanks so much!

@jgravois
Copy link
Contributor

jgravois commented Jan 4, 2017

resolved by 1066630

@jgravois jgravois closed this as completed Jan 4, 2017
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

No branches or pull requests

2 participants