aboutsummaryrefslogtreecommitdiff
path: root/gmap_arcgis.js
diff options
context:
space:
mode:
Diffstat (limited to 'gmap_arcgis.js')
-rw-r--r--gmap_arcgis.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index c9bf01d..810d04a 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -592,7 +592,7 @@ function gmapArcgis(config) {
},
// Show a polygon resulting from the given query
- showPolygonFromQuery: function(params, name) {
+ showPolygonFromQuery: function(params, name, count) {
var self = this;
var limit = null;
var layer = new gmaps.ags.Layer(params.uri);
@@ -646,7 +646,16 @@ function gmapArcgis(config) {
self.unblockUI(name);
if (name != undefined) {
- self.config['layers'][name] = params.overlay;
+ if (count != undefined) {
+ if (self.config['layers'][name].overlay == undefined) {
+ self.config['layers'][name].overlay = [];
+ }
+
+ self.config['layers'][name].overlay[count] = params.overlay;
+ }
+ else {
+ self.config['layers'][name].overlay = params.overlay;
+ }
}
else {
return params.overlay;
@@ -659,15 +668,6 @@ function gmapArcgis(config) {
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');
where = where.replace(/ /g, '+');
@@ -687,7 +687,7 @@ function gmapArcgis(config) {
success: function (response) {
if (response.features != undefined && response.features.length != '0') {
args.uri += '/' + layer;
- self.config['layers'][name].overlay[n] = self.showPolygonFromQuery(args, name + '-' + n);
+ self.showPolygonFromQuery(args, name, n);
}
}
});