Changeset 8453 in genesis


Ignore:
Timestamp:
Sep 14, 2010, 7:05:35 PM (14 years ago)
Author:
rick
Message:

Multiple stacked nodes are not readable/reachable by mouse. First attempt in
trying whether clustering is a good fit for this setup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nodes/nodemap.html

    r8447 r8453  
    1111  <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAKRiFs2kXKhTkKZkE_ms9rhTdBXm62xfhQU7Dk6ZBFSzYdmSteRQWjLqZhwX8afHvGpd4N3iKql6w8g" type="text/javascript"></script>
    1212
    13     <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
    14     <!-- <script src="http://openlayers.org/dev/OpenLayers.js"</script> -->
     13    <script src="../lib/Firebug/firebug.js"></script>
     14    <script src="http://openlayers.org/dev/OpenLayers.js"</script>
    1515
    1616    <script>
     
    112112        //alert(OpenLayers.loadURL("./kmlfile.kml", "", null, parseKML));
    113113
     114        function ignoreInterlink(cluster, feature) {
     115           if (feature.attributes.name.indexOf('Interlink') != -1) {
     116             return(false);
     117           } else {
     118             return strategy.shouldClusterOrig(cluster, feature); }
     119        };
     120
    114121        strategy = new OpenLayers.Strategy.Cluster();
    115         strategy.distance = 2;
    116         strategy.threshold = 3;
     122        strategy.shouldClusterOrig = strategy.shouldCluster;
     123        strategy.shouldCluster = ignoreInterlink;
     124        strategy.distance = 10;
     125        strategy.threshold = 2;
     126
     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"]);
     130        var styleMap = new OpenLayers.StyleMap({"default": symbolizer, "select": {pointRadius: 16,fillOpacity: 1}});
    117131
    118132        // Hack to get around all kind of caching fails
     
    120134        var kml = new OpenLayers.Layer.GML("KML", "./kmlfile.kml?time=" + epoch,
    121135            { strategies: [strategy],
     136              styleMap: styleMap,
    122137              format: OpenLayers.Format.KML,
    123138              formatOptions: {
Note: See TracChangeset for help on using the changeset viewer.