From d9e1fdf13c741fd17ace05f3fb019f6b0f366e22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Moullet?= Date: Mon, 11 Mar 2013 20:25:29 +0100 Subject: [PATCH] Change the way the projection is managed and use ol.projection.configureProj4jsProjection --- examples/wms-single-image-custom-proj.html | 2 ++ examples/wms-single-image-custom-proj.js | 7 ++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/wms-single-image-custom-proj.html b/examples/wms-single-image-custom-proj.html index 1e8215b094..c9e9048c6e 100644 --- a/examples/wms-single-image-custom-proj.html +++ b/examples/wms-single-image-custom-proj.html @@ -46,6 +46,8 @@ + + diff --git a/examples/wms-single-image-custom-proj.js b/examples/wms-single-image-custom-proj.js index 617b9c78b5..526834af11 100644 --- a/examples/wms-single-image-custom-proj.js +++ b/examples/wms-single-image-custom-proj.js @@ -11,13 +11,10 @@ goog.require('ol.projection'); goog.require('ol.source.SingleImageWMS'); -var epsg21781 = new ol.Projection({ +var projection = ol.projection.configureProj4jsProjection({ code: 'EPSG:21781', - units: ol.ProjectionUnits.METERS, - // Validity extent from http://spatialreference.org extent: new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864) }); -ol.projection.addProjection(epsg21781); var extent = new ol.Extent(420000, 30000, 900000, 350000); var layers = [ @@ -53,7 +50,7 @@ var map = new ol.Map({ renderers: ol.RendererHints.createFromQueryData(), target: 'map', view: new ol.View2D({ - projection: epsg21781, + projection: projection, center: new ol.Coordinate(660000, 190000), zoom: 2 })