]> dev.renevier.net Git - syp.git/blob - openlayers/examples/outOfRangeMarkers.html
move templates to a specific directory
[syp.git] / openlayers / examples / outOfRangeMarkers.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3     <title>Using maxResolution to control overlays</title>
4     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5     <link rel="stylesheet" href="style.css" type="text/css" />
6     <style>
7         #map {
8             height: 350px;
9         }
10     </style>
11       <!-- this gmaps key generated for http://openlayers.org/dev/ -->
12     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
13     <!-- Localhost key -->
14     <!-- <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
15   
16     <script src="../lib/OpenLayers.js"></script>
17     <script type="text/javascript">
18         var map;
19         function init(){
20             
21             // Variables
22             map = new OpenLayers.Map('map', {
23                 controls: [
24                     new OpenLayers.Control.PanZoomBar(),
25                     new OpenLayers.Control.LayerSwitcher({'ascending':false}),
26                     new OpenLayers.Control.MousePosition(),
27                     new OpenLayers.Control.Navigation()
28                 ]
29             });
30             var lon = 35;
31             var lat = -6;
32             var zoom = 6;
33
34
35             // Map Layers
36             var GMapsSat = new OpenLayers.Layer.Google( "Google Satellite" , {type: G_SATELLITE_MAP, 'maxZoomLevel':18} );
37             var GMapsHybr = new OpenLayers.Layer.Google( "Google Hybrid" , {type: G_HYBRID_TYPE, 'maxZoomLevel':18} );
38             var GMapsStreets = new OpenLayers.Layer.Google( "Google Steets" , {type: G_NORMAL_MAP, 'maxZoomLevel':18} );
39             var MarkersLayer2 = new OpenLayers.Layer.Text( "Region info", {location: "outOfRangeMarkers.txt", maxResolution: 0.02});
40
41             // Add Layers
42             map.addLayers([GMapsHybr, GMapsStreets, GMapsSat, MarkersLayer2]);            
43
44             // Visual
45             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
46             if (!map.getCenter()) map.zoomToMaxExtent();
47         }
48     </script>
49  </head>
50
51
52  <body onload="init()">
53     <h3 id="title">Using maxResolution to control overlays</h3>
54     <p id="shortdesc">
55       See how to control the maximum resolution for a markers layer, 
56       causing it to not be displayed beyond a certain point.
57     </p>  
58     <div id="map" class="smallmap"></div>
59
60   </body>
61 </html>