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 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
<script type="text/javascript">
<!--
var map;
function loadMap() {
// avoid pink tiles
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 1;
OpenLayers.Util.onImageLoadErrorColor = "transparent";
var epsg4326= new OpenLayers.Projection("EPSG:4326");
var epsg3785= new OpenLayers.Projection("EPSG:3785");
map= new OpenLayers.Map('viewerDiv',
{
projection: epsg3785,
displayProjection: epsg4326,
units: epsg3785.getUnits(),
maxExtent: (new OpenLayers.Bounds(-180, -85.051128514, 180, 85.051128778))
.transform(epsg4326, epsg3785, true),
controls:[
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.NavToolbar(),
new OpenLayers.Control.LayerSwitcher({'ascending':false}),
new OpenLayers.Control.Scale(),
new OpenLayers.Control.MousePosition(),
new OpenLayers.Control.KeyboardDefaults(),
new Geoportal.Control.PermanentLogo() //Cf. CGU
]
});
var gmap = new OpenLayers.Layer.Google(
"Google Streets",
{
'sphericalMercator': true
}
);
var l0= new OpenLayers.Layer.WMS(
"Images ortho-rectifiées",
"http://localhost/cgi-bin/mapserver/mapserv",//FIXME: localhost only !
{
map: 'maps/geoportalfxx.map',
layers: 'ORTHOIMAGERY.ORTHOPHOTOS',
format:'image/jpeg',
exceptions:"text/xml"
},
{
singleTile: true,
isBaseLayer: false,
resolutions: [
32768.0000000,
16384.0000000,
8192.0000000,
4096.0000000,
2048.0000000,
1024.0000000,
512.0000000,
256.0000000,
128.0000000,
64.0000000,
32.0000000,
16.0000000,
8.0000000,
4.0000000,
2.0000000,
1.0000000,
0.5000000
],
projection: epsg3785,
units: epsg3785.getUnits(),
maxExtent: (new OpenLayers.Bounds(-180, -57, 180, 72))
.transform(epsg4326, epsg3785, true),
opacity:0.75
}
);
map.addLayers([gmap, l0]);
if (!map.getCenter()) {map.zoomToMaxExtent()}
}
-->
</script> |
Partager