OpenLayers OpenLayers

root/branches/openlayers/2.5/examples/custom-style.html

Revision 2978, 1.9 kB (checked in by sderle, 2 years ago)

propset svn:eol-style native recursively throughout trunk. enjoy\!

  • Property svn:eol-style set to native
Line 
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
4     <style type="text/css">
5         #map {
6             width: 500px;
7             height: 350px;
8             border: 1px solid gray;
9         }
10         p {
11             width: 500px;
12         }
13         div.olControlMousePosition {
14             font-family: Verdana;
15             font-size: 0.5em;
16             color: red;
17         }
18     </style>
19     <script src="../lib/OpenLayers.js"></script>
20     <script type="text/javascript">
21         <!--
22         var lon = 5;
23         var lat = 40;
24         var zoom = 5;
25         var map, layer;
26
27         function init(){
28             var options = {theme: null};
29             map = new OpenLayers.Map('map', options);
30             layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
31                     "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
32            
33             map.addControl(new OpenLayers.Control.MousePosition());
34             map.addLayer(layer);
35             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
36         }
37         // -->
38     </script>
39   </head>
40   <body onload="init()">
41     <div id="map"></div>
42     <p>If you care to modify the style of any OpenLayers element, include
43     the default stylesheet as a link and declare any style modifications
44     below that link.  These style declarations can be in other linked
45     stylesheets or in style tags.  In addition, construct your map with
46     options that include {theme: null}.  This will disable the default
47     method of loading the stylesheet and allow you to declare style rules
48     in your own linked stylesheets or style tags.</p>
49     <p>This example shows how to declare the font family, size, and color
50     for the mouse position.  Note that only the style keys that you want to
51     modify (change from the default) need to be specified.</p>
52   </body>
53 </html>
Note: See TracBrowser for help on using the browser.