Is it possible to use JSONP with the GetFeatureInfo request?
I'm using a GetFeatureInfo function in Leaflet that works fine with JSON data but I'm really struggling to replicate this with JSONP and get a CORS error. The server does have JSONP enabled.
I've have a function that fills a popup but below I'm just logging the data.
var wmsURL = 'http://maps.dartmoor.gov.uk/geoserver/wms?version=1.1.1&REQUEST=GetFeatureInfo&layers=general:tpo_points&BBOX='+BBOX+'&FEATURE_COUNT=5&outputFormat=text/javascript&HEIGHT='+HEIGHT+'&WIDTH='+WIDTH+'&query_layers=general:tpo_points&SRS=EPSG:4326&X='+X+'&Y='+Y+'&format_options=callback:getJson';
$.ajax({
url:wmsURL,
type: "GET",
datatype: "jsonp",
jsonpCallback: 'getJson',
contentType: 'application/json',
success: function (data) {console.log(data)}
});