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
|
Proj4js.defs["EPSG:3857"] = "Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";
function init() {
map = new OpenLayers.Map("basicMap", {
projection: "EPSG:3857",
displayProjection: new OpenLayers.Projection("EPSG:4326")
});
var ghyb = new OpenLayers.Layer.Google( "Google Hybride",{type: google.maps.MapTypeId.HYBRID, numZoomLevels: 20} );
var options = {
name: "Cartes IGN",
url: "http://gpp3-wxs.ign.fr/xfwvg8nh6nsfww6mvoxu4lxa/wmts",
layer: "GEOGRAPHICALGRIDSYSTEMS.MAPS",
matrixSet: "PM",
style: "normal",
numZoomLevels: 20
};
var ign = new OpenLayers.Layer.WMTS(options);
// Construction carte open Steet Map
//var macarte = new OpenLayers.Layer.OSM(null,null, {opacity:0.5});
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new OpenLayers.Projection("EPSG:3857"); // to Spherical Mercator Projection
var position = new OpenLayers.LonLat(2.52974, 48.372752).transform( fromProjection, toProjection);
var zoom = 15 ; |
Partager