]> dev.renevier.net Git - syp.git/blob - openlayers/examples/google-reproject.html
initial commit
[syp.git] / openlayers / examples / google-reproject.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <title>OpenLayers Google with Overlay Example</title>
4     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5     <link rel="stylesheet" href="style.css" type="text/css" />
6     <!-- this gmaps key generated for http://openlayers.org/dev/ -->
7     <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>
8     <script src="../lib/OpenLayers.js"></script>
9     <script type="text/javascript">
10         var map;
11
12         function init(){
13             map = new OpenLayers.Map('map');
14
15             var satellite = new OpenLayers.Layer.Google(
16                 "Google Satellite" , {type: G_SATELLITE_MAP}
17             );
18
19             var wms = new OpenLayers.Layer.WMS(
20                 "World Map",
21                 "http://world.freemap.in/cgi-bin/mapserv",
22                 {
23                     map: '/www/freemap.in/world/map/factbooktrans.map',
24                     transparent: 'TRUE',
25                     layers: 'factbook'
26                 },
27                 {'reproject': true}
28             );
29
30             map.addLayers([satellite, wms]);
31
32             map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5);
33             map.addControl( new OpenLayers.Control.LayerSwitcher() );
34         }
35     </script>
36   </head>
37   <body onload="init()">
38     <h1 id="title">Google with Overlay Example</h1>
39
40     <div id="tags"></div>
41
42     <p id="shortdesc">
43         Demonstrate a Google basemap used with boundary overlay layer.
44     </p>
45
46     <div id="map" class="smallmap"></div>
47
48     <div id="docs">
49         An overlay in a Geographic projection can be stretched to somewhat
50         line up with Google tiles (in a Mercator projection).  Results get
51         worse farther from the equator.  Use the "reproject" option on a
52         layer to get this behavior.  Use the sphericalMercator option on
53         a Google layer to get proper overlays (with other layers in
54         Spherical Mercator).
55     </div>
56   </body>
57 </html>