1 <html xmlns="http://www.w3.org/1999/xhtml">
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" />
11 <!-- this gmaps key generated for http://openlayers.org/dev/ -->
12 <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
13 <!-- Localhost key -->
14 <!-- <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTS6gjckBmeABOGXIUiOiZObZESPg'></script>-->
16 <script src="../lib/OpenLayers.js"></script>
17 <script type="text/javascript">
22 map = new OpenLayers.Map('map', {
24 new OpenLayers.Control.PanZoomBar(),
25 new OpenLayers.Control.LayerSwitcher({'ascending':false}),
26 new OpenLayers.Control.MousePosition(),
27 new OpenLayers.Control.Navigation()
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});
42 map.addLayers([GMapsHybr, GMapsStreets, GMapsSat, MarkersLayer2]);
45 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
46 if (!map.getCenter()) map.zoomToMaxExtent();
52 <body onload="init()">
53 <h3 id="title">Using maxResolution to control overlays</h3>
55 See how to control the maximum resolution for a markers layer,
56 causing it to not be displayed beyond a certain point.
58 <div id="map" class="smallmap"></div>