In OpenLayers/Format/JSON.js, it would be helpful to have another try/catch 
block.  Sometimes my incoming JSON is bad, and as the code stands now, it 
throws a .js error and fails.

Original:

    read: function(json, filter) {
        var object;
        if (this.nativeJSON) {
            object = JSON.parse(json, filter);
        } else try {
            /**
             * Parsing happens in three stages. In the first stage, we run the

Suggested change:

    read: function(json, filter) {
        var object;
        if (this.nativeJSON) {
            try {
               object = JSON.parse(json, filter);
            }
             catch(e) {
                 // Fall through if the parse fails.
             }
        } else try {
            /**
             * Parsing happens in three stages. In the first stage, we run the





Charlton Galvarino
1 (803) 233-6205 : voice
1 (803) 223-9579 :   fax
[email protected]

P.O. Box 50960
Columbia, SC 29250

_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to