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

GetFeatureInfo Url #49

Open
KroniK907 opened this issue Aug 10, 2017 · 2 comments
Open

GetFeatureInfo Url #49

KroniK907 opened this issue Aug 10, 2017 · 2 comments

Comments

@KroniK907
Copy link

So In my setup I have a GeoServer setup to provide WMS.

When I provide my source I generally want to source the cached tiles using the GeoWebCache url for GeoServer (eg. http://myserver.com/geoserver/gwc/service/wms)

However, GeoServer does not provide GetFeatureInfo capability at that url. Instead you have to use the standard wms url (which is not cached).

So could we add a parameter to the GetFeatureInfo to provide an optional url which the GetFeatureInfo would use rather than the base source url?

Thanks.

@mooman
Copy link

mooman commented Sep 5, 2017

I think this would be useful as well, have you found a solution to this yet, @KroniK907?

@apdevelop
Copy link

It could be achieved using custom implementation of getFeatureInfo function:

    L.WMS.Source.MySource = L.WMS.Source.extend({
        'getFeatureInfo': function (point, latlng, layers, callback) {
            // It can be passed somehow, using options object, for example
            var getFeatureInfoUrl = 'http://....';
            var params = this.getFeatureInfoParams(point, layers),
                url = getFeatureInfoUrl + L.Util.getParamString(params, getFeatureInfoUrl);

            this.showWaiting();
            this.ajax(url, done);

            function done(result) {
                this.hideWaiting();
                var text = this.parseFeatureInfo(result, url);
                callback.call(this, latlng, text);
            }
        }
    });

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

3 participants