Add explanations to wms-custom-proj example
This commit is contained in:
committed by
Andreas Hocevar
parent
193adf4401
commit
7789bff3da
@@ -10,6 +10,10 @@ goog.require('ol.source.TileWMS');
|
||||
|
||||
|
||||
|
||||
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
|
||||
// So we create a projection instance for EPSG:21781 and pass it to
|
||||
// ol.proj.addProjection to make it available to the library.
|
||||
|
||||
var projection = new ol.proj.Projection({
|
||||
code: 'EPSG:21781',
|
||||
// The extent is used to determine zoom level 0. Recommended values for a
|
||||
@@ -18,6 +22,11 @@ var projection = new ol.proj.Projection({
|
||||
units: 'm'
|
||||
});
|
||||
ol.proj.addProjection(projection);
|
||||
|
||||
// We also declare EPSG:21781/EPSG:4326 transform functions. These functions
|
||||
// are necessary for the ScaleLine control and when calling ol.proj.transform
|
||||
// for setting the view's initial center (see below).
|
||||
|
||||
ol.proj.addCoordinateTransforms('EPSG:4326', projection,
|
||||
function(coordinate) {
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user