OpenLayers OpenLayers

Changeset 6180

Show
Ignore:
Timestamp:
02/09/08 20:33:31 (10 months ago)
Author:
achipa
Message:

Time-aware layers
Read pubDate from GeoRSS
DateTime basetype to handle intervals
TimedPointTrack Layer class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/achipa/openlayers/lib/OpenLayers.js

    r5921 r6180  
    7979            "OpenLayers/BaseTypes/Pixel.js", 
    8080            "OpenLayers/BaseTypes/Size.js", 
     81            "OpenLayers/BaseTypes/DateTime.js", 
    8182            "OpenLayers/Console.js", 
    8283            "Rico/Corner.js", 
     
    173174            "OpenLayers/Layer/Vector.js", 
    174175            "OpenLayers/Layer/PointTrack.js", 
     176            "OpenLayers/Layer/TimedPointTrack.js", 
    175177            "OpenLayers/Layer/GML.js", 
    176178            "OpenLayers/Style.js", 
  • sandbox/achipa/openlayers/lib/OpenLayers/BaseTypes.js

    r5686 r6180  
    1010 * @requires OpenLayers/BaseTypes/Bounds.js 
    1111 * @requires OpenLayers/BaseTypes/Element.js 
     12 * @requires OpenLayers/BaseTypes/DateTime.js 
    1213 */ 
    1314 
  • sandbox/achipa/openlayers/lib/OpenLayers/Format/GeoRSS.js

    r5837 r6180  
    186186        ); 
    187187 
     188        var pubdate = this.getChildValue(item, "*", "pubDate"); 
     189 
    188190        /* If no link URL is found in the first child node, try the 
    189191           href attribute */ 
     
    202204            "title": title, 
    203205            "description": description, 
    204             "link": link 
     206            "link": link, 
     207        "pubdate": pubdate 
    205208        }; 
    206209        var feature = new OpenLayers.Feature.Vector(geometry, data); 
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer.js

    r5982 r6180  
    4242     * {Array(String)} Supported application event types 
    4343     */ 
    44     EVENT_TYPES: ["loadstart", "loadend", "loadcancel", "visibilitychanged"], 
     44    EVENT_TYPES: ["loadstart", "loadend", "loadcancel", "visibilitychanged", "datetimechanged"], 
    4545         
    4646    /** 
     
    171171    resolutions: null, 
    172172     
     173    /** 
     174     * APIProperty: datetimeIntervals 
     175     * {Array} A list of time Intervals which define the time periods in ascending 
     176     *     order.  If this is not set in the layer constructor, it will be set 
     177     *     based on other resolution related properties (maxExtent, 
     178     *     maxResolution, maxScale, etc.). 
     179     */ 
     180    datetimeIntervals: null, 
     181     
     182    /** 
     183     * APIProperty: currentDateTime 
     184     * {<OpenLayers.DateTime>} A moment or interval of time 
     185     */ 
     186    currentDateTime: null, 
     187 
    173188    /** 
    174189     * APIProperty: maxExtent 
     
    10181033    }, 
    10191034 
     1035    /** 
     1036     * Method: isTemporalLayer 
     1037     * {Boolean} Whether or not the layer's features change through time.  
     1038     *     
     1039     */ 
     1040    isTemporalLayer: function () { 
     1041    if (this.datetimeIntervals && this.datetimeIntervals.length > 0) 
     1042            return true; 
     1043    }, 
     1044  
     1045    /** 
     1046     * Method: setDateTime 
     1047     * {Date} or {<OpenLayers.DateTime>} Sets the current date/time in the layers 
     1048     *     
     1049     */ 
     1050    setDateTime: function (dt) { 
     1051        if (!this.isTemporalLayer()) 
     1052            return; 
     1053         
     1054        if (typeof dt == "OpenLayers.DateTime") 
     1055            this.currentDateTime = dt; 
     1056        else 
     1057            this.currentDateTime = new OpenLayers.DateTime(dt); 
     1058 
     1059        this.events.triggerEvent("datetimechanged"); 
     1060    }, 
     1061 
     1062    /** 
     1063     * Method: getStartDateTime 
     1064     * {Date} Returns the first date/time the layer is available for, null 
     1065     *     if the layer has no temporal conotation 
     1066     *     
     1067     */ 
     1068    getStartDateTime: function () { 
     1069    if (!this.isTemporalLayer()) 
     1070            return null; 
     1071 
     1072        if (this.datetimeIntervals.length < 1) 
     1073        return null; 
     1074 
     1075        return this.datetimeIntervals[0].from; 
     1076    }, 
     1077 
     1078    /** 
     1079     * Method: getStopDateTime 
     1080     * {Date} Returns the last date/time the layer is available for, null 
     1081     *     if the layer has no temporal conotation 
     1082     *     
     1083     */ 
     1084    getStopDateTime: function () { 
     1085    if (!this.isTemporalLayer()) 
     1086            return null; 
     1087 
     1088        if (this.datetimeIntervals.length < 1) 
     1089        return null; 
     1090 
     1091        return this.datetimeIntervals[datetimeIntervals.length -1].to; 
     1092    }, 
     1093 
    10201094    CLASS_NAME: "OpenLayers.Layer" 
    10211095}); 
  • sandbox/achipa/openlayers/lib/OpenLayers/Layer/GeoRSS.js

    r5828 r6180  
    190190                             new OpenLayers.Size(250, 120); 
    191191             
     192            data.pubdate = feature.attributes.pubdate; 
     193 
    192194            if (title || description) { 
    193195                var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';  
  • sandbox/achipa/openlayers/lib/OpenLayers/Renderer/SVG.js

    r5909 r6180  
    219219            } else { 
    220220                node.setAttributeNS(null, "r", style.pointRadius); 
     221                if (style.pointStyle == "pixel"){ 
     222                    node.setAttributeNS(null, "point", "pixel"); 
     223                } 
    221224            } 
    222225        }