Changeset 8447 in genesis for nodes/nodemap.html
- Timestamp:
- Sep 13, 2010, 7:47:11 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/nodemap.html
r8307 r8447 112 112 //alert(OpenLayers.loadURL("./kmlfile.kml", "", null, parseKML)); 113 113 114 strategy = new OpenLayers.Strategy.Cluster(); 115 strategy.distance = 2; 116 strategy.threshold = 3; 117 114 118 // Hack to get around all kind of caching fails 115 119 var epoch = new Date().getTime(); 116 120 var kml = new OpenLayers.Layer.GML("KML", "./kmlfile.kml?time=" + epoch, 117 { format: OpenLayers.Format.KML, 121 { strategies: [strategy], 122 format: OpenLayers.Format.KML, 118 123 formatOptions: { 119 124 extractStyles: true, … … 242 247 function onKMLFeatureSelect(event) { 243 248 var feature = event.feature; 244 var content = "<h2>"+feature.attributes.name + "</h2>" + feature.attributes.description; 249 var content = ""; 250 if (feature.cluster) { 251 for (var i = 0; i < feature.cluster.length; i++) { 252 var node = feature.cluster[i]; 253 var content = content + "<h2>" + node.attributes.name + "</h2>" + node.attributes.description + "<br />"; 254 } 255 } else { 256 var content = "<h2>" + feature.attributes.name + "</h2>" + feature.attributes.description; 257 } 245 258 popup = new OpenLayers.Popup.FramedCloud("chicken", 246 259 feature.geometry.getBounds().getCenterLonLat(),
Note:
See TracChangeset
for help on using the changeset viewer.