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
| Proj4js.defs["EPSG:3857"] = "+proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +towgs84=0,0,0,0,0,0,0 +units=m +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);
var fromProjection = new OpenLayers.Projection("EPSG:4326"); // Transform from WGS 1984
var toProjection = new OpenLayers.Projection("EPSG:900913"); // to Spherical Mercator Projection
var position = new OpenLayers.LonLat(2.534904,48.387558).transform( fromProjection, toProjection);
var zoom = 18 ; |
Partager