Changeset 8447 in genesis


Ignore:
Timestamp:
Sep 13, 2010, 7:47:11 PM (14 years ago)
Author:
rick
Message:

Initial mockup for cluster based node display. Artwork and descriptions really need work.

Location:
nodes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • nodes/get-network-status.py

    r8342 r8447  
    1818
    1919# When force is used as argument, use this range
    20 DEFAULT_SCAN_RANGE= ['172.16.0.0/21']
     20DEFAULT_SCAN_RANGE= ['172.16.0.0/12']
    2121
    2222# Default node status output
  • nodes/nodemap.html

    r8307 r8447  
    112112        //alert(OpenLayers.loadURL("./kmlfile.kml", "", null, parseKML));
    113113
     114        strategy = new OpenLayers.Strategy.Cluster();
     115        strategy.distance = 2;
     116        strategy.threshold = 3;
     117
    114118        // Hack to get around all kind of caching fails
    115119        var epoch = new Date().getTime();
    116120        var kml = new OpenLayers.Layer.GML("KML", "./kmlfile.kml?time=" + epoch,
    117             { format: OpenLayers.Format.KML,
     121            { strategies: [strategy],
     122              format: OpenLayers.Format.KML,
    118123              formatOptions: {
    119124                extractStyles: true,
     
    242247      function onKMLFeatureSelect(event) {
    243248        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        }
    245258        popup = new OpenLayers.Popup.FramedCloud("chicken",
    246259                                 feature.geometry.getBounds().getCenterLonLat(),
Note: See TracChangeset for help on using the changeset viewer.