Simplify ol.proj.addCoordinateTransforms

Equivalent projections do not need to be handled here, and the forward
and inverse functions can be function arguments instead of being nested
in an object literal.
This commit is contained in:
Andreas Hocevar
2014-07-09 13:11:57 +02:00
parent 90c745006d
commit 0a01f8ef7e
4 changed files with 25 additions and 47 deletions

View File

@@ -20,7 +20,9 @@ var projection = ol.proj.addProjection({
// Proj4js provides transform functions between its configured projections.
// The transform is needed for the ScaleLine control. Otherwise this example
// would also work without transform functions.
ol.proj.addCoordinateTransforms('EPSG:4326', projection, proj4('EPSG:21781'));
var transform = proj4('EPSG:21781');
ol.proj.addCoordinateTransforms('EPSG:4326', projection, transform.forward,
transform.inverse);
var extent = [420000, 30000, 900000, 350000];
var layers = [