changeset 194:6f6f109bb6ca

Text from Features in a Side-Info-Box
author fknauft
date Wed, 16 Feb 2011 16:15:57 +0100
parents e6a754b05ec8
children f1b76cc939f4
files gis_gui/blocks/layer.js
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gis_gui/blocks/layer.js	Wed Feb 16 15:07:19 2011 +0100
+++ b/gis_gui/blocks/layer.js	Wed Feb 16 16:15:57 2011 +0100
@@ -142,9 +142,20 @@
             console.debug("new google map=",map," on el=",le);
 
             //geocoder = new google.maps.Geocoder();
-            var newMarker=new google.maps.KmlLayer(kmlURL);
+            var newMarker=new google.maps.KmlLayer(kmlURL,{ suppressInfoWindows: true, map: map});
+            
+            google.maps.event.addListener(newMarker, 'click', function(kmlEvent) {
+            	var text = kmlEvent.featureData.description;
+                showInContentWindow(text);
+              });
+
+            function showInContentWindow(text) {
+                var sidediv = document.getElementById('mapping_info');
+                sidediv.innerHTML = text;
+              }
+
             console.debug("new marker layer=",newMarker);
-            newMarker.setMap(map);
+            //newMarker.setMap(map);
         }
     });