]> dev.renevier.net Git - syp.git/blob - openlayers/examples/custom-style.html
initial commit
[syp.git] / openlayers / examples / custom-style.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2     <head>
3         <title>Custom Style Example</title>
4         
5         <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
6         <link rel="stylesheet" href="style.css" type="text/css" />
7         <style type="text/css">
8             p {
9                 width: 500px;
10             }
11             div.olControlMousePosition {
12                 font-family: Verdana;
13                 font-size: 0.5em;
14                 color: red;
15             }
16         </style>
17         <script src="../lib/OpenLayers.js"></script>
18         <script type="text/javascript">
19             var lon = 5;
20             var lat = 40;
21             var zoom = 5;
22             var map, layer;
23
24             function init(){
25                 var options = {theme: null};
26                 map = new OpenLayers.Map('map', options);
27                 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
28                         "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
29
30                 map.addControl(new OpenLayers.Control.MousePosition());
31                 map.addLayer(layer);
32                 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
33             }
34         </script>
35     </head>
36     <body onload="init()">
37         <h1 id="title">Custom Style Example</h1>
38
39         <div id="tags">
40         </div>
41
42         <p id="shortdesc">
43             Demonstrate changing CSS styles on controls in the OpenLayers window.
44         </p>
45
46         <div id="map" class="smallmap"></div>
47
48         <div id="docs">
49            <p>If you care to modify the style of any OpenLayers element, include
50            the default stylesheet as a link and declare any style modifications
51            below that link.  These style declarations can be in other linked
52            stylesheets or in style tags.  In addition, construct your map with
53            options that include {theme: null}.  This will disable the default
54            method of loading the stylesheet and allow you to declare style rules
55            in your own linked stylesheets or style tags.</p>
56            <p>This example shows how to declare the font family, size, and color
57            for the mouse position.  Note that only the style keys that you want to
58            modify (change from the default) need to be specified.</p>
59         </div>
60     </body>
61 </html>