Update example to show manual proj4js configuration

This commit is contained in:
Andreas Hocevar
2014-07-08 01:10:29 +02:00
parent b5bdd0d4bb
commit dfe92da58d

View File

@@ -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 = [