Project

General

Profile

1
<html xmlns="http://www.w3.org/1999/xhtml">
2
  <head>
3
    <meta http-equiv="imagetoolbar" content="no"> <!--ie image gizmo OFF!-->
4
    <style type="text/css">
5
        #map {
6
            width: 800px;
7
            height: 400px;
8
            border: 1px solid black;
9
        }
10
    </style>
11
    <script src="../lib/OpenLayers.js"></script>
12
    <script type="text/javascript">
13
        <!--
14
        var map, layer;
15

    
16
        OpenLayers.ProxyHost = "/proxy/?url=";
17
        function init(){
18
            map = new OpenLayers.Map('map', {maxResolution:'auto'});
19
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
20
                "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
21
            map.addLayer(layer);
22
            map.setCenter(new OpenLayers.LonLat(0, 0), 0);
23
            map.addControl(new OpenLayers.Control.LayerSwitcher());
24
        }
25
        function addUrl() {
26
            var value = $('url').value;
27
            var parts = value.split("/");
28
                var newl = new OpenLayers.Layer.GeoRSS( parts[parts.length-1], value);
29
                map.addLayer(newl);
30
            $("url").value = "";
31
        }
32
        // -->
33
    </script>
34
  </head>
35
  <body onload="init()">
36
    <h1>GeoRSS in OpenLayers</h1>
37
    <p style="font-size:.9em;">This demo uses the OpenLayers GeoRSS parser, which supports GeoRSS Simple and W3C GeoRSS. Only points are currently supported. <a href="http://trac.openlayers.org/wiki/HowToDownload">Get the code!</a></p>
38
    <form onsubmit="return false;">
39
   GeoRSS URL: <input type="text" id="url" size="50" /><input type="submit" onclick="addUrl(); return false;" value="Load Feed" onsubmit="addUrl(); return false;" />
40
    </form>  
41
    <div id="map"></div>
42
  </body>
43
</html>
(10-10/35)