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

Add support for fill-pattern #83

Merged
merged 1 commit into from
May 22, 2018
Merged

Conversation

songyumeng
Copy link
Contributor

For #82

image

@ahocevar
Copy link
Member

Thanks! This will even look nicer with openlayers/openlayers#8210.

@ahocevar ahocevar merged commit 7b954f2 into openlayers:master May 22, 2018
@songyumeng
Copy link
Contributor Author

songyumeng commented May 22, 2018

It's cool.I found same problems about openlayers/openlayers#8210 .
I modify the ol.render.canvas.Replay.prototype.applyFill method in my project like this :

    ol.render.canvas.Replay.prototype.applyFill = function (state, geometry) {
        var fillStyle = state.fillStyle;
        var fillInstruction = [ol.render.canvas.Instruction.SET_FILL_STYLE, fillStyle];
        if (typeof fillStyle !== 'string') {
            var viewExtent = this.map.getView().getProjection().getExtent();
            fillInstruction.push([viewExtent[0], viewExtent[3]]);
        }
        this.instructions.push(fillInstruction);
    };

But this function must define after the ‘map‘ object is defined,and it is not a good solution.
Your PR for openlayers is very helpful to me.Thanks again.

@songyumeng songyumeng deleted the fill-pattern branch May 22, 2018 16:47
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.

2 participants