Question

I wrote this code:

function json()
{   
  var url="http://192.172.2.23:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=json&typeName=topp:networkcoverage&CQL_FILTER= topp:CELL_ID='410-07-301-31781' Or topp:CELL_ID='nnn'&callback=?";
  jQuery.getJSON(url,function(data){alert("Symbol: " + data.type + ", Price: " + data.bbox);
   });
}

And got an error in FF :

Error: invalid label
Source File: http://192.172.2.23:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=json&typeName=topp:networkcoverage&CQL_FILTER=%20topp:CELL_ID=%27410-07-301-31781%27%20Or%20topp:CELL_ID=%27nnn%27&callback=processJSON
Line: 1, Column: 1
Source Code:
{"type":"FeatureCollection","features":[{"type":"Feature","id":"networkcoverage.13333","geometry":{"type":"MultiPolygon","coordinates":[[[[33.67787000000004,73.02342000000004],[33.68024256600006,73.02193745600005],[33.68066767800008,73.02342000000004],[33.......

I was happy with XmlHttpRequest until I came across cross domain problem... I've tried all sorts of libraries, and its the same error with all JSON functions.


I thought there might be something wrong with the response but I put the response on this webs utility to check well formedness, and it was working fine on this URL http://openlayers.org/dev/examples/vector-formats.html

What am I missing here?

Was it helpful?

Solution

I'm a GeoServer developer and this looks like a probable bug to me. I suggest you make sure you're using the latest version in the release series you're using (that is, 1.7.6 or 2.0 RC1) and make sure this hasn't been fixed in those versions. If it hasn't, try and produce a minimal dataset that demonstrates this problem and attach it to a ticket on GeoServer's issue tracker (http://jira.codehaus.org/browse/GEOS/). Make sure to mention you're using jquery since GeoServer's test suite does not include any actual browser testing (even the testing that we do with OpenLayers is done by hand.)

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top