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
|
<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="../../examples/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() {
var mapOptions = {
projection: "EPSG:900913",
displayProjection: new OpenLayers.Projection("EPSG:4326"), //Pour afficher les coord lat long
units: "m",
maxResolution: 156543.0339,
maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34, 20037508.34),
controls: [new OpenLayers.Control.LayerSwitcher()],
numZoomLevels: 20
};
map = new OpenLayers.Map('map', mapOptions);
var dummy = new OpenLayers.Layer(
"Dummy",
{isBaseLayer: true}
);
var gmap = new OpenLayers.Layer.Google(
"Google Streets", {sphericalMercator: true}
);
map.addLayers([dummy, gmap]);
map.setCenter(new OpenLayers.LonLat(-7712190.388467473, 6567469.498697457), 6);
}
</script>
</head>
<body onload="init()">
<h1 id="title">Google Layer Resize Issue</h1>
<div id="tags"></div>
<p id="shortdesc">
<ol>
<li>Click
<button onclick="var m = document.getElementById('map').style; m.height = '400px'; m.width = '800px'; map.updateSize(); return false;">Resize</button></li>
<li>Open the LayerSwitcher and switch to Google Streets</li>
<li>Confirm that the whole map area is populated with tiles</li>
</ol>
</p>
<div id="map" style="width: 200px; height: 200px"></div>
</body>
</html>
|