diff options
author | Silvio <silvio@socioambiental.org> | 2014-12-01 19:17:02 -0200 |
---|---|---|
committer | Silvio <silvio@socioambiental.org> | 2014-12-01 19:17:02 -0200 |
commit | 8082f11b7dfaba417eb397895b2c1af3bfca420f (patch) | |
tree | c81decbdc4a66179423ff02f6f2dfefccdb5ba36 | |
parent | 2c1c7aad63d69d7402d723fe7633eb25937a8cce (diff) | |
download | gmap_arcgis_js-8082f11b7dfaba417eb397895b2c1af3bfca420f.tar.gz gmap_arcgis_js-8082f11b7dfaba417eb397895b2c1af3bfca420f.tar.bz2 |
Trying to make showPolygonFromQueryMultiple return overlays correctly
-rw-r--r-- | gmap_arcgis.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 49bb063..c9bf01d 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -656,9 +656,17 @@ function gmapArcgis(config) { // Show a polygon resulting from the given query in multiple layers showPolygonFromQueryMultiple: function (params, name, layers) { - var self = this; - var where = params.where; - var overlays = []; + var self = this; + var where = params.where; + + // Hold overlays + if (self.config['layers'][name] == undefined) { + self.config['layers'][name] = {}; + } + + if (self.config['layers'][name].overlay == undefined) { + self.config['layers'][name].overlay = []; + } // Format where clause for ajax request where = where.replace(/=/g, '%3D'); @@ -679,14 +687,12 @@ function gmapArcgis(config) { success: function (response) { if (response.features != undefined && response.features.length != '0') { args.uri += '/' + layer; - overlays[n] = self.showPolygonFromQuery(args, name + '-' + n); + self.config['layers'][name].overlay[n] = self.showPolygonFromQuery(args, name + '-' + n); } } }); })(layer, args); } - - return overlays; }, // Close all registered infoWindows |