diff options
author | Silvio <silvio@socioambiental.org> | 2013-02-26 19:26:35 -0300 |
---|---|---|
committer | Silvio <silvio@socioambiental.org> | 2013-02-26 19:26:35 -0300 |
commit | ea6cce3937970cd5c22f04b823a6def0b1b78989 (patch) | |
tree | 6de04f0f0ea33f77ed0dbd985f413a9de4df0226 | |
parent | 33100218f0d922a4108295094599fddeca47bdc5 (diff) | |
download | gmap_arcgis-ea6cce3937970cd5c22f04b823a6def0b1b78989.tar.gz gmap_arcgis-ea6cce3937970cd5c22f04b823a6def0b1b78989.tar.bz2 |
Initial gmap3 implementation
-rw-r--r-- | gmap_arcgis.js | 11 | ||||
-rw-r--r-- | gmap_arcgis.module | 8 |
2 files changed, 10 insertions, 9 deletions
diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 0cfd0b8..d01a85c 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -1,7 +1,7 @@ // $Id$ // Load Google Maps API -google.load("maps", "2.x"); +//google.load("maps", "3"); // Global variables var map, mapExtension, gOverlays; @@ -33,10 +33,8 @@ function gmap_arcgis() { } // Get an existing GMap instance using Drupal GMap Module API - // and add an ArcGIS extension to it - map = Drupal.gmap.getMap(id).map; - mapExtension = new esri.arcgis.gmaps.MapExtension(map); - + map = Drupal.gmap.getMap(id).map; + for (var i = 0; i < labels.length; i++) { label = labels[i]; // Set default fallback values for labels @@ -68,6 +66,7 @@ function gmap_arcgis() { GEvent.addListener(map, "moveend", function() { showLabels(label[0], fields, content, icon); }); showLabels(label[0], fields, content, icon); } + return; gmapArcgisShowPolygons(Drupal.settings.gmap_arcgis.polygons); @@ -180,7 +179,7 @@ function unblockUI() { // Add map overlays $(document).ready(function() { - google.setOnLoadCallback(gmap_arcgis); + //google.setOnLoadCallback(gmap_arcgis); $('#edit-lista-uc').change(function() { oelem = $("option:selected", this).val(); marcador = Drupal.gmap.getMap('auto1map').vars.markers[oelem]; diff --git a/gmap_arcgis.module b/gmap_arcgis.module index 684029d..f69b0e2 100644 --- a/gmap_arcgis.module +++ b/gmap_arcgis.module @@ -26,6 +26,8 @@ function gmap_arcgis_gmap($op, &$map) { * a given map instance. */ if (isset($map['arcgis'])) { + global $base_url; + /** * Make sure that shapes js code are loaded. * @@ -43,12 +45,12 @@ function gmap_arcgis_gmap($op, &$map) { * The order to load the following js code is important. */ // Add Google js API - $key = variable_get('googlemap_api_key', ''); + $key = variable_get('gmap_api_key', ''); $script = '<script type="text/javascript" '; - drupal_set_html_head($script . 'src="http://www.google.com/jsapi?key=' . $key . '"></script>'); + drupal_set_html_head($script . 'src="http://www.google.com/jsapi?key=' . $key . '&sensor=true&language=pt-BR"></script>'); // Add ArcGIS js API - drupal_set_html_head($script . 'src="http://serverapi.arcgisonline.com/jsapi/gmaps/?v=1.6"></script>'); + drupal_set_html_head($script . 'src="'. $base_url .'/sites/all/libraries/google-maps-utility-library-v3/arcgislink/src/arcgislink_compiled.js"></script>'); // Setup Map Id drupal_add_js(array('gmap_arcgis' => array('id' => $map['id'])), 'setting'); |