Changeset 8454 in genesis
- Timestamp:
- Sep 14, 2010, 8:12:26 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
nodes/nodemap.html
r8453 r8454 24 24 var max_opacity = 0.9; 25 25 var min_opacity = 0.1; 26 27 var nodeStatusImg = new Array(); 28 nodeStatusImg['up'] = 'http://www.google.com/mapfiles/kml/paddle/grn-stars-lv.png'; 29 nodeStatusImg['down'] = 'http://www.google.com/mapfiles/kml/paddle/red-stars-lv.png'; 30 nodeStatusImg['planned'] = 'http://www.google.com/mapfiles/kml/paddle/wht-stars-lv.png'; 31 nodeStatusImg['unknown'] = 'http://www.google.com/mapfiles/kml/paddle/wht-stars-lv.png'; 26 32 27 33 OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { … … 125 131 strategy.threshold = 2; 126 132 127 var symbolizer = OpenLayers.Util.applyDefaults( 128 {externalGraphic: "http://www.google.com/mapfiles/kml/paddle/grn-stars-lv.png", pointRadius: 8, fillOpacity: 1}, 129 OpenLayers.Feature.Vector.style["default"]); 133 //OpenLayers.Feature.Vector.style["default"]); 134 135 var symbolizer = new OpenLayers.Style({ 136 externalGraphic: "${icon}", 137 pointRadius: "${radius}", 138 fillOpacity: 1, 139 }, { context : { 140 icon : function(feature) { 141 var iconStatus = "DEADCODE" 142 if(feature.cluster) { 143 for (var i = 0; i < feature.cluster.length; i++) { 144 var nodeStatus = feature.cluster[i].attributes.styleUrl.split('_')[2]; 145 iconStatus = nodeStatus; 146 // If one if having issues, update the overview icon to reflect this 147 if (nodeStatus == 'unknown' || nodeStatus == 'planned' || nodeStatus == 'down') { break; } 148 } 149 } else { 150 iconStatus = feature.attributes.styleUrl.split('_')[2]; 151 } 152 return nodeStatusImg[iconStatus]; 153 }, 154 radius : function(feature) { 155 var pix = 8; 156 if(feature.cluster) { 157 pix = pix + feature.attributes.count; 158 for (var i = 0; i < feature.cluster.length; i++) { 159 var node = feature.cluster[i]; 160 // OpenLayers.Console.log(node.attributes.styleUrl); 161 } 162 } 163 return pix; 164 } 165 } 166 }); 167 130 168 var styleMap = new OpenLayers.StyleMap({"default": symbolizer, "select": {pointRadius: 16,fillOpacity: 1}}); 131 169 … … 266 304 for (var i = 0; i < feature.cluster.length; i++) { 267 305 var node = feature.cluster[i]; 268 var content = content + "<h2>" + node.attributes.name + "</h2>" + node.attributes.description + "<br />"; 306 iconStatus = node.attributes.styleUrl.split('_')[2]; 307 iconImg = nodeStatusImg[iconStatus]; 308 var content = content + "<h4><img src='" + iconImg + "' />" + node.attributes.name + "</h4>" + node.attributes.description + "<br />"; 269 309 } 270 310 } else {
Note:
See TracChangeset
for help on using the changeset viewer.