I want to identify number of layers in to workspace in GeoServer for that I am using below REST API:
http://admin:geoserver@localhost:8080/geoserver/rest/workspaces/gisc/featuretypes.json?callback=?
My application is running on IIS so I am using JSONP. I have enabled JSONP in GeoServer but I can not get output, always getting error "**Uncaught SyntaxError: Unexpected token :"
I tried:
var url = "http://admin:geoserver@localhost:8080/geoserver/rest/workspaces/gisc/featuretypes.json?callback=?";
$.ajax({
type: 'GET',
url: url,
async: false,
jsonpCallback: 'parseResponse',
contentType: "application/json",
dataType: 'jsonp',
success: function(data)
{
console.log(data);
},
error: function (e)
{
console.log(e);
}
});
I have also tried another combination but it won't work I am always getting same error.
I have also tried to enable CORS in Jetty using "org\mortbay\servlets\CrossOriginFilter.class" it works with WMS and WFS but won't work with featuretypes.json.
No comments:
Post a Comment