aboutsummaryrefslogtreecommitdiff
path: root/gmap_arcgis.js
diff options
context:
space:
mode:
Diffstat (limited to 'gmap_arcgis.js')
-rw-r--r--gmap_arcgis.js28
1 files changed, 16 insertions, 12 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index ededb2d..b1b2cff 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -477,21 +477,25 @@ function gmapArcgis(config) {
layer.query(query, function(fset) {
var fs = fset.features;
- var feature = fs[0];
- params.overlay = feature.geometry[0];
+ params.overlay = [];
- // Fit map to polygon bounds
- if (params.fitBounds != undefined && params.fitBounds == true) {
- var bounds = params.overlay.getBounds();
- var zoom = self.getZoomByBounds(bounds);
- var center = bounds.getCenter();
+ for (i in fs) {
+ var feature = fs[i];
+ params.overlay[i] = feature.geometry[0];
- self.map.setZoom(zoom);
- self.map.setCenter(center);
- }
+ // Fit map to polygon bounds
+ if (params.fitBounds != undefined && params.fitBounds == true) {
+ var bounds = params.overlay[i].getBounds();
+ var zoom = self.getZoomByBounds(bounds);
+ var center = bounds.getCenter();
+
+ self.map.setZoom(zoom);
+ self.map.setCenter(center);
+ }
- // Show polygon
- params.overlay.setMap(self.map);
+ // Show polygon
+ params.overlay[i].setMap(self.map);
+ }
return params.overlay;
});