From 46cd97f12deb9786e97937a7b1f3a40a4f132264 Mon Sep 17 00:00:00 2001 From: silvio Date: Wed, 28 Oct 2009 16:46:15 -0200 Subject: Using 'for' instead of 'for each' --- gmap_arcgis.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 44d859b..79a1e50 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -12,10 +12,10 @@ function gmap_arcgis() { // Fallback setting var fallback = 'http://mapserver.fqdn/rest/services/app/MapServer'; var polygons = [ fallback ]; - var labels = [ fallback + '/2' ]; + var labels = [ fallback + '/1' ]; var fields = new Array(); var id = 'auto1map'; - var content; + var content, label; // Get data from Drupal if (Drupal.settings.gmap_arcgis !== undefined) { @@ -38,7 +38,8 @@ function gmap_arcgis() { map = Drupal.gmap.getMap(id).map; mapExtension = new esri.arcgis.gmaps.MapExtension(map); - for each (var label in labels) { + for (var i = 0; i < labels.length; i++) { + label = labels[i]; // Set default fallback values for labels fields = ["id", "name"]; content = 'Placeholder'; @@ -68,8 +69,8 @@ function gmap_arcgis() { showLabels(label[0], fields, content, icon); } - for each (var polygon in polygons) { - showPolygons(polygon); + for (var j = 0; j < polygons.length; j++) { + showPolygons(polygons[j]); } } -- cgit v1.2.3