0

I'm trying to get informations from geoserver with AjaX jQuery of my spatial data at the clicked point using WMS GetFeatureInfo. But I have this ERROR :

http://localhost:8082/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd"> Invalid format 'text/javascript', supported formats are [text/plain, application/vnd.ogc.gml, text/xml, application/vnd.ogc.gml/3.1.1, text/xml; subtype=gml/3.1.1, text/html, application/json]

enter image description here

var clicked_coord;
var onSingleClick = function(evt){
    var coord = evt.coordinate;
    console.log(coord);
    var str = coord;
    var source1 = urldeep;
    var source2 = urlground;
    var layers_list = source1 + ',' + source2;
    var view = map.getView();
    var viewResolution = view.getResolution();
    url = groundwatertable.getSource().getGetFeatureInfoUrl(
        evt.coordinate, viewResolution,view.getProjection(),
        {
            'INFO_FORMAT': 'application/json',
            'FEATURE_COUNT': 20,
            'LAYERS': layers_list,
            'QUERY_LAYERS': layers_list
        });
    console.log(url);
    if (url) { //call parseResponse(data)
        clicked_coord = coord;
        $.ajax(url,
            {dataType: 'jsonp'}
        ).done(function (data) {
            });
    }
6
  • 1
    Presumably your code specifies 'INFO_FORMAT': 'text/javascript'? If you want a json response you should use 'INFO_FORMAT': 'application/json'
    – Mike
    Commented Aug 9, 2019 at 11:19
  • always the same error Commented Aug 9, 2019 at 11:36
  • Without seeing your code all help will be just guessing.
    – TomazicM
    Commented Aug 9, 2019 at 12:19
  • I just put it now Commented Aug 9, 2019 at 12:28
  • 1
    I need to activate jsonp in config of geoserver Commented Aug 9, 2019 at 12:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.