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

Extending source to include extra info params #26

Open
mtravis opened this issue Sep 3, 2015 · 2 comments
Open

Extending source to include extra info params #26

mtravis opened this issue Sep 3, 2015 · 2 comments

Comments

@mtravis
Copy link

mtravis commented Sep 3, 2015

How could I add extra parameters to the getFeatureInfo request

var source = L.WMS.source(
"http://maps.nationalparks.gov.uk/geoserver/wms",
{
"format": "image/png",
"transparent": "true",
"identify": false
}
)

var planapps = source.getLayer('dartmoor:dnpa_planapps');
planapps.addTo(map);

L.WMS.Source.extend({
'getFeatureInfoParams': function(point,layers){
info_format': 'text/html',
feature_count: 10,
propertyName: 'appcode,url'
}
});

Great plugin by the way.

@Nicolasribot
Copy link

Hi, needed same as you and came with this solution:
https://github.com/Nicolasribot/leaflet.wms
It adds info_format, feature_count and exceptions as config options at the L.WMS.source level and handles GetFeatureInfo URL parameters based on these parameters.

@sheppard
Copy link
Member

I usually just add the parameters to the source - they get sent with every image request, but it usually doesn't hurt anything. It would certainly make sense to mark certain variables separately as in @Nicolasribot's fork, or add an extra info_params option that's mixed with the existing options in getFeatureInfoParams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants