From ccb12f8fa0b4d70a5a98c4adbb9eee55905c0f06 Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 18 Nov 2014 16:36:57 -0200 Subject: Add layer to config on showPolygonFromQuery / showPolygonFromQueryMultiple --- gmap_arcgis.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gmap_arcgis.js b/gmap_arcgis.js index da57403..1203e66 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -607,14 +607,21 @@ function gmapArcgis(config) { } self.unblockUI(name); - return params.overlay; + + if (name != undefined) { + this.config['layers'][name] = params.overlay; + } + else { + return params.overlay; + } }); }, // Show a polygon resulting from the given query in multiple layers showPolygonFromQueryMultiple: function (params, name, layers) { - var self = this; - var where = params.where; + var self = this; + var where = params.where; + var overlays = []; // Format where clause for ajax request where = where.replace(/=/g, '%3D'); @@ -635,12 +642,14 @@ function gmapArcgis(config) { success: function (response) { if (response.features != undefined && response.features.length != '0') { args.uri += '/' + layer; - self.showPolygonFromQuery(args, name); + overlays[n] = self.showPolygonFromQuery(args, name + '-' + n); } } }); })(layer, args); } + + return overlays; }, // Close all registered infoWindows -- cgit v1.2.3