|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>OpenLayers Google Layer Example</title> <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> <link rel="stylesheet" href="../theme/default/google.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" /> <!-- this gmaps key generated for http://openlayers.org/dev/ --> <script src='http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script> <script src="../lib/OpenLayers.js"></script> <script type="text/javascript"> var map; function init() { map = new OpenLayers.Map('map'); map.addControl(new OpenLayers.Control.LayerSwitcher()); var gphy = new OpenLayers.Layer.Google( "Google Physical", {type: G_PHYSICAL_MAP} ); var gmap = new OpenLayers.Layer.Google( "Google Streets", // the default {numZoomLevels: 20} ); var ghyb = new OpenLayers.Layer.Google( "Google Hybrid", {type: G_HYBRID_MAP, numZoomLevels: 20} ); var gsat = new OpenLayers.Layer.Google( "Google Satellite", {type: G_SATELLITE_MAP, numZoomLevels: 20} ); map.addLayers([gphy, gmap, ghyb, gsat]); map.setCenter(new OpenLayers.LonLat(10.2, 48.9), 5); } </script> </head> <body onload="init()"> <h1 id="title">Google Layer Example</h1> <div id="tags"></div> <p id="shortdesc"> Demonstrate use of the various types of Google layers. </p> <div id="map" class="smallmap"></div> <div id="docs"> <p> For best performance, you must be using a version of the Google Maps API which is v2.93 or higher. In order to use this version of the API, it is best to simply set your application to use the string "v=2" in the request, rather than tying your application to an explicit version.</p> <p> In order to position the Google attribution div in the default ocation, you must include the extra theme/default/google.css stylesheet.</p> </div> </body> </html> |