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

Force update of wms.Source (request new image from WMS) #53

Open
apdevelop opened this issue Dec 12, 2017 · 0 comments
Open

Force update of wms.Source (request new image from WMS) #53

apdevelop opened this issue Dec 12, 2017 · 0 comments

Comments

@apdevelop
Copy link

apdevelop commented Dec 12, 2017

There are some cases when map view should be updated without user action (for example when object was deleted on server and client needs to refresh map view automatically).
My simple solution is adding forceUpdate() function to wms.Source class, which adds dummy timestamp parameter to list of WMS parameters, updates overlay and than removes parameter:

'forceUpdate': function () {
    if (this._overlay) {
        this._overlay.setParams({ '_t': ((new Date()).getTime()) });
        delete this._overlay.wmsParams['_t'];
    }
},

Is there any simpler and cleaner solution?

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

1 participant