]> dev.renevier.net Git - syp.git/blob - openlayers/examples/kml-layer.html
forbird creation or deletion of item; forbids adding or deleting an image
[syp.git] / openlayers / examples / kml-layer.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
4     <link rel="stylesheet" href="style.css" type="text/css" />
5     <script src="../lib/OpenLayers.js"></script>
6     <script type="text/javascript">
7         var lon = 5;
8         var lat = 40;
9         var zoom = 5;
10         var map, layer;
11
12         function init(){
13             map = new OpenLayers.Map('map');
14             layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
15                     "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
16             map.addLayer(layer);
17             map.addLayer(new OpenLayers.Layer.GML("KML", "kml/lines.kml", 
18                {
19                 format: OpenLayers.Format.KML, 
20                 formatOptions: {
21                   extractStyles: true, 
22                   extractAttributes: true,
23                   maxDepth: 2
24                 }
25                }));
26             map.zoomToExtent(new OpenLayers.Bounds(-112.306698,36.017792,-112.03204,36.18087));
27         }
28     </script>
29   </head>
30   <body onload="init()">
31       <h1 id="title">KML Layer Example</h1>
32
33       <div id="tags"></div>
34
35       <p id="shortdesc">
36           Demonstrates loading and displaying a KML file on top of a basemap.
37     </p>
38
39     <div id="map" class="smallmap"></div>
40
41     <div id="docs"></div>
42   </body>
43 </html>