Change the way the projection is managed and use ol.projection.configureProj4jsProjection
This commit is contained in:
@@ -11,13 +11,10 @@ goog.require('ol.projection');
|
||||
goog.require('ol.source.SingleImageWMS');
|
||||
|
||||
|
||||
var epsg21781 = new ol.Projection({
|
||||
var projection = ol.projection.configureProj4jsProjection({
|
||||
code: 'EPSG:21781',
|
||||
units: ol.ProjectionUnits.METERS,
|
||||
// Validity extent from http://spatialreference.org
|
||||
extent: new ol.Extent(485869.5728, 76443.1884, 837076.5648, 299941.7864)
|
||||
});
|
||||
ol.projection.addProjection(epsg21781);
|
||||
|
||||
var extent = new ol.Extent(420000, 30000, 900000, 350000);
|
||||
var layers = [
|
||||
@@ -53,7 +50,7 @@ var map = new ol.Map({
|
||||
renderers: ol.RendererHints.createFromQueryData(),
|
||||
target: 'map',
|
||||
view: new ol.View2D({
|
||||
projection: epsg21781,
|
||||
projection: projection,
|
||||
center: new ol.Coordinate(660000, 190000),
|
||||
zoom: 2
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user