Skip to content
Permalink
Browse files

Upgrade to openlayers 5

fixes #163
  • Loading branch information...
raitisbe committed Jun 5, 2019
1 parent 82c05e4 commit d6ec6d28e24a887bba63432cb7895d0f571812c9
34 app.js
@@ -1,6 +1,5 @@
'use strict';

import ol from 'ol';
import toolbar from 'toolbar';
import print from 'print';
import query from 'query';
@@ -39,7 +38,38 @@ module.directive('hs', ['config', 'Core', function (config, Core) {
}]);

if (window.hslayersNgConfig) module.value('config', Object.assign({}, window.hslayersNgConfig(ol)));
window.ol = ol;

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';


window.ol = {
layer: {
Tile,
Group,
Image: ImageLayer,
Vector: VectorLayer
},
source: {
OSM,
XYZ,
TileWMS,
Vector,
WMTS,
TileArcGISRest,
BingMaps,
ImageWMS,
ImageArcGISRest
},
View,
proj
};

module.controller('Main', ['$scope', 'Core', 'hs.ows.wms.service_layer_producer', 'hs.compositions.service_parser', 'config',
function ($scope, Core, srv_producer, composition_parser, config) {
@@ -1,97 +1,94 @@
if(window.require && window.require.config) window.require.config({
paths: {
'hs.compositions.service_parser': hsl_path + 'components/compositions/hs.compositions.service_parser' + hslMin,
'hs.compositions.service': hsl_path + 'components/compositions/hs.compositions.service' + hslMin,
'hs.compositions.controller': hsl_path + 'components/compositions/hs.compositions.controller' + hslMin
}
})
import hsCompositionsService from 'hs.compositions.service';
import hsCompositionsServiceParser from 'hs.compositions.service_parser';
import hsCompositionsController from 'hs.compositions.controller';
import SparqlJson from 'hs.source.SparqlJson'
import 'utils';
import 'ows_nonwms';
import social from 'angular-socialshare'
import 'config_parsers';

/**
* @ngdoc module
* @module hs.compositions
* @name hs.compositions
* @description Test composition module
*/
define(['angular', 'ol', 'hs.source.SparqlJson', 'angular-socialshare', 'hs.compositions.service', 'hs.compositions.service_parser', 'hs.compositions.controller', 'map', 'ows_nonwms', 'config_parsers'],

function (angular, ol, SparqlJson, social, hsCompositionsService, hsCompositionsServiceParser, hsCompositionsController) {
var module = angular.module('hs.compositions', ['720kb.socialshare', 'hs.map', 'hs.core', 'hs.ows.nonwms', 'hs.compositions.config_parsers'])
.directive('hs.compositions.directive', ['config', function (config) {
return {
template: require('components/compositions/partials/compositions.html'),
link: function (scope, element) {
if(angular.isUndefined(config.design) || config.design == ''){
var el = document.getElementsByClassName('mid-pane');
if(el.length > 0){
el[0].style.marginTop = '0px';
}
var el = document.getElementsByClassName('keywords-panel');
if(el.length > 0){
el[0].style.display = 'none';
}
}
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.overwriteDialogDirective
* @ngdoc directive
* @description Display dialog window for situation, when new composition is to be loaded while there are unsaved changes in old composition
*/
.directive('hs.compositions.overwriteDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_overwriteconfirm.html'),
link: function (scope, element, attrs) {
scope.overwriteModalVisible = true;
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.deleteDialogDirective
* @ngdoc directive
* @description Display dialog window for confiriming deletion of selected composition
*/
.directive('hs.compositions.deleteDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_delete.html'),
link: function (scope, element, attrs) {
scope.deleteModalVisible = true;
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.shareDialogDirective
* @ngdoc directive
* @description Display dialog of sharing composition (URL / Social networks)
*/
.directive('hs.compositions.shareDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_share.html'),
link: function (scope, element, attrs) {
scope.shareModalVisible = true;
var module = angular.module('hs.compositions', ['720kb.socialshare', 'hs.map', 'hs.core', 'hs.ows.nonwms', 'hs.compositions.config_parsers'])
.directive('hs.compositions.directive', ['config', function (config) {
return {
template: require('components/compositions/partials/compositions.html'),
link: function (scope, element) {
if (angular.isUndefined(config.design) || config.design == '') {
var el = document.getElementsByClassName('mid-pane');
if (el.length > 0) {
el[0].style.marginTop = '0px';
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.infoDialogDirective
* @ngdoc directive
* @description Display dialog of composition info (name, abstract, thumbnail, extent, layers)
*/
.directive('hs.compositions.infoDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_info.html'),
link: function (scope, element, attrs) {
scope.infoModalVisible = true;
var el = document.getElementsByClassName('keywords-panel');
if (el.length > 0) {
el[0].style.display = 'none';
}
};
}])
}
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.overwriteDialogDirective
* @ngdoc directive
* @description Display dialog window for situation, when new composition is to be loaded while there are unsaved changes in old composition
*/
.directive('hs.compositions.overwriteDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_overwriteconfirm.html'),
link: function (scope, element, attrs) {
scope.overwriteModalVisible = true;
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.deleteDialogDirective
* @ngdoc directive
* @description Display dialog window for confiriming deletion of selected composition
*/
.directive('hs.compositions.deleteDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_delete.html'),
link: function (scope, element, attrs) {
scope.deleteModalVisible = true;
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.shareDialogDirective
* @ngdoc directive
* @description Display dialog of sharing composition (URL / Social networks)
*/
.directive('hs.compositions.shareDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_share.html'),
link: function (scope, element, attrs) {
scope.shareModalVisible = true;
}
};
}])
/**
* @module hs.compositions
* @name hs.compositions.infoDialogDirective
* @ngdoc directive
* @description Display dialog of composition info (name, abstract, thumbnail, extent, layers)
*/
.directive('hs.compositions.infoDialogDirective', ['config', function (config) {
return {
template: require('components/compositions/partials/dialog_info.html'),
link: function (scope, element, attrs) {
scope.infoModalVisible = true;
}
};
}])

hsCompositionsServiceParser.init();
hsCompositionsService.init();
hsCompositionsController.init();
hsCompositionsServiceParser.init();
hsCompositionsService.init();
hsCompositionsController.init();

})

0 comments on commit d6ec6d2

Please sign in to comment.
You can’t perform that action at this time.