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

Type-related changes to ol.style.Image #2773

Merged
merged 4 commits into from
Sep 30, 2014
Merged

Type-related changes to ol.style.Image #2773

merged 4 commits into from
Sep 30, 2014

Conversation

elemoine
Copy link
Member

This PR includes a number of type-related changes to ol.style.Image, ol.style.Icon and ol.style.Circle.

  1. Mark ol.style.Image an @api annotation. This makes ol.style.Image exportable, making it possible to do imageStyle instanceof ol.style.Image in the application code.

  2. Mark ol.style.Image#getImage with an @api annotation. This makes this method show up in the ol-externs.js externs file, which is necessary for application code that looks like this:

    /**
    * @param {ol.style.Image} imageStyle Image style.
    */
    function function1(imageStyle) {
      var image = imageStyle.getImage();
      function2(image);
    }
    
    /**
    * @param {HTMLCanvasElement|HTMLVideoElement|Image} image Image element.
    */
    function function2(image) {
     
    }

    We have to have the signature of ol.style.Image#getImage in the externs file.

  3. Give ol.style.Circle#getImage and ol.style.Icon#getImage more specific return types.

Please review.

@gberaudo
Copy link
Member

Looks good.

@fredj
Copy link
Member

fredj commented Sep 30, 2014

LGTM

elemoine pushed a commit that referenced this pull request Sep 30, 2014
Type-related changes to ol.style.Image
@elemoine elemoine merged commit 6c7a6a7 into openlayers:master Sep 30, 2014
@elemoine elemoine deleted the getimage branch September 30, 2014 11:51
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