Update example to show manual proj4js configuration
This commit is contained in:
@@ -8,10 +8,15 @@ goog.require('ol.proj');
|
|||||||
goog.require('ol.source.TileWMS');
|
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',
|
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 extent = [420000, 30000, 900000, 350000];
|
||||||
var layers = [
|
var layers = [
|
||||||
|
|||||||
Reference in New Issue
Block a user