OpenLayers OpenLayers

Changeset 5762

Show
Ignore:
Timestamp:
01/15/08 16:13:43 (1 year ago)
Author:
ianmayo
Message:

start to include point-track items

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/ianmayo/branches/app2/index.html

    r5760 r5762  
    4040            "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} ); 
    4141 
    42          /*   ww = new OpenLayers.Layer.WorldWind( "Bathy", 
     42            ww = new OpenLayers.Layer.WorldWind( "Bathy", 
    4343            "http://worldwind25.arc.nasa.gov/tile/tile.aspx?", 36, 4, 
    4444            {T:"bmng.topo.bathy.200406"}); 
    4545            ww2 = new OpenLayers.Layer.WorldWind( "LANDSAT", 
    4646                "http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4, 
    47                 {T:"105"});*/ 
    48  
    49  
    50  
    51 //            map.addLayers([ol_wms, ww, ww2]); 
    52             map.addLayers([ol_wms]); 
     47                {T:"105"}); 
     48 
     49            map.addLayers([ol_wms, ww, ww2]); 
     50 
    5351            map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    5452            map.setCenter(new OpenLayers.LonLat(-71.4, 42.3), 6); 
    5553        } 
     54         
     55        function addUrl() { 
     56            var urlObj = OpenLayers.Util.getElement('url');  
     57            var value = urlObj.value; 
     58            var parts = value.split("/"); 
     59            rss = new OpenLayers.Layer.GeoRSS(parts[parts.length-1], value); 
     60            rss.events.register("loadend", window, populateMap); 
     61        } 
     62 
     63        function populateMap() { 
     64            // create the point track layer 
     65            var lineLayer = new OpenLayers.Layer.PointTrack(rss.name + " Track", 
     66                    {dataFrom: OpenLayers.Layer.PointTrack.dataFrom.SOURCE_NODE}); 
     67            // add the features from the rss layer to the track layer. This 
     68            // also works with OpenLayers.Feature.Vector features. 
     69            lineLayer.addNodes(rss.features); 
     70            map.addLayer(lineLayer); 
     71             
     72            rss.setName(rss.name + " Comments"); 
     73             
     74            var feature, marker; 
     75            // only show markers for features that are not "Untitled" 
     76            for (var i = 0; i< rss.features.length-1; i++) { 
     77                if (rss.features[i].data.popupContentHTML.indexOf( 
     78                        "Untitled") != -1) { 
     79                    // nullify lonlat to hide marker 
     80                    rss.markers[i].lonlat = null; 
     81                } 
     82            } 
     83            map.addLayer(rss); 
     84        }        
     85         
    5686    </script> 
    5787