aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio <silvio@socioambiental.org>2013-02-27 17:32:47 -0300
committerSilvio <silvio@socioambiental.org>2013-02-27 17:32:47 -0300
commit375a098c6d1deac4f2c7b1ee591e6aec1ed5d12b (patch)
treee8aabdf62c89176b2672dcfb73be9afd236bfa2a
parent30c2455c9f540f2e620d1bae5a26ea495e8848a1 (diff)
downloadgmap_arcgis-375a098c6d1deac4f2c7b1ee591e6aec1ed5d12b.tar.gz
gmap_arcgis-375a098c6d1deac4f2c7b1ee591e6aec1ed5d12b.tar.bz2
Now fully working with Google Maps v3
-rw-r--r--gmap_arcgis.js46
1 files changed, 16 insertions, 30 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js
index a63003d..a7da5a9 100644
--- a/gmap_arcgis.js
+++ b/gmap_arcgis.js
@@ -6,7 +6,7 @@
// Global variables
var map, mapExtension, gOverlays;
-// Setup custom GMap Overlays (layers and labels)
+// Setup custom GMap Overlays
function gmap_arcgis() {
/**
* Use a timer to make sure everything is loaded upon execution time.
@@ -38,7 +38,6 @@ function gmap_arcgis() {
gmapArcgisShowPolygons(Drupal.settings.gmap_arcgis.polygons);
}, 5);
- //setTimeout(unblockUI, 10000);
}
// Show all defined polygons
@@ -76,47 +75,34 @@ function showPolygon(polygon) {
}
});
+ blockUI();
polygon.overlay.setMap(map);
polygon.overlay.setOpacity(defaultOpacity);
- // TODO
- return;
- GEvent.addListener(polygon.overlay, "load", showPolygonCallback);
- GEvent.addListener(polygon.overlay, "update", function() { unblockUI(); });
-}
-
-// Callback for showPolygon
-function showPolygonCallback(mapservicelayer, error) {
- map.addOverlay(mapservicelayer);
- setTimeout(unblockUI, 6000);
-}
-
-// Add custom marker
-function createMarker(point, name, html, icone) {
- var icon = new GIcon();
- icon.image = icone;
- icon.shadow = "http://maps.google.com/mapfiles/ms/micons/msmarker.shadow.png";
- icon.iconSize = new GSize(20, 20);
- icon.shadowSize = new GSize(22, 20);
- icon.iconAnchor = new GPoint(6, 20);
- icon.infoWindowAnchor = new GPoint(5, 1);
-
- var marker = new GMarker(point);
- GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); });
- return marker;
+ google.maps.event.addListener(polygon.overlay.getMapService(), 'load', function() {
+ unblockUI();
+ });
}
+// UI unblocker wrapper
function unblockUI() {
$.unblockUI();
}
+// UI blocker wrapper
+function blockUI() {
+ $.blockUI();
+}
+
// Add map overlays
$(document).ready(function() {
google.setOnLoadCallback(gmap_arcgis);
$('#edit-lista-uc').change(function() {
- oelem = $("option:selected", this).val();
- marcador = Drupal.gmap.getMap('auto1map').vars.markers[oelem];
- GEvent.trigger(marcador.marker,"click");
+ // TODO: this is still needed?
+ //oelem = $("option:selected", this).val();
+ //marcador = Drupal.gmap.getMap('auto1map').vars.markers[oelem];
+ //GEvent.trigger(marcador.marker,"click");
+
$('#header').hide();
$('#nav').hide();
});