OpenLayers OpenLayers

Changeset 5446

Show
Ignore:
Timestamp:
12/16/07 20:13:27 (1 year ago)
Author:
tschaub
Message:

merge r5290:HEAD from trunk

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/tschaub/geom/apidoc_config/Menu.txt

    r5290 r5446  
    169169      }  # Group: Marker 
    170170 
     171   File: Projection  (no auto-title, OpenLayers/Projection.js) 
     172 
    171173   Group: Popup  { 
    172174 
  • sandbox/tschaub/geom/doc/authors.txt

    r5290 r5446  
    1414Philip Lindsay 
    1515Corey Puffault 
     16Gregers Rygg 
    1617Tim Schaub 
    1718Christopher Schmidt 
  • sandbox/tschaub/geom/doc_config/Menu.txt

    r5290 r5446  
    169169      }  # Group: Marker 
    170170 
     171   File: Projection  (no auto-title, OpenLayers/Projection.js) 
     172 
    171173   Group: Popup  { 
    172174 
  • sandbox/tschaub/geom/examples/GMLParser.html

    r2978 r5446  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22  <head> 
     3    <title>OpenLayers GML Parser</title> 
    34    <style type="text/css"> 
    45        #map { 
     
    2223                html += "</ul>" 
    2324          } 
    24           document.body.innerHTML = html; 
     25          document.getElementById('output').innerHTML = html; 
    2526        } 
    2627        function load() { 
    2728            OpenLayers.loadURL("gml/owls.xml", "", null, parseData); 
    28         }    
     29        } 
    2930    </script> 
    3031  </head> 
    3132  <body onload="load()"> 
     33    <h1 id="title">GML Parser Example</h1> 
     34 
     35    <div id="tags"></div> 
     36 
     37    <p id="shortdesc"> 
     38        Demonstrate the operation of the GML parser. 
     39    </p> 
     40 
     41    <div id="output"></div> 
     42 
     43    <div id="docs"> 
     44        This script reads data from a GML file and parses out the coordinates, appending them to a HTML string with markup tags. 
     45        This markup is dumped to an element in the page. 
     46    </div> 
    3247  </body> 
    33 </html>   
     48</html> 
  • sandbox/tschaub/geom/examples/KMLParser.html

    r4322 r5446  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22  <head> 
    3     <style type="text/css"> 
    4         #map { 
    5             width: 800px; 
    6             height: 475px; 
    7             border: 1px solid black; 
    8         } 
    9     </style> 
     3    <title>OpenLayers KML Parser Example</title> 
    104    <script src="../lib/OpenLayers.js"></script> 
    115    <script type="text/javascript"> 
     
    2216                html += "</ul>" 
    2317          } 
    24           document.body.innerHTML = html; 
     18          document.getElementById('output').innerHTML = html; 
    2519        } 
    2620        function load() { 
    2721            OpenLayers.loadURL("kml/lines.kml", "", null, parseData); 
    28         }    
     22        } 
    2923    </script> 
    3024  </head> 
    3125  <body onload="load()"> 
     26    <h1 id="title">KML Parser Example</h1> 
     27 
     28    <div id="tags"></div> 
     29 
     30    <p id="shortdesc"> 
     31        Demonstrate the operation of the KML parser. 
     32    </p> 
     33 
     34    <div id="output"></div> 
     35 
     36    <div id="docs"> 
     37        This script reads data from a KML file and parses out the coordinates, appending them to a HTML string with markup tags. 
     38        This markup is dumped to an element in the page. 
     39    </div> 
    3240  </body> 
    33 </html>   
     41</html> 
  • sandbox/tschaub/geom/examples/accessible.html

    r4202 r5446  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    22    <head> 
     3        <title>OpenLayers Accessible Example</title> 
     4         
    35        <style type="text/css"> 
    46            #map { 
    57                width: 512px; 
    6                 height: 256px; 
     8                height: 512px; 
    79                border: 1px solid #eee; 
    810            } 
     
    2224                font-weight: normal; 
    2325                text-decoration: underline; 
    24             }             
     26            } 
    2527            a:hover { 
    2628                text-decoration: underline; 
    27             }          
     29            } 
     30            a.api { 
     31                font-size:1em; 
     32                text-decoration:underline; 
     33            } 
    2834        </style> 
    2935        <script src="../lib/OpenLayers.js"></script> 
     
    3642                map = new OpenLayers.Map('map', options); 
    3743                var wms = new OpenLayers.Layer.WMS( 
    38                     "OpenLayers WMS",  
     44                    "OpenLayers WMS", 
    3945                    "http://labs.metacarta.com/wms/vmap0?", 
    4046                    {layers: 'basic'} 
     
    4652    </head> 
    4753    <body onload="init()"> 
    48         <h3>OpenLayers Example</h3> 
     54        <h1 id="title">Accessible Example</h1> 
     55 
     56        <div id="tags"> 
     57        </div> 
     58 
     59        <p id="shortdesc"> 
     60            Demonstrate how to use the KeyboardDefaults option parameter for layer types. 
     61        </p> 
     62 
    4963        <table> 
    5064            <tbody> 
     
    96110            </tbody> 
    97111        </table> 
    98         <p>Navigate the map in one of three ways: 
    99             <ul> 
    100                 <li>Click on the named links to zoom and pan</li> 
    101                 <li>Use following keys to pan and zoom: 
    102                     <ul> 
    103                         <li>+ (zoom in)</li> 
    104                         <li>- (zoom out)</li> 
    105                         <li>up-arrow (pan north)</li> 
    106                         <li>down-arrow (pan south)</li> 
    107                         <li>left-arrow (pan east)</li> 
    108                         <li>right-arrow (pan west)</li> 
    109                     </ul> 
    110                 </li> 
    111                 <li>If access keys work for links in your browser, use: 
    112                     <ul> 
    113                         <li>i (zoom in)</li> 
    114                         <li>o (zoom out)</li> 
    115                         <li>n (pan north)</li> 
    116                         <li>s (pan south)</li> 
    117                         <li>e (pan east)</li> 
    118                         <li>w (pan west)</li> 
    119                     </ul> 
    120                 </li> 
    121             </ul> 
    122         </p> 
     112 
     113        <div id="docs"> 
     114            <p>Navigate the map in one of three ways: 
     115                <ul> 
     116                    <li>Click on the named links to zoom and pan</li> 
     117                    <li>Use following keys to pan and zoom: 
     118                        <ul> 
     119                            <li>+ (zoom in)</li> 
     120                            <li>- (zoom out)</li> 
     121                            <li>up-arrow (pan north)</li> 
     122                            <li>down-arrow (pan south)</li> 
     123                            <li>left-arrow (pan east)</li> 
     124                            <li>right-arrow (pan west)</li> 
     125                        </ul> 
     126                    </li> 
     127                    <li>If access keys work for links in your browser, use: 
     128                        <ul> 
     129                            <li>i (zoom in)</li> 
     130                            <li>o (zoom out)</li> 
     131                            <li>n (pan north)</li> 
     132                            <li>s (pan south)</li> 
     133                            <li>e (pan east)</li> 
     134                            <li>w (pan west)</li> 
     135                        </ul> 
     136                    </li> 
     137                </ul> 
     138            </p> 
     139 
     140            This is an example of using alternate methods to control panning and zooming.  This approach uses map.pan() and map.zoom().  You'll note that to pan, additional math is necessary along with map.size() in order to set the distance to pan. 
     141        </div> 
    123142    </body> 
    124143</html> 
  • sandbox/tschaub/geom/examples/attribution.html

    r5290 r5446  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    2   <head> 
    3     <style type="text/css"> 
    4         #map { 
    5             width: 512px; 
    6             height: 512px; 
    7             border: 1px solid black; 
    8         } 
    9     </style> 
    10     <script src="../lib/OpenLayers.js"></script> 
    11     <script type="text/javascript"> 
    12         var map;  
    13         function init(){ 
    14             map = new OpenLayers.Map('map'); 
    15              
    16             var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",  
    17                 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, 
    18                 {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'});  
     2    <head> 
     3        <title>OpenLayers Attribution Example</title> 
     4 
     5        <style type="text/css"> 
     6            #map { 
     7                width: 512px; 
     8                height: 512px; 
     9                border: 1px solid black; 
     10            } 
     11        </style> 
     12        <script src="../lib/OpenLayers.js"></script> 
     13        <script type="text/javascript"> 
     14            var map; 
     15            function init(){ 
     16                map = new OpenLayers.Map('map'); 
     17 
     18                var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
     19                    "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, 
     20                    {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'}); 
    1921 
    2022            var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", 
     
    2224                {layers: "landsat7"},{attribution:"Provided by Telascience"}); 
    2325 
    24             map.addLayers([ol_wms, jpl_wms]); 
    25             map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    26             map.addControl(new OpenLayers.Control.Attribution()); 
    27             // map.setCenter(new OpenLayers.LonLat(0, 0), 0); 
    28             map.zoomToMaxExtent(); 
    29         } 
    30     </script> 
    31   </head> 
    32   <body onload="init()"> 
    33     <h1>OpenLayers Example</h1> 
    34     <div id="map"></div> 
    35   </body> 
     26                map.addLayers([ol_wms, jpl_wms]); 
     27                map.addControl(new OpenLayers.Control.LayerSwitcher()); 
     28                map.addControl(new OpenLayers.Control.Attribution()); 
     29                // map.setCenter(new OpenLayers.LonLat(0, 0), 0); 
     30                map.zoomToMaxExtent(); 
     31            } 
     32        </script> 
     33    </head> 
     34    <body onload="init()"> 
     35        <h1 id="title">Attribution Example</h1> 
     36 
     37        <div id="tags"> 
     38        </div> 
     39 
     40        <p id="shortdesc"> 
     41          Shows the use of the attribution layer option on a number of layer types. 
     42        </p> 
     43 
     44        <div id="map"></div> 
     45 
     46        <div id="docs"> 
     47            This is an example of how to add an attribution block to the OpenLayers window.  In order to use an 
     48            attribution block, an attribution parameter must be set in each layer that requires attribution. In 
     49            addition, an attribution control must be added to the map. 
     50        </div> 
     51    </body> 
    3652</html> 
  • sandbox/tschaub/geom/examples/baseLayers.html

    r4222 r5446  
    11<html xmlns="http://www.w3.org/1999/xhtml"> 
    2   <head> 
    3     <style type="text/css"> 
    4         #map { 
    5             width: 100%; 
    6             height: 512px; 
    7             border: 1px solid black; 
    8             background-color: blue; 
    9         } 
    10     </style> 
     2    <head> 
     3        <title>OpenLayers Base Layers Example</title> 
     4         
     5        <style type="text/css"> 
     6            #map { 
     7                width: 512; 
     8                height: 512px; 
     9                border: 1px solid black; 
     10                background-color: blue; 
     11            } 
     12            #controls 
     13            { 
     14                width: 512px; 
     15            } 
     16        </style> 
    1117 
    12     <!-- this gmaps key generated for http://openlayers.org/dev/ --> 
    13     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script> 
    14     <!-- Localhost key --> 
    15     <!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>--> 
    16     <script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script> 
    17     <script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script> 
    18     <script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> 
    19     <script src="../lib/OpenLayers.js"></script> 
    20     <script type="text/javascript"> 
    21         var lon = 5; 
    22         var lat = 40; 
    23         var zoom = 5; 
    24         var map, markers; 
    25         var barcelona = new OpenLayers.LonLat(2.13134765625, 
    26                                               41.37062534198901); 
    27         var madrid = new OpenLayers.LonLat(-3.6968994140625, 
     18        <!-- this gmaps key generated for http://openlayers.org/dev/ --> 
     19        <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAA9XNhd8q0UdwNC7YSO4YZghSPUCi5aRYVveCcVYxzezM4iaj_gxQ9t-UajFL70jfcpquH5l1IJ-Zyyw'></script> 
     20        <!-- Localhost key --> 
     21        <!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>--> 
     22        <script type="text/javascript" src="http://clients.multimap.com/API/maps/1.1/metacarta_04"></script> 
     23        <script src='http://dev.virtualearth.net/mapcontrol/v3/mapcontrol.js'></script> 
     24        <script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script> 
     25        <script src="../lib/OpenLayers.js"></script> 
     26        <script type="text/javascript"> 
     27            var lon = 5; 
     28            var lat = 40; 
     29            var zoom = 5; 
     30            var map, markers; 
     31            var barcelona = new OpenLayers.LonLat(2.13134765625, 
     32                                                  41.37062534198901); 
     33            var madrid = new OpenLayers.LonLat(-3.6968994140625, 
    2834                                              40.428314208984375); 
    2935 
    30         function init(){ 
    31             map = new OpenLayers.Map( 'map' ); 
     36            function init(){ 
     37                map = new OpenLayers.Map( 'map' ); 
    3238 
    33             var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",  
    34                       "http://labs.metacarta.com/wms/vmap0",  
    35                       {layers: 'basic'} ); 
    36             var google = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP }); 
    37             var ve = new OpenLayers.Layer.VirtualEarth( "VE");  
    38             var yahoo = new OpenLayers.Layer.Yahoo( "Yahoo");  
    39             var mm = new OpenLayers.Layer.MultiMap( "MultiMap");  
    40              
     39                var wms = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
     40                          "http://labs.metacarta.com/wms/vmap0", 
     41                          {layers: 'basic'} ); 
     42                var google = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_MAP }); 
     43                var ve = new OpenLayers.Layer.VirtualEarth( "VE"); 
     44                var yahoo = new OpenLayers.Layer.Yahoo( "Yahoo"); 
     45                var mm = new OpenLayers.Layer.MultiMap( "MultiMap"); 
    4146 
    42             map.addLayers([wms, google, ve, yahoo, mm]); 
    4347 
    44             markers = new OpenLayers.Layer.Markers("markers"); 
    45             map.addLayer(markers); 
     48                map.addLayers([wms, google, ve, yahoo, mm]); 
    4649 
    47             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
    48             map.addControl( new OpenLayers.Control.LayerSwitcher() ); 
    49             map.addControl( new OpenLayers.Control.MousePosition() ); 
     50                markers = new OpenLayers.Layer.Markers("markers"); 
     51                map.addLayer(markers); 
    5052 
    51         } 
    52          
    53         function add() { 
    54             var url = 'http://boston.openguides.org/markers/AQUA.png'; 
    55             var sz = new OpenLayers.Size(10, 17); 
    56             var calculateOffset = function(size) { 
    57                                 return new OpenLayers.Pixel(-(size.w/2), -size.h); 
    58                              };            
    59             var icon = new OpenLayers.Icon(url, sz, null, calculateOffset); 
    60             marker = new OpenLayers.Marker(barcelona, icon); 
    61             markers.addMarker(marker); 
     53                map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
     54                map.addControl( new OpenLayers.Control.LayerSwitcher() ); 
     55                map.addControl( new OpenLayers.Control.MousePosition() ); 
    6256 
    63             marker = new OpenLayers.Marker(madrid, icon.clone()); 
    64             markers.addMarker(marker); 
     57            } 
    6558 
    66         } 
     59            function add() { 
     60                var url = 'http://boston.openguides.org/markers/AQUA.png'; 
     61                var sz = new OpenLayers.Size(10, 17); 
     62                var calculateOffset = function(size) { 
     63                                    return new OpenLayers.Pixel(-(size.w/2), -size.h); 
     64                                 }; 
     65                var icon = new OpenLayers.Icon(url, sz, null, calculateOffset); 
     66                marker = new OpenLayers.Marker(barcelona, icon); 
     67                markers.addMarker(marker); 
    6768 
    68         function remove() { 
    69             markers.removeMarker(marker); 
    70         } 
     69                marker = new OpenLayers.Marker(madrid, icon.clone()); 
     70                markers.addMarker(marker); 
    7171 
    72     </script> 
    73   </head> 
    74   <body onload="init()"> 
    75     <h1>OpenLayers With WMS, Google, VE Example</h1> 
    76     <div id="map"></div> 
    77     <div style="background-color:green" onclick="add()"> click to add a marker to the map</div> 
    78     <div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div> 
    79   </body> 
     72            } 
     73 
     74            function remove() { 
     75        &nb