Here is a small example of the JSON:
var geojson_format = new OpenLayers.Format.GeoJSON(); var vector_layer = new OpenLayers.Layer.Vector("query_POSTGIS"); var parsedJSON = JSON.parse(outputStr); alert(geojson_format.isValidType(parsedJSON, "FeatureCollection")); var geoJsonStr = geojson_format.read(parsedJSON, "FeatureCollection"); vector_layer.addFeatures(geoJsonStr);
This code works great until I get to the 100,000 character limit. Any suggestions on how to make this work with strings over 100,000 characters?
I was able to solve the issue. It appears that in .NET there is a limit to how long a string that is serialized can be and you must explicitly declare a maxJsonLength in your Web.config. I was able to solve the problem by adding the following to my Web.config: