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 committed 2014-07-09 15:33:13 +02:00
1 parent 90c745006d
commit 0a01f8ef7e
4 files changed
+25 -47

No files matched your search

+3 -1
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 = [