Ignore:
Timestamp:
Aug 28, 2011, 3:08:38 PM (13 years ago)
Author:
rick
Message:
  • Fixed the color and the URL locations references, to be more dynamic/logical.
  • Make the Organization do a catchall for the time beeing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/wlheatmap/static/heatmap.js

    r9594 r9596  
    6969  //map.addLayer(layerHeatmap);
    7070
    71   // create the layer styleMap by giving the default style a context
    72   var colors = ["red", "green", "blue"];
    73   var context = {
    74       getSize: function(feature) {
    75         var resolution = map.getResolution();
    76         var scale = map.getZoom();
    77         var base = 1;
    78         if (scale > 16) {
    79           base = 5;
    80         } else if (scale > 14) {
    81           base = 20;
    82         } else {
    83           base = 50;
    84         }
    85         return (base / map.getResolution());
    86       }
    87   };
    88   var template = {
    89       pointRadius: "${getSize}", // using context.getSize(feature)
    90       fillColor: "lightgreen", // using context.getColor(feature)
    91       strokeWidth: 0.5,
    92   };
    93   var style = new OpenLayers.Style(template, {context: context});
    94   var geojson = new OpenLayers.Layer.GML("GeoJSON", "feature/nodes.json", {
    95     projection: new OpenLayers.Projection("EPSG:4326"),
    96     styleMap: new OpenLayers.StyleMap(style),
    97     format: OpenLayers.Format.GeoJSON
    98       });
    99   map.addLayer(geojson);
    100 
     71  var nodesLayer = new OpenLayers.Layer.GML.NodesOverlay("Node Locations", "feature/nodes.json", {isBaseLayer: false, visibility: true});
     72  map.addLayer(nodesLayer);
    10173
    10274  var lonLat = new OpenLayers.LonLat(lon, lat).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject());
     
    11789  $("#default").append("<span id=\"" + layerHeatmap3.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + layerHeatmap3.colour + ")' /><input type=checkbox id=togglelayer checked/><font>" + layerHeatmap3.name + " </font><br /></span>");
    11890
     91  $("#features").append("<span id=\"" + nodesLayer.name + "\"><div id='layer_switcher_colour' style='background-color:rgb(" + nodesLayer.colour + ")' /><input type=checkbox id=togglelayer checked/><font>" + nodesLayer.name + " </font><br /></span>");
     92
    11993}
Note: See TracChangeset for help on using the changeset viewer.