[Mapbender-commits] r5272 - trunk/mapbender/http/javascripts
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Jan 5 10:43:24 EST 2010
Author: christoph
Date: 2010-01-05 10:43:24 -0500 (Tue, 05 Jan 2010)
New Revision: 5272
Modified:
trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
Log:
http://trac.osgeo.org/mapbender/ticket/581
Modified: trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php 2010-01-05 15:11:14 UTC (rev 5271)
+++ trunk/mapbender/http/javascripts/mod_wfs_gazetteer_client.php 2010-01-05 15:43:24 UTC (rev 5272)
@@ -1168,9 +1168,20 @@
}
}
}
- var geoObj = eval('(' + jsCode + ')');
- if (jsCode) {
- if (typeof(geoObj) == 'object') {
+ try {
+ var geoObj = parent.$.parseJSON(jsCode);
+ }
+ catch (exc) {
+ document.getElementById("res").innerHTML = '';
+ alert("Invalid data returned from service.");
+ return false;
+ }
+ if (typeof geoObj === "undefined") {
+ document.getElementById("res").innerHTML = '';
+ alert("Invalid data returned from service.");
+ }
+ else if (jsCode) {
+ if (typeof(geoObj) == 'object') {
geomArray.importGeoJSON(geoObj);
document.getElementById("res").innerHTML = '';
displayResult(geomArray);
More information about the Mapbender_commits
mailing list