forked from hslayers/hslayers-ng
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
executable file
·93 lines (86 loc) · 2.35 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
'use strict';
import 'toolbar.module';
import 'print.module';
import 'query.module';
import 'search.module';
import 'measure.module';
import 'permalink.module';
import 'info.module';
import 'datasource-selector.module';
import 'sidebar.module';
import 'add-layers.module';
import 'styles.module';
var module = angular.module('hs', [
'hs.sidebar',
'hs.toolbar',
'hs.layermanager',
'hs.map',
'hs.query',
'hs.search', 'hs.print', 'hs.permalink', 'hs.measure',
'hs.legend', 'hs.geolocation', 'hs.core',
'hs.datasource_selector',
'hs.save-map',
'hs.addLayers',
'gettext',
'hs.compositions',
'hs.info',
'hs.styles'
]);
module.directive('hs', ['config', 'Core', function (config, Core) {
return {
template: require('hslayers.html'),
link: function (scope, element, attrs) {
if (typeof config.sizeMode == 'undefined' || config.sizeMode == 'fullscreen')
Core.fullScreenMap(element);
}
};
}]);
import { Tile, Group, Image as ImageLayer } from 'ol/layer';
import VectorLayer from 'ol/layer/Vector';
import { Vector } from 'ol/source';
import { ImageWMS, ImageArcGISRest } from 'ol/source';
import { BingMaps, TileArcGISRest, TileWMS, WMTS, XYZ, OSM } from 'ol/source';
import { register } from 'ol/proj/proj4'
import * as proj from 'ol/proj';
import View from 'ol/View';
import { Polygon, LineString, GeometryType, Point } from 'ol/geom';
import Feature from 'ol/Feature';
import GeoJSON from 'ol/format/GeoJSON';
window.ol = {
layer: {
Tile,
Group,
Image: ImageLayer,
Vector: VectorLayer
},
source: {
OSM,
XYZ,
TileWMS,
Vector,
WMTS,
TileArcGISRest,
BingMaps,
ImageWMS,
ImageArcGISRest
},
format: {
GeoJSON
},
View,
proj
};
if (window.hslayersNgConfig) module.value('config', window.hslayersNgConfig(window.ol));
module.controller('Main', ['$scope', 'Core', 'config', 'hs.map.service',
function ($scope, Core, config, hsMap) {
$scope.Core = Core;
Core.singleDatasources = true;
let lastConfigBuster = config.buster;
setInterval(function () {
if (lastConfigBuster != config.buster) {
lastConfigBuster = config.buster;
hsMap.reset();
}
}, 100)
}
]);