scanning daemon and network status map, goal 1C
[freeside.git] / httemplate / search / elements / gmap.html
index 632a323..422e6df 100644 (file)
@@ -26,7 +26,7 @@ Generic Google Maps front end.
     }, # end of feature
   ],
   overlays => [
-    { url => 'https://localhost/freeside/view/sector_overlay-png.html?102',
+    { url => 'https://localhost/freeside/view/sector_map-png.html?102',
       west  => -130.0,
       east  => -128.0,
       south => 10.0,
@@ -85,7 +85,7 @@ var featureStyle = function(feature) {
 };
 
 var map;
-var overlays;
+var overlays = [];
 function initMap() {
   var canvas = $('#map_canvas');
   map = new google.maps.Map(canvas[0], { zoom: 6 });
@@ -117,8 +117,24 @@ function initMap() {
       // then pop up an info box with the feature content
       info.close();
       info.setPosition(feature.getGeometry().get());
-      info.setContent(feature.getProperty('content'));
-      info.open(map);
+
+      if ( feature.getProperty('content') ) {
+        info.setContent(feature.getProperty('content'));
+      } else {
+        info.setContent('');
+      }
+
+      if ( feature.getProperty('url') ) {
+        $.ajax({
+          url: feature.getProperty('url'),
+          success: function(data) {
+            info.setContent(data);
+          }
+        });
+        info.open(map);
+      } else {
+        info.open(map);
+      }
     }
 
     // snap to feature ROI if it has one
@@ -133,6 +149,7 @@ function initMap() {
     delete x.url;
     var overlay = new google.maps.GroundOverlay( url, x );
     overlay.setMap(map);
+    overlay.setOpacity(0.4);
     overlays.push(overlay); 
   });
 }