From dfe92da58deab884d0f41e1358924fcbbaea281a Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 8 Jul 2014 01:10:29 +0200 Subject: [PATCH] Update example to show manual proj4js configuration --- examples/wms-custom-proj.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/wms-custom-proj.js b/examples/wms-custom-proj.js index 39ba860d2b..8463e8c49a 100644 --- a/examples/wms-custom-proj.js +++ b/examples/wms-custom-proj.js @@ -8,10 +8,15 @@ goog.require('ol.proj'); goog.require('ol.source.TileWMS'); -var projection = ol.proj.configureProj4jsProjection({ +var proj4Proj = new proj4.Proj('EPSG:21781'); +var projection = ol.proj.addProjection({ code: 'EPSG:21781', - extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864] + extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864], + units: proj4Proj.units }); +// The transform is needed for the ScaleLine control. Otherwise this example +// would also work without proj4js. +ol.proj.addCoordinateTransforms('EPSG:4326', projection, proj4(proj4Proj)); var extent = [420000, 30000, 900000, 350000]; var layers = [