Transformed

This commit is contained in:
Tim Schaub
2017-12-11 16:29:33 -07:00
parent 1cdb6a66f0
commit 7f47883c48
737 changed files with 22216 additions and 21609 deletions

View File

@@ -1,11 +1,11 @@
goog.require('ol.Map');
goog.require('ol.View');
goog.require('ol.control');
goog.require('ol.control.ScaleLine');
goog.require('ol.layer.Tile');
goog.require('ol.proj');
goog.require('ol.proj.Projection');
goog.require('ol.source.TileWMS');
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_ScaleLine_ from '../src/ol/control/ScaleLine.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_proj_ from '../src/ol/proj.js';
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
import _ol_source_TileWMS_ from '../src/ol/source/TileWMS.js';
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
@@ -13,20 +13,20 @@ goog.require('ol.source.TileWMS');
// ol.proj.addProjection to make it available to the library for lookup by its
// code.
var projection = new ol.proj.Projection({
var projection = new _ol_proj_Projection_({
code: 'EPSG:21781',
// The extent is used to determine zoom level 0. Recommended values for a
// projection's validity extent can be found at https://epsg.io/.
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864],
units: 'm'
});
ol.proj.addProjection(projection);
_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,
_ol_proj_.addCoordinateTransforms('EPSG:4326', projection,
function(coordinate) {
return [
WGStoCHy(coordinate[1], coordinate[0]),
@@ -42,9 +42,9 @@ ol.proj.addCoordinateTransforms('EPSG:4326', projection,
var extent = [420000, 30000, 900000, 350000];
var layers = [
new ol.layer.Tile({
new _ol_layer_Tile_({
extent: extent,
source: new ol.source.TileWMS({
source: new _ol_source_TileWMS_({
url: 'https://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
@@ -56,9 +56,9 @@ var layers = [
serverType: 'mapserver'
})
}),
new ol.layer.Tile({
new _ol_layer_Tile_({
extent: extent,
source: new ol.source.TileWMS({
source: new _ol_source_TileWMS_({
url: 'https://wms.geo.admin.ch/',
crossOrigin: 'anonymous',
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
@@ -69,17 +69,17 @@ var layers = [
})
];
var map = new ol.Map({
controls: ol.control.defaults().extend([
new ol.control.ScaleLine({
var map = new _ol_Map_({
controls: _ol_control_.defaults().extend([
new _ol_control_ScaleLine_({
units: 'metric'
})
]),
layers: layers,
target: 'map',
view: new ol.View({
view: new _ol_View_({
projection: projection,
center: ol.proj.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781'),
center: _ol_proj_.transform([8.23, 46.86], 'EPSG:4326', 'EPSG:21781'),
extent: extent,
zoom: 2
})