Transformed
This commit is contained in:
@@ -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.Image');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.source.ImageWMS');
|
||||
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_Image_ from '../src/ol/layer/Image.js';
|
||||
import _ol_proj_ from '../src/ol/proj.js';
|
||||
import _ol_proj_Projection_ from '../src/ol/proj/Projection.js';
|
||||
import _ol_source_ImageWMS_ from '../src/ol/source/ImageWMS.js';
|
||||
|
||||
|
||||
// Transparent Proj4js support:
|
||||
@@ -23,16 +23,16 @@ goog.require('ol.source.ImageWMS');
|
||||
// create an ol.proj.Projection instance. ol.proj.get() will take care of it
|
||||
// internally.
|
||||
|
||||
var projection = new ol.proj.Projection({
|
||||
var projection = new _ol_proj_Projection_({
|
||||
code: 'EPSG:21781',
|
||||
extent: [485869.5728, 76443.1884, 837076.5648, 299941.7864]
|
||||
});
|
||||
|
||||
var extent = [420000, 30000, 900000, 350000];
|
||||
var layers = [
|
||||
new ol.layer.Image({
|
||||
new _ol_layer_Image_({
|
||||
extent: extent,
|
||||
source: new ol.source.ImageWMS({
|
||||
source: new _ol_source_ImageWMS_({
|
||||
url: 'https://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
@@ -44,9 +44,9 @@ var layers = [
|
||||
serverType: 'mapserver'
|
||||
})
|
||||
}),
|
||||
new ol.layer.Image({
|
||||
new _ol_layer_Image_({
|
||||
extent: extent,
|
||||
source: new ol.source.ImageWMS({
|
||||
source: new _ol_source_ImageWMS_({
|
||||
url: 'https://wms.geo.admin.ch/',
|
||||
crossOrigin: 'anonymous',
|
||||
attributions: '© <a href="http://www.geo.admin.ch/internet/geoportal/' +
|
||||
@@ -57,15 +57,15 @@ 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_()
|
||||
]),
|
||||
layers: layers,
|
||||
target: 'map',
|
||||
view: new ol.View({
|
||||
view: new _ol_View_({
|
||||
projection: projection,
|
||||
center: ol.proj.fromLonLat([8.23, 46.86], projection),
|
||||
center: _ol_proj_.fromLonLat([8.23, 46.86], projection),
|
||||
extent: extent,
|
||||
zoom: 2
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user