diff --git a/examples/databio/Gruntfile.js b/examples/databio/Gruntfile.js deleted file mode 100755 index ee56a5c02d..0000000000 --- a/examples/databio/Gruntfile.js +++ /dev/null @@ -1,69 +0,0 @@ -module.exports = function(grunt) { - - // Project configuration. - grunt.initConfig({ - nggettext_extract: { - databio: { - files: { - 'examples/databio/template.pot': [__dirname + '/**/*.html', __dirname + '/**/*.js'] - } - } - }, - nggettext_compile: { - databio: { - files: { - 'examples/databio/translations.js': [__dirname + "/*.po"] - } - }, - }, - pkg: grunt.file.readJSON('../../package.json'), - uglify: { - bundles: { - options: { - mangle: { - reserved: ['angular', '$', 'ol', 'define', 'Api'] - } - }, - files: [{ - expand: true, - src: ["examples/databio/bundle.js", "!" + __dirname + "/bundle.min.js"], - dest: 'dist', - cwd: '.', - rename: function(dst, src) { - return src.replace('.js', '.min.js'); - } - }] - } - }, - "jsbeautifier": { - "default": { - src: [__dirname + "/hslayers.js", __dirname + "/app.js", __dirname + "/*.js", "!" + __dirname + "/bundle.js", "!" + __dirname + "/bundle.min.js"] - }, - "git-pre-commit": { - src: [__dirname + "/hslayers.js", __dirname + "/app.js", "!" + __dirname + "/bundle.js", "!" + __dirname + "/bundle.min.js"] - } - }, - jsdoc: { - dist: { - src: ['components/**/*.js'], - options: { - destination: 'docs', - configure: 'node_modules/angular-jsdoc/common/conf.json', - template: 'node_modules/angular-jsdoc/angular-template', - readme: './README.md' - } - } - } - }); - - grunt.file.setBase('../../') - - grunt.loadNpmTasks('grunt-jsbeautifier'); - grunt.loadNpmTasks('grunt-angular-gettext'); - grunt.loadNpmTasks('grunt-jsdoc'); - grunt.loadNpmTasks('grunt-contrib-uglify-es'); - grunt.registerTask('default', ['jsbeautifier', 'uglify']); - grunt.registerTask('git-pre-commit', ['jsbeautifier']); - - -}; diff --git a/examples/databio/about.html b/examples/databio/about.html deleted file mode 100644 index 996cdf4b4a..0000000000 --- a/examples/databio/about.html +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/examples/databio/app.js b/examples/databio/app.js deleted file mode 100755 index 3da054f539..0000000000 --- a/examples/databio/app.js +++ /dev/null @@ -1,459 +0,0 @@ -'use strict'; - -define(['ol', 'toolbar', 'sentinel', 'layermanager', 'poi', 'parcels_near_water', 'soils', 'water_bodies', 'parcels_with_id', 'erosion_zones', 'parcels_with_CTVDPB', 'parcels_with_crop_types', 'parcels_with_crop_types_by_distance', 'sidebar', 'query', 'search', 'print', 'permalink', 'measure', 'geolocation', 'api', 'hscesium', 'ows', 'datasource_selector', 'bootstrap', 'angular-gettext'], - - function(ol, toolbar, sentinel, layermanager, pois, parcels_near_water, soils, water_bodies, parcels_with_id, erosion_zones, parcels_with_CTVDPB, parcels_with_crop_types, parcels_with_crop_types_by_distance) { - var module = angular.module('hs', [ - 'hs.toolbar', - 'hs.layermanager', - 'hs.query', - 'hs.search', 'hs.print', 'hs.permalink', - 'hs.datasource_selector', - 'hs.geolocation', - 'hs.cesium', - 'hs.sidebar', - 'hs.ows', - 'hs.sentinel' - ]); - - module.directive('hs', ['hs.map.service', 'Core', '$compile', '$timeout', function(OlMap, Core, $compile, $timeout) { - return { - templateUrl: hsl_path + 'hslayers.html', - link: function(scope, element) { - Core.fullScreenMap(element); - } - }; - }]); - - module.directive('hs.aboutproject', function() { - function link(scope, element, attrs) { - setTimeout(function() { - $('#about-dialog').modal('show'); - }, 1500); - } - return { - templateUrl: './about.html?bust=' + gitsha, - link: link - }; - }); - - module.directive('hs.foodiezones.infoDirective', function() { - return { - templateUrl: './info.html?bust=' + gitsha, - link: function(scope, element, attrs) { - $('#zone-info-dialog').modal('show'); - } - }; - }) - - module.directive('hs.hud', function() { - return { - templateUrl: './hud.html?bust=' + gitsha, - link: function(scope, element, attrs) { - - } - }; - }); - - module.directive('description', ['$compile', 'hs.utils.service', function($compile, utils) { - return { - templateUrl: './description.html?bust=' + gitsha, - scope: { - object: '=', - url: '@' - }, - link: function(scope, element, attrs) { - scope.describe = function(e, attribute) { - if (angular.element(e.target).parent().find('table').length > 0) { - angular.element(e.target).parent().find('table').remove(); - } else { - var table = angular.element('
'); - angular.element(e.target).parent().append(table); - $compile(table)(scope.$parent); - } - } - if (angular.isUndefined(scope.object) && angular.isDefined(attrs.url) && typeof attrs.url == 'string') { - scope.object = { - attributes: [] - }; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent('describe <' + attrs.url + '>') + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - if (angular.isUndefined(response.results)) return; - for (var i = 0; i < response.results.bindings.length; i++) { - var b = response.results.bindings[i]; - var short_name = b.p.value; - if (short_name.indexOf('#') > -1) - short_name = short_name.split('#')[1]; - scope.object.attributes.push({ - short_name: short_name, - value: b.o.value - }); - if (!scope.$$phase) scope.$apply(); - } - }) - } - } - }; - }]); - - function getHostname() { - var url = window.location.href - var urlArr = url.split("/"); - var domain = urlArr[2]; - return urlArr[0] + "//" + domain; - }; - - module.value('config', { - default_layers: [ - new ol.layer.Tile({ - source: new ol.source.OSM(), - title: "OpenStreetMap", - base: true, - visible: false, - minimumTerrainLevel: 15 - }), - new ol.layer.Tile({ - title: "Corine land cover (WMS)", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/olu/european_openlandusemap.map', - params: { - LAYERS: 'corine', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 9, - }, - crossOrigin: null - }), - path: 'Open-Land-Use Map', - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Production zones", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/produkcni_zony.map', - params: { - LAYERS: 'p_zony', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - }, - crossOrigin: null - }), - path: 'Open-Land-Use Map', - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Open-Land-Use (WMS)", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/olu/openlandusemap.map', - params: { - LAYERS: 'olu_bbox_srid', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - VERSION: '1.1.1', - CRS: 'EPSG:4326', - FROMCRS: 'EPSG:4326', - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/openlandusemap.map&service=WMS&request=GetLegendGraphic&layer=olu_bbox_srid&version=1.3.0&format=image/png&sld_version=1.1.0'], - path: 'Open-Land-Use Map', - visible: false, - opacity: 0.7 - }), - pois.createPoiLayer() - ], - project_name: 'erra/map', - datasources: [{ - title: "Datasets", - url: "http://otn-dev.intrasoft-intl.com/otnServices-1.0/platform/ckanservices/datasets", - language: 'eng', - type: "ckan", - download: true - }, { - title: "Services", - url: "http://cat.ccss.cz/csw/", - language: 'eng', - type: "micka", - code_list_url: 'http://www.whatstheplan.eu/php/metadata/util/codelists.php?_dc=1440156028103&language=eng&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22label%22%7D%5D' - }, { - title: "Hub layers", - url: "http://opentnet.eu/php/metadata/csw/", - language: 'eng', - type: "micka", - code_list_url: 'http://opentnet.eu/php/metadata/util/codelists.php?_dc=1440156028103&language=eng&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22label%22%7D%5D' - }], - hostname: { - "default": { - "title": "Default", - "type": "default", - "editable": false, - "url": getHostname() - } - }, - 'catalogue_url': "/php/metadata/csw", - 'compositions_catalogue_url': "/php/metadata/csw", - status_manager_url: '/wwwlibs/statusmanager2/index.php', - default_view: new ol.View({ - center: ol.proj.transform([14.28, 49.6], 'EPSG:4326', 'EPSG:3857'), - zoom: 14, - units: "m" - }), - cesiumBingKey: 'Ag-1WrJMNrtwDswUaPxKvq85UO-82NmE_V5HiXbgssabAYmr4zV2HyFWrusCfaXF' - }); - - module.controller('Main', ['$scope', '$compile', '$element', 'Core', 'hs.map.service', 'config', '$rootScope', 'hs.utils.service', '$sce', 'hs.sentinel.service', 'gettext', - function($scope, $compile, $element, Core, hs_map, config, $rootScope, utils, $sce, sentinel_service, gettext) { - var map; - - $scope.hsl_path = hsl_path; //Get this from hslayers.js file - var hsCesium; - $scope.Core = Core; - - Core.singleDatasources = true; - Core.panelEnabled('compositions', false); - Core.panelEnabled('status_creator', false); - $scope.Core.setDefaultPanel('layermanager'); - var providers = []; - var synced_providers = []; - - function registerProvider(provider, synced) { - providers.push(provider); - if (angular.isUndefined(synced) || synced) { - synced_providers.push(provider); - } - } - - registerProvider(parcels_near_water); - registerProvider(water_bodies); - registerProvider(parcels_with_id, false); - registerProvider(parcels_with_CTVDPB, false); - registerProvider(parcels_with_crop_types); - registerProvider(parcels_with_crop_types_by_distance, false); - registerProvider(erosion_zones, false); - registerProvider(soils); - - $rootScope.$on('map.loaded', function() { - map = hs_map.map; - providers.forEach(function(provider) { - provider.init($scope, $compile, map, utils, gettext); - }) - $rootScope.$on('map.sync_center', function(e, center, bounds) { - $scope.last_center = center; - queryLayersByArea(bounds); - }) - $rootScope.$on('map.extent_changed', function(e, elem, bounds) { - if (hs_map.visible) { - bounds = ol.proj.transformExtent(bounds, map.getView().getProjection(), 'EPSG:4326'); - var points4 = [ - [bounds[0], bounds[1]], - [bounds[2], bounds[1]], - [bounds[2], bounds[3]], - [bounds[0], bounds[3]] - ]; - $scope.last_center = [(bounds[0] + bounds[2]) / 2, (bounds[1] + bounds[3]) / 2]; - queryLayersByArea(points4); - } - - }) - map.on('moveend', extentChanged); - }); - - function queryLayersByArea(points4) { - map = hs_map.map; - pois.getPois(map, utils, points4); - synced_providers.forEach(function(provider) { - provider.get(map, utils, points4); - }) - } - - pois.init($scope, $compile); - providers.forEach(function(provider) { - config.default_layers.push(provider.createLayer(gettext)); - }) - config.default_layers.push(sentinel_service.createLayer(gettext)); - - function extentChanged() { - var bbox = map.getView().calculateExtent(map.getSize()); - //pois.getPois(map, utils, [[bbox[0], bbox[1]], [bbox[2], bbox[1]], [bbox[2], bbox[3]], [bbox[0], bbox[3]]]); - - } - - function createAboutDialog() { - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - createAboutDialog(); - - $scope.showInfo = function(entity) { - var id, obj_type; - if (entity.properties.poi) { - id = entity.properties.poi.getValue(); - obj_type = 'Point of interest' - } - $scope.zone = { - id: $sce.trustAsHtml(), - attributes: [], - links: [], - obj_type: obj_type - }; - describeOlu(id, function() { - if (!$scope.$$phase) $scope.$apply(); - }); - } - - function describeOlu(id, callback) { - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent('describe <' + id + '>') + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - if (angular.isUndefined(response.results)) return; - for (var i = 0; i < response.results.bindings.length; i++) { - var b = response.results.bindings[i]; - var short_name = b.p.value; - if (short_name.indexOf('#') > -1) - short_name = short_name.split('#')[1]; - $scope.zone.attributes.push({ - short_name: short_name, - value: b.o.value - }); - } - getLinksTo(id, callback); - }) - } - - function getLinksTo(id, callback) { - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent('PREFIX geo: PREFIX geof: PREFIX virtrdf: PREFIX poi: PREFIX rdfs: SELECT * WHERE {?obj ?obj_geom. ?obj_geom geo:asWKT ?Coordinates . FILTER(bif:st_intersects (?Coordinates, ?wkt)). { SELECT ?wkt WHERE { <' + id + '> geo:hasGeometry ?geometry. ?geometry geo:asWKT ?wkt.} } }') + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - for (var i = 0; i < response.results.bindings.length; i++) { - var b = response.results.bindings[i]; - $scope.zone.links.push({ - url: b.obj.value - }); - } - callback(); - }) - } - - $rootScope.$on('cesiummap.loaded', function(e, viewer, HsCesium) { - viewer.targetFrameRate = 30; - hsCesium = HsCesium; - providers.forEach(function(provider) { - provider.cesium = hsCesium; - }) - setTimeout(createHud, 3000); - }) - - $rootScope.$on('map.mode_changed', function(e, mode) { - if (mode == 'ol') { - hs_map.findLayerByTitle('OpenStreetMap').setVisible(true); - providers.forEach(function(provider) { - provider.map_mode = mode; - }) - } - }) - - $rootScope.$on('cesiummap.resized', function() { - synced_providers.forEach(function(provider) { - provider.get(map, utils, getViewport()); - }) - }) - - function createHud() { - var el = angular.element('
'); - $(".page-content").append(el); - $compile(el)($scope); - } - - $scope.reloadIdUz = function() { - parcels_with_id.getLayer().setVisible(true); - parcels_with_id.get(map, utils); - } - - - $scope.reloadIdUzCropTypes = function() { - parcels_with_id.getLayer().setVisible(true); - parcels_with_id.getCropTypes(map, utils); - } - - $scope.water_distance = 1; - $scope.reloadNearWaterbodies = function() { - parcels_near_water.getLayer().setVisible(true); - parcels_near_water.get(map, utils, getViewport()); - } - - $scope.reloadCTVDPB = function() { - parcels_with_CTVDPB.getLayer().setVisible(true); - parcels_with_CTVDPB.get(map, utils, getViewport()); - } - - $scope.reloadErosionZonesById = function() { - erosion_zones.getLayer().setVisible(true); - erosion_zones.getForId(map, utils); - } - - $scope.reloadErosionZonesByCTVDPB = function() { - erosion_zones.getLayer().setVisible(true); - erosion_zones.getForCTVDPB(map, utils); - } - - $scope.reloadCropTypeLayer = function(crop_distance) { - if (angular.isUndefined(crop_distance)) { - parcels_with_crop_types.getLayer().setVisible(true); - parcels_with_crop_types_by_distance.getLayer().setVisible(false); - parcels_with_crop_types.get(map, utils, getViewport()); - } else { - parcels_with_crop_types.getLayer().setVisible(false); - parcels_with_crop_types_by_distance.getLayer().setVisible(true); - parcels_with_crop_types_by_distance.get(map, utils, $scope.crop_distance, hsCesium.HsCsCamera.getCameraCenterInLngLat()); - } - } - - function getViewport() { - return hsCesium.HsCsCamera.getViewportPolygon() - } - - $scope.reloadSoils = function() { - soils.getLayer().setVisible(true); - soils.get(map, utils, getViewport()); - } - - $scope.$on("scope_loaded", function(event, args) { - if (args == 'Sidebar') { - var el = angular.element('
'); - angular.element('#panelplace').append(el); - $compile(el)($scope); - - var toolbar_button = angular.element('
'); - angular.element('.sidebar-list').append(toolbar_button); - $compile(toolbar_button)(event.targetScope); - } - }) - - $scope.showPopup = function(entity) { - $scope.showInfo(entity); - if ($('#zone-info-dialog').length > 0) { - angular.element('#zone-info-dialog').parent().remove(); - } - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - - $scope.crop_distance = 1; - - $scope.$on('infopanel.updated', function(event) {}); - } - ]); - - return module; - }); diff --git a/examples/databio/browserify.js b/examples/databio/browserify.js deleted file mode 100644 index fe0d746f63..0000000000 --- a/examples/databio/browserify.js +++ /dev/null @@ -1,21 +0,0 @@ -var browserify = require('browserify'); -var fs = require('fs'); -var common_paths = require('../../common_paths'); -common_paths.paths.push(__dirname); -var b = browserify({ - paths: common_paths.paths -}); - -var bundleFs = fs.createWriteStream(__dirname + '/bundle.js') -bundleFs.on('finish', function() { - console.log('finished writing the browserify file'); -}); - -b.pipeline.on('file', function(file, id, parent) { - console.log(file, id, parent); -}) - -b.add(__dirname + '/app.js') -b.transform('deamdify'); -b.bundle() - .pipe(bundleFs); diff --git a/examples/databio/build.sh b/examples/databio/build.sh deleted file mode 100644 index 9530bf8ef8..0000000000 --- a/examples/databio/build.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -node browserify.js -grunt \ No newline at end of file diff --git a/examples/databio/cs_CZ.mo b/examples/databio/cs_CZ.mo deleted file mode 100644 index 49711aeeab..0000000000 Binary files a/examples/databio/cs_CZ.mo and /dev/null differ diff --git a/examples/databio/cs_CZ.po b/examples/databio/cs_CZ.po deleted file mode 100644 index a5dd7df7f6..0000000000 --- a/examples/databio/cs_CZ.po +++ /dev/null @@ -1,194 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"X-Generator: Poedit 2.1.1\n" -"Last-Translator: \n" -"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);\n" -"Language: cs_CZ\n" - -#: examples/databio/about.html:7 -msgid "About Databio pilot" -msgstr "" - -#: examples/databio/hud.html:17 -msgid "Actions:" -msgstr "" - -#: examples/databio/hud.html:191 examples/databio/hud.html:82 -msgid "CTVDPB" -msgstr "" - -#: examples/databio/sentineldirective.html:26 -msgid "Clear" -msgstr "" - -#: examples/databio/about.html:5 examples/databio/info.html:5 -#: examples/databio/sentineldirective.html:5 -msgid "Close" -msgstr "" - -#: examples/databio/hud.html:128 examples/databio/hud.html:153 -msgid "Crop type" -msgstr "" - -#: examples/databio/hud.html:73 -msgid "Crop types for fields with CTVDPB code" -msgstr "" - -#: examples/databio/hud.html:96 -msgid "Crop types for fields with LPIS ID" -msgstr "" - -#: examples/databio/hud.html:159 -msgid "Distance in km" -msgstr "" - -#: examples/databio/hud.html:36 -msgid "Distance to water bodies in km" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "EndUTC" -msgstr "" - -#: examples/databio/erosion_zones.js:146 -msgid "Erosion zones" -msgstr "" - -#: examples/databio/parcels_with_id.js:164 -msgid "Fields by ID_UZ attribute from LPIS db" -msgstr "" - -#: examples/databio/parcels_with_crop_types.js:103 -msgid "Fields by crop types" -msgstr "" - -#: examples/databio/parcels_with_crop_types_by_distance.js:103 -msgid "Fields by crop types and distance" -msgstr "" - -#: examples/databio/parcels_with_CTVDPB.js:84 -msgid "Fields filtered by CTVDPD code" -msgstr "" - -#: examples/databio/soils.js:103 -msgid "Fields with soil type" -msgstr "" - -#: examples/databio/hud.html:109 examples/databio/hud.html:134 -#: examples/databio/hud.html:163 examples/databio/hud.html:195 -#: examples/databio/hud.html:220 examples/databio/hud.html:40 -#: examples/databio/hud.html:63 examples/databio/hud.html:86 -msgid "Filter" -msgstr "" - -#: examples/databio/hud.html:144 -msgid "Filter fields by crop and distance to map center" -msgstr "" - -#: examples/databio/hud.html:205 -msgid "Filter fields by soil type in area" -msgstr "" - -#: examples/databio/hud.html:28 -msgid "Filter fields which are near water" -msgstr "" - -#: examples/databio/hud.html:173 -msgid "Find erosion zones" -msgstr "" - -#: examples/databio/hud.html:119 -msgid "Find fields with crop type in area" -msgstr "" - -#: examples/databio/sentineltoolbar.html:1 -msgid "Get Sentinel satellite crossings" -msgstr "" - -#: examples/databio/hud.html:105 -msgid "ID" -msgstr "" - -#: examples/databio/hud.html:59 -msgid "ID Uz" -msgstr "" - -#: examples/databio/hud.html:182 -msgid "LPIS FARM ID (ID_UZ)" -msgstr "" - -#: examples/databio/hud.html:50 -msgid "Land usage for fields with LPIS ID" -msgstr "" - -#: examples/databio/sentineldirective.html:15 -msgid "" -"Map based web application for identifying of usable remote sensing data from " -"Sentinel satellites. Right click or double click on the map to choose one or " -"multiple positions (for example fields, forests etc.) and the application " -"prepare a forecast based on location, minimal satellite elevation and " -"minimal crossing duration for Sentinel 2A and 2B satellites. The application " -"calculates timetable of satellites crossing time and weather (clouds) " -"forecast as a result. User gets information when his selected position(s) " -"can be photographed and which imagery can be used for further processing." -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "MaxUTC" -msgstr "" - -#: examples/databio/parcels_near_water.js:101 -msgid "Plots intersecting water bodies" -msgstr "" - -#: examples/databio/sentineldirective.html:2 -#: examples/databio/sentineltoolbar.html:3 -msgid "Sentinel watcher" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "Sn" -msgstr "" - -#: examples/databio/hud.html:214 -msgid "Soil type" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "StartUTC" -msgstr "" - -#: examples/databio/water_bodies.js:70 -msgid "Water bodies" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "Weather" -msgstr "" - -#: examples/databio/sentineldirective.html:18 -msgid "at" -msgstr "" - -#: examples/databio/hud.html:84 -msgid "code eg. 57011607501" -msgstr "" - -#: examples/databio/hud.html:61 -msgid "e.g. 17614" -msgstr "" - -#: examples/databio/hud.html:193 -msgid "e.g. 57011607501" -msgstr "" - -#: examples/databio/hud.html:107 -msgid "e.g. 6423" -msgstr "" diff --git a/examples/databio/description.html b/examples/databio/description.html deleted file mode 100644 index 636f14bf12..0000000000 --- a/examples/databio/description.html +++ /dev/null @@ -1,8 +0,0 @@ - - - {{attribute.short_name}}: - {{attribute.value}} - {{attribute.value}} - - - diff --git a/examples/databio/dev_index.html b/examples/databio/dev_index.html deleted file mode 100755 index 6da70556d2..0000000000 --- a/examples/databio/dev_index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Databio pilot - - - - - - - - -
- - - - - - - diff --git a/examples/databio/erosion_zones.js b/examples/databio/erosion_zones.js deleted file mode 100644 index a0814a34a8..0000000000 --- a/examples/databio/erosion_zones.js +++ /dev/null @@ -1,183 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - entity.original_color = new Cesium.Color.fromCssColorString('rgba(40, 150, 40, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - getForId: function(map, utils) { - if (lyr.getVisible() == false) return; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX common: - PREFIX prov: - PREFIX olu: - PREFIX af-inspire: - - - SELECT DISTINCT ?erosionZone ?erosion ?erosionCoord - FROM - WHERE { - ?erosionZone a foodie-cz:ErosionZone ; - foodie-cz:erosion ?erosion ; - geo:hasGeometry ?erosionGeo . - ?erosionGeo ogcgs:asWKT ?erosionCoord . - FILTER(bif:st_intersects(?erosionCoord, ?coordPlot)) . - GRAPH ?graph1 { - SELECT ?holding ?plot ?code ?shortId ?landUse ?coordPlot - FROM - WHERE{ - ?holding a foodie:Holding ; - common:identifier ?identifier_ID_UZ ; - foodie-cz:inspireIdCodeSpace ?inspireIdCodeSpace ; - foodie-cz:inspireIdCodeVersion ?inspireIdCodeVersion ; - af-inspire:contains ?site . - FILTER(STRSTARTS(STR(?identifier_ID_UZ),"${$scope.iduz}") ) - ?site foodie:containsPlot ?plot . - ?plot a foodie:Plot ; - foodie:code ?code ; - foodie-cz:shortId ?shortId ; - olu:specificLandUse ?landUse ; - geo:hasGeometry ?geoPlot . - ?geoPlot ogcgs:asWKT ?coordPlot . - } - } - } - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'erosionCoord', response, 'erosionZone', { - erosionZone: 'erosionZone', - erosion: 'erosion' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - getForCTVDPB: function(map, utils) { - if (lyr.getVisible() == false) return; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX common: - PREFIX prov: - PREFIX olu: - PREFIX af-inspire: - - SELECT DISTINCT ?erosionZone ?erosion ?erosionCoord - FROM - WHERE { - ?erosionZone a foodie-cz:ErosionZone ; - foodie-cz:erosion ?erosion ; - geo:hasGeometry ?erosionGeo . - ?erosionGeo geo:asWKT ?erosionCoord . - FILTER(bif:st_intersects(?erosionCoord, ?coordPlotFinal)) . - { - SELECT ?plot ?coordPlotFinal - FROM - WHERE { - ?plot a foodie:Plot ; - foodie:code ?input ; - geo:hasGeometry ?geoPlotFinal . - ?geoPlotFinal geo:asWKT ?coordPlotFinal . - { - SELECT ?input - WHERE { - ?s ?p ?v - BIND ("${$scope.ctvdpd}"^^ as ?input) . - } - LIMIT 1 - } - } - } - } - - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'erosionCoord', response, 'erosionZone', { - erosionZone: 'erosionZone', - erosion: 'erosion' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Erosion zones"), - source: src, - visible: false, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(40, 150, 40, 0.6)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(40, 150, 40, 0.8)' - }) - }) - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databio/hslayers.js b/examples/databio/hslayers.js deleted file mode 100755 index 5ff2e93580..0000000000 --- a/examples/databio/hslayers.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; -if (typeof require != 'undefined') { - require.config({ - urlArgs: 'bust=' + gitsha, - paths: { - toolbar: hsl_path + 'components/toolbar/toolbar', - layermanager: hsl_path + 'components/layermanager/layermanager', - map: hsl_path + 'components/map/map', - query: hsl_path + 'components/query/query', - search: hsl_path + 'components/search/search', - print: hsl_path + 'components/print/print', - permalink: hsl_path + 'components/permalink/permalink', - geolocation: hsl_path + 'components/geolocation/geolocation', - measure: hsl_path + 'components/measure/measure', - legend: hsl_path + 'components/legend/legend', - app: 'app', - core: hsl_path + 'components/core/core', - api: hsl_path + 'components/api/api', - translations: hsl_path + 'components/translations/js/translations', - hscesium: hsl_path + 'components/hscesium/hscesium' - } - }); - - //http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap - window.name = "NG_DEFER_BOOTSTRAP!"; - - require(['core'], function(app) { - require(['app'], function(app) { - var $html = angular.element(document.getElementsByTagName('html')[0]); - angular.element().ready(function() { - angular.resumeBootstrap([app['name']]); - }); - }); - }); -} else { - var $html = angular.element(document.getElementsByTagName('html')[0]); - angular.element().ready(function() { - // angular.resumeBootstrap([exports.app['name']]); - }); -} diff --git a/examples/databio/hud.html b/examples/databio/hud.html deleted file mode 100644 index 820f0563da..0000000000 --- a/examples/databio/hud.html +++ /dev/null @@ -1,232 +0,0 @@ -
- - -
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- - -
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
- -
- - - - -
-
-
-
-
-
- -
-
-
- -
- - - - -
-
-
-
-
-
-
-
-
- -
\ No newline at end of file diff --git a/examples/databio/index.html b/examples/databio/index.html deleted file mode 100755 index e1cc3a5629..0000000000 --- a/examples/databio/index.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Databio pilot - - - - - - - - -
- - - - - - - diff --git a/examples/databio/info.html b/examples/databio/info.html deleted file mode 100644 index 37c4779c43..0000000000 --- a/examples/databio/info.html +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/examples/databio/package.json b/examples/databio/package.json deleted file mode 100644 index 26e251555e..0000000000 --- a/examples/databio/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "databio", - "version": "1.0.0", - "description": "", - "main": "Gruntfile.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "BOSC", - "license": "ISC", - "dependencies": { - "cesium": "1.49.x" - } -} diff --git a/examples/databio/parcels_near_water.js b/examples/databio/parcels_near_water.js deleted file mode 100644 index 8783994be7..0000000000 --- a/examples/databio/parcels_near_water.js +++ /dev/null @@ -1,140 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - var name = entity.properties.code; - var use = entity.properties.use.getValue(); - entity.polygon.outline = false; - /*entity.polygon.outline = true; - entity.polygon.outlineColor = Cesium.Color.YELLOW; - entity.polygon.outlineWidth = 2.0;*/ - entity.original_color = new Cesium.Color.fromCssColorString('rgba(50, 50, 150, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils, rect) { - if (typeof $scope.last_center == 'undefined') return; - if (map.getView().getResolution() > lyr.getMaxResolution() * (typeof me.map_mode == 'cesium' ? 0.5 : 1) || lyr.getVisible() == false) return; - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - var distance = $scope.water_distance * ((1 / 110540) + 1 / (111320 * Math.cos($scope.last_center[1]))) / 2; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - - PREFIX geo: -PREFIX geof: -PREFIX virtrdf: -PREFIX poi: -PREFIX rdfs: -PREFIX foodie-cz: -PREFIX foodie: -PREFIX olu: - - -SELECT DISTINCT ?plot ?code ?shortId ?landUse ?coordPlotFinal -FROM -WHERE { - ?plot geo:hasGeometry ?geoPlotFinal . - ?geoPlotFinal ogcgs:asWKT ?coordPlotFinal . - FILTER(bif:st_intersects(?coordPlotFinal, ?coordWBody, ${distance})) . - - GRAPH ?graph1 { - SELECT ?plot ?code ?shortId ?landUse - FROM - WHERE{ - ?plot a foodie:Plot ; - foodie:code ?code ; - foodie-cz:shortId ?shortId ; - olu:specificLandUse ?landUse ; - geo:hasGeometry ?geoPlot . - ?geoPlot ogcgs:asWKT ?coordPlot . - FILTER(bif:st_may_intersect (?coordPlot, bif:st_geomFromText("${extents}"))) . - } - } - GRAPH ?graph2 { - SELECT ?waterBody ?label ?coordWBody - FROM - WHERE { - ?waterBody a foodie-cz:WaterBody ; - rdfs:label ?label ; - geo:hasGeometry ?geoWBody . - ?geoWBody ogcgs:asWKT ?coordWBody . - FILTER(bif:st_intersects (?coordWBody, bif:st_geomFromText("${extents}"))) . - } - } -} - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlotFinal', response, 'code', { - parcel: 'code', - use: 'landUse' - }, map, $scope) - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Plots intersecting water bodies"), - source: src, - visible: false, - maxResolution: 4.777314267823516 * 4, - style: function(feature, resolution) { - var use = feature.get('use').split('/'); - use = use[use.length - 1]; - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(50, 50, 150, 0.8)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(50, 50, 150, 0.6)' - }) - }), - - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databio/parcels_with_CTVDPB.js b/examples/databio/parcels_with_CTVDPB.js deleted file mode 100644 index 92abeab316..0000000000 --- a/examples/databio/parcels_with_CTVDPB.js +++ /dev/null @@ -1,120 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - entity.original_color = new Cesium.Color.fromCssColorString('rgba(40, 150, 40, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils, rect) { - if (lyr.getVisible() == false) return; - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX common: - PREFIX prov: - PREFIX olu: - PREFIX af-inspire: - - SELECT ?plot ?plotName ?code ?shortId ?cropName ?cropArea ?year ?coordPlot - FROM - WHERE{ - ?plot a foodie:Plot ; - foodie:crop ?cropSpecies ; - geo:hasGeometry ?geoPlot . - OPTIONAL {?plot foodie:code ?code } . - OPTIONAL {?plot foodie-cz:plotName ?plotName } . - OPTIONAL {?plot foodie-cz:shortId ?shortId } . - ?geoPlot ogcgs:asWKT ?coordPlot . - ?cropSpecies foodie:cropArea ?cropArea ; - common:validFrom ?validFrom ; - foodie:cropSpecies ?cropType . - ?cropType foodie:description ?cropName . - BIND (year(xsd:dateTime(?validFrom)) as ?year) . - FILTER(STRSTARTS(STR(?code),"${$scope.ctvdpd}") ) - #FILTER (?year=2017) - } - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlot', response, 'code', { - plot: 'plot', - shortId: 'shortId', - code: 'code' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Fields filtered by CTVDPD code"), - source: src, - visible: false, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(40, 150, 40, 0.6)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(40, 150, 40, 0.8)' - }) - }) - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databio/parcels_with_crop_types.js b/examples/databio/parcels_with_crop_types.js deleted file mode 100644 index 169b24cfd0..0000000000 --- a/examples/databio/parcels_with_crop_types.js +++ /dev/null @@ -1,170 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - function createLabel(entity) { - var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions; - var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center; - polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter); - entity.position = polyCenter; - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.code.getValue() + (entity.properties.cropName ? ' ' + entity.properties.cropName.getValue() : ''), - font: '16px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - showBackground: true, - style: Cesium.LabelStyle.FILL, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 30000.0), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - scaleByDistance: new Cesium.NearFarScalar(500, 1, 70000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }) - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - createLabel(entity); - entity.original_color = new Cesium.Color.fromCssColorString('rgba(150, 40, 40, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils, rect) { - if (map.getView().getResolution() > lyr.getMaxResolution() || lyr.getVisible() == false) return; - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX common: - PREFIX prov: - PREFIX olu: - PREFIX af-inspire: - - SELECT ?plot ?plotName ?code ?shortId ?cropName ?cropArea ?year ?coordPlot - FROM - WHERE{ - ?plot a foodie:Plot ; - foodie:crop ?cropSpecies ; - geo:hasGeometry ?geoPlot . - OPTIONAL {?plot foodie:code ?code } . - OPTIONAL {?plot foodie-cz:plotName ?plotName } . - OPTIONAL {?plot foodie-cz:shortId ?shortId } . - ?cropSpecies foodie:cropArea ?cropArea ; - common:validFrom ?validFrom ; - foodie:cropSpecies ?cropType . - ?cropType foodie:description ?cropName . - BIND (year(xsd:dateTime(?validFrom)) as ?year) . - ?geoPlot geo:asWKT ?coordPlot . - ${$scope.cropType!='' && typeof $scope.cropType!='undefined' && $scope.cropType != "http://w3id.org/foodie/core/CZpilot_fields/CropType/" ? `FILTER(?cropType = <${$scope.cropType}>).` : ''} - FILTER(bif:st_intersects (?coordPlot, bif:st_geomFromText("${extents}"))) . - } - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlot', response, 'code', { - plotName: 'plotName', - plot: 'plot', - shortId: 'shortId', - code: 'code', - cropName: 'cropName', - cropArea: 'cropArea' - }, map, $scope) - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Fields by crop types"), - source: src, - visible: false, - maxResolution: (0.00008291534423828125 * 2), - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(250, 250, 250, 0.6)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(250, 250, 250, 0.6)' - }) - }) - ]; - } - }); - return lyr; - }, - fillClassificators() { - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(`PREFIX foodie-cz: - PREFIX foodie: - - SELECT DISTINCT ?cropType ?cropName - FROM - WHERE{ - ?plot a foodie:Plot ; - foodie:crop ?cropSpecies. - ?cropSpecies foodie:cropSpecies ?cropType . - ?cropType foodie:description ?cropName . - } - ORDER BY ?cropName - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - $scope.cropTypes = response.results.bindings.map(function(r) { - return { - name: r.cropName.value, - id: r.cropType.value - }; - }) - }) - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - me.fillClassificators(); - } - } - return me; - } -) diff --git a/examples/databio/parcels_with_crop_types_by_distance.js b/examples/databio/parcels_with_crop_types_by_distance.js deleted file mode 100644 index 3caa9709c5..0000000000 --- a/examples/databio/parcels_with_crop_types_by_distance.js +++ /dev/null @@ -1,141 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions; - var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center; - polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter); - entity.position = polyCenter; - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.code.getValue() + ' ' + entity.properties.cropName.getValue(), - font: '16px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - showBackground: true, - style: Cesium.LabelStyle.FILL, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 30000.0), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - scaleByDistance: new Cesium.NearFarScalar(500, 1, 70000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }) - entity.original_color = new Cesium.Color.fromCssColorString('rgba(150, 40, 40, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils, distance, center) { - if (lyr.getVisible() == false) return; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - -PREFIX geo: -PREFIX geof: -PREFIX virtrdf: -PREFIX poi: -PREFIX rdfs: -PREFIX foodie-cz: -PREFIX foodie: -PREFIX common: -PREFIX prov: -PREFIX olu: -PREFIX af-inspire: - -SELECT ?plot ?plotName ?code ?shortId ?cropName ?cropArea ?distance ?year ?coordPlot -FROM -WHERE{ - ?plot a foodie:Plot ; - foodie:crop ?cropSpecies ; - geo:hasGeometry ?geoPlot . - OPTIONAL {?plot foodie:code ?code } . - OPTIONAL {?plot foodie-cz:plotName ?plotName } . - OPTIONAL {?plot foodie-cz:shortId ?shortId } . - ?geoPlot ogcgs:asWKT ?coordPlot . - ?cropSpecies foodie:cropArea ?cropArea ; - common:validFrom ?validFrom ; - foodie:cropSpecies ?cropType . - ?cropType foodie:description ?cropName . - ${$scope.cropType!='' && typeof $scope.cropType!='undefined' && $scope.cropType != "http://w3id.org/foodie/core/CZpilot_fields/CropType/" ? `FILTER(?cropType = <${$scope.cropType}>).` : ''} - BIND (bif:ST_XMin(?coordPlot) AS ?xmin) . - BIND (bif:ST_YMin(?coordPlot) AS ?ymin) . - BIND (bif:ST_XMax(?coordPlot) AS ?xmax) . - BIND (bif:ST_YMax(?coordPlot) AS ?ymax) . - BIND ((?xmin + ?xmax)/2 AS ?x) . - BIND ((?ymin + ?ymax)/2 AS ?y) . - BIND (bif:st_distance(bif:st_point(?x, ?y), bif:st_geomFromText("POINT(${center[0]} ${center[1]})")) as ?distance) . - BIND (year(xsd:dateTime(?validFrom)) as ?year) . - FILTER (?distance <=${distance}) . -} - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlot', response, 'code', { - plotName: 'plotName', - plot: 'plot', - shortId: 'shortId', - code: 'code', - cropName: 'cropName', - cropArea: 'cropArea' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Fields by crop types and distance"), - source: src, - visible: false, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(150, 40, 40, 0.8)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(150, 40, 40, 0.8)' - }) - }) - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databio/parcels_with_id.js b/examples/databio/parcels_with_id.js deleted file mode 100644 index a78e70dcbe..0000000000 --- a/examples/databio/parcels_with_id.js +++ /dev/null @@ -1,206 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - function createLabel(entity) { - var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions; - var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center; - polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter); - entity.position = polyCenter; - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.code.getValue() + (entity.properties.cropName ? ' ' + entity.properties.cropName.getValue() : '') + (entity.properties.use ? ' ' + entity.properties.use.getValue() : ''), - font: '16px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - showBackground: true, - style: Cesium.LabelStyle.FILL, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 20000.0), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - scaleByDistance: new Cesium.NearFarScalar(500, 2.0, 15000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }) - } - - function findCropNameIndex(cropName) { - for (var i = 0; i < $scope.cropTypes.length; i++) { - if ($scope.cropTypes[i].name == cropName) return i; - } - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.original_color = new Cesium.Color.fromCssColorString(entity.properties.cropName ? utils.rainbow($scope.cropTypes.length, findCropNameIndex(entity.properties.cropName.getValue()), 0.8) : 'rgba(150, 40, 40, 0.6)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - createLabel(entity); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils) { - if (lyr.getVisible() == false) return; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - -PREFIX geo: -PREFIX geof: -PREFIX virtrdf: -PREFIX poi: -PREFIX rdfs: -PREFIX foodie-cz: -PREFIX foodie: -PREFIX common: -PREFIX prov: -PREFIX olu: -PREFIX af-inspire: - -SELECT ?holding ?plot ?code ?shortId ?landUse ?coordPlot -FROM -WHERE{ - ?holding a foodie:Holding ; - common:identifier ?identifier_ID_UZ ; - foodie-cz:inspireIdCodeSpace ?inspireIdCodeSpace ; - foodie-cz:inspireIdCodeVersion ?inspireIdCodeVersion ; - af-inspire:contains ?site . - FILTER(STRSTARTS(STR(?identifier_ID_UZ),"${$scope.iduz}") ) - ?site foodie:containsPlot ?plot . - ?plot a foodie:Plot ; - foodie:code ?code ; - foodie-cz:shortId ?shortId ; - olu:specificLandUse ?landUse ; - geo:hasGeometry ?geoPlot . - ?geoPlot ogcgs:asWKT ?coordPlot . - } - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlot', response, 'code', { - holding: 'holding', - plot: 'plot', - shortId: 'shortId', - code: 'code', - use: 'landUse' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - getCropTypes: function(map, utils) { - if (lyr.getVisible() == false) return; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX common: - PREFIX prov: - PREFIX olu: - PREFIX af-inspire: - - SELECT DISTINCT ?plot ?plotName ?codeLPIS ?shortId ?cropName ?cropArea ?year ?coordPlot - FROM - WHERE{ - ?plot a foodie:Plot ; - foodie:crop ?cropSpecies ; - geo:hasGeometry ?geoPlot . - OPTIONAL {?plot foodie-cz:plotName ?plotName } . - OPTIONAL {?plot foodie-cz:shortId ?shortId } . - ?geoPlot ogcgs:asWKT ?coordPlot . - ?cropSpecies foodie:cropArea ?cropArea ; - common:validFrom ?validFrom ; - foodie:cropSpecies ?cropType . - ?cropType foodie:description ?cropName . - BIND (year(xsd:dateTime(?validFrom)) as ?year) . - ?plot foodie:code ?codeLPIS . - { - SELECT DISTINCT ?codeLPIS - FROM - WHERE { - ?holdingLPIS a foodie:Holding ; - common:identifier ?identifier_ID_UZ ; - af-inspire:contains ?siteLPIS . - FILTER(STRSTARTS(STR(?identifier_ID_UZ),"${$scope.iduz}") ) - ?siteLPIS foodie:containsPlot ?plotLPIS . - ?plotLPIS a foodie:Plot ; - foodie:code ?codeLPIS . - } - } - #FILTER (?year=2017) - } - - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlot', response, 'codeLPIS', { - plot: 'plot', - 'plotName': 'plotName', - shortId: 'shortId', - code: 'codeLPIS', - 'cropName': 'cropName', - 'cropArea': 'cropArea', - year: 'year' - }, map, $scope); - sparql_helpers.zoomToFetureExtent(src, me.cesium.viewer.camera, map); - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Fields by ID_UZ attribute from LPIS db"), - source: src, - visible: false, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(0, 0, 0, 1)', - width: 2 - }) - }) - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databio/poi.js b/examples/databio/poi.js deleted file mode 100644 index e61f6e5002..0000000000 --- a/examples/databio/poi.js +++ /dev/null @@ -1,159 +0,0 @@ -define(['ol'], - - function(ol) { - var spoi_source = new ol.source.Vector(); - var $scope; - var $compile; - var lyr; - - function entityClicked(entity) { - $scope.showInfo(entity); - if ($('#zone-info-dialog').length > 0) { - angular.element('#zone-info-dialog').parent().remove(); - } - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - - spoi_source.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - var name = entity.properties.label; - var s = entity.properties.category.getValue(); - if (typeof s === 'undefined') return; - s = s.split("#")[1]; - var allowed = 'archaeological_site.png artwork.png bank.png cafe.png car_wash.png fast_food.png hotel.png library.png other.png place_of_worship.png restaurant.png viewpoint.png zoo.png arts_centre.png atm.png bus_stop.png camp_site.png dentist.png fountain.png information.png memorial.png parking.png pub.png supermarket.png waste_basket.png'; - if (allowed.indexOf(s + '.png') > -1) - s = '../foodie-zones/symbols/' + s + '.png'; - else - s = '../foodie-zones/symbols/other.png'; - entity.billboard.scaleByDistance = new Cesium.NearFarScalar(50, 1.5, 15000, 0.0); - entity.billboard.image = s; - switch (entity.properties.category.getValue()) { - case 'http://gis.zcu.cz/SPOI/Ontology#peak': - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.label, - font: '18px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: new Cesium.Color(0.64, 0.1725490, 0.749019, 0.9), - outlineWidth: 2, - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(0, -36), - scaleByDistance: new Cesium.NearFarScalar(50, 1.5, 15000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }); - break; - case 'http://gis.zcu.cz/SPOI/Ontology#village': - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.label, - font: '14px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - showBackground: true, - style: Cesium.LabelStyle.FILL, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(0, -36), - scaleByDistance: new Cesium.NearFarScalar(50, 1.5, 15000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }); - break; - default: - } - entity.onclick = entityClicked - } - } - - return { - getPois: function(map, utils, rect) { - if (map.getView().getResolution() > lyr.getMaxResolution() || lyr.getVisible() == false) return; - var format = new ol.format.WKT(); - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - //console.log(extents); - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(`PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - SELECT ?poi ?wkt ?sub ?label FROM - WHERE {?poi geo:asWKT ?wkt . - FILTER(bif:st_intersects(bif:st_geomfromtext("${extents}"), ?wkt)). - ?poi ?sub. - ?sub ?categ. - ?poi ?label - }`) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - spoi_source.set('loaded', false); - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - if (angular.isUndefined(response.results)) return; - var features = []; - for (var i = 0; i < response.results.bindings.length; i++) { - try { - var b = response.results.bindings[i]; - if (b.wkt.datatype == "http://www.openlinksw.com/schemas/virtrdf#Geometry" && b.wkt.value.indexOf('e+') == -1 && b.wkt.value.indexOf('e-') == -1) { - var g_feature = format.readFeature(b.wkt.value.toUpperCase()); - var ext = g_feature.getGeometry().getExtent() - var geom_transformed = g_feature.getGeometry().transform('EPSG:4326', map.getView().getProjection()); - var feature = new ol.Feature({ - geometry: geom_transformed, - poi: b.poi.value, - category: b.sub.value, - label: b.label.value - }); - features.push(feature); - } - } catch (ex) { - if (console) console.log(ex); - } - } - spoi_source.clear(); - spoi_source.addFeatures(features); - spoi_source.set('loaded', true); - spoi_source.dispatchEvent('features:loaded', spoi_source); - }) - }, - createPoiLayer: function() { - lyr = new ol.layer.Vector({ - title: "Points of interest", - source: spoi_source, - maxResolution: 4.777314267823516 * 2 * 2, - style: function(feature, resolution) { - var s = feature.get('category'); - if (typeof s === 'undefined') return; - s = s.split("#")[1]; - var allowed = 'archaeological_site.png artwork.png bank.png cafe.png car_wash.png fast_food.png hotel.png library.png other.png place_of_worship.png restaurant.png viewpoint.png zoo.png arts_centre.png atm.png bus_stop.png camp_site.png dentist.png fountain.png information.png memorial.png parking.png pub.png supermarket.png waste_basket.png'; - if (allowed.indexOf(s + '.png') > -1) - s = '../foodie-zones/symbols/' + s + '.png'; - else - s = '../foodie-zones/symbols/other.png' - return [ - new ol.style.Style({ - image: new ol.style.Icon({ - anchor: [0.5, 1], - src: s, - size: [30, 35], - crossOrigin: 'anonymous' - }) - }) - ] - }, - visible: false - }); - return lyr - }, - init: function(_$scope, _$compile) { - $scope = _$scope; - $compile = _$compile; - } - } - } -) diff --git a/examples/databio/sentinel.js b/examples/databio/sentinel.js deleted file mode 100755 index 2fab988268..0000000000 --- a/examples/databio/sentinel.js +++ /dev/null @@ -1,134 +0,0 @@ -/** - * @namespace hs.sentinel - * @memberOf hs - */ -define(['angular', 'ol', 'map', 'core'], - - function(angular, ol) { - angular.module('hs.sentinel', ['hs.core', 'hs.map']) - - .directive('hs.sentinel.directive', function() { - return { - templateUrl: hsl_path + 'examples/databio/sentineldirective.html?bust=' + gitsha - }; - }) - - .directive('hs.sentinel.toolbar', function() { - return { - templateUrl: hsl_path + 'examples/databio/sentineltoolbar.html?bust=' + gitsha - }; - }) - - - .service("hs.sentinel.service", ['Core', 'hs.utils.service', '$http', - function(Core, utils, $http) { - var me = { - getCrossings: function(points, cb) { - var payload = []; - for (var i = 0; i < points.length; i++) { - var p = points[i]; - payload.push({ - idx: i, - lat: p.lat, - lon: p.lon - }); - } - $.ajax({ - url: 'https://agmeos.cz/satellite_position/service.php', - type: "POST", - data: JSON.stringify(payload), - contentType: "application/json; charset=utf-8", - dataType: "json" - }).done(function(response) { - for (var i = 0; i < response.length; i++) { - delete response[i].mkr; - points[i].crossings = response[i]; - } - cb(); - }); - }, - createLayer() { - var src = new ol.source.Vector(); - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.billboard.image = '../foodie-zones/symbols/other.png'; - entity.billboard.eyeOffset = new Cesium.Cartesian3(0.0, 0.0, -100.0); - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.ix.getValue().toString(), - font: '18px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: new Cesium.Color(0.1, 0.1, 0.1, 0.9), - showBackground: true, - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(0, -26), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, - eyeOffset: new Cesium.Cartesian3(0.0, 0.0, -200.0) - }) - entity.styled = true; - //entity.onclick = entityClicked - } - } - var lyr = new ol.layer.Vector({ - title: "Sentinel crossings", - source: src, - visible: true, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(0, 0, 0, 1)', - width: 2 - }) - }) - ]; - } - }); - me.src = src; - me.lyr = lyr; - return lyr; - } - }; - return me; - } - ]) - .controller('hs.sentinel.controller', ['$scope', 'hs.map.service', 'Core', 'config', 'hs.sentinel.service', '$timeout', - function($scope, OlMap, Core, config, service, styles, $timeout) { - $scope.points = []; - $scope.loading = false; - $scope.ajax_loader = hsl_path + 'img/ajax-loader.gif'; - $scope.$on('cesium_position_clicked', function(event, data) { - $scope.points.push({ - lon: data[0].toFixed(2), - lat: data[1].toFixed(2), - ix: $scope.points.length - }); - service.src.addFeatures([new ol.Feature({ - geometry: new ol.geom.Point(ol.proj.transform([data[0], data[1]], 'EPSG:4326', OlMap.map.getView().getProjection().getCode())), - ix: $scope.points.length - 1 - })]); - service.src.dispatchEvent('features:loaded', service.src); - if (!$scope.$$phase) $scope.$apply(); - }); - - $scope.getCrossings = function() { - $scope.loading = true; - service.getCrossings($scope.points, function() { - $scope.loading = false; - if (!$scope.$$phase) $scope.$apply(); - }) - }; - - $scope.clear = function() { - $scope.points = []; - service.src.clear(); - service.src.dispatchEvent('features:loaded', service.src); - } - - $scope.$emit('scope_loaded', "Sentinel"); - } - ]); - }) diff --git a/examples/databio/sentineldirective.html b/examples/databio/sentineldirective.html deleted file mode 100755 index 81f3b26a28..0000000000 --- a/examples/databio/sentineldirective.html +++ /dev/null @@ -1,30 +0,0 @@ -
-
Sentinel watcher - -
- -
-
- Map based web application for identifying of usable remote sensing data from Sentinel satellites. Right click or double click on the map to choose one or multiple positions (for example fields, forests etc.) and the application prepare a forecast based on location, minimal satellite elevation and minimal crossing duration for Sentinel 2A and 2B satellites. The application calculates timetable of satellites crossing time and weather (clouds) forecast as a result. User gets information when his selected position(s) can be photographed and which imagery can be used for further processing. -
    -
  • -
    #{{point.ix}} at {{point.lat}}°N {{point.lon}}°E - - - -
    SnStartUTCMaxUTCEndUTCWeather
    {{cros.sn}}{{cros.startUTC}}{{cros.maxUTC}}{{cros.endUTC}}
    -
    -
  • - - -
-
-
-
diff --git a/examples/databio/sentineltoolbar.html b/examples/databio/sentineltoolbar.html deleted file mode 100755 index 80b8abdfcb..0000000000 --- a/examples/databio/sentineltoolbar.html +++ /dev/null @@ -1,4 +0,0 @@ - - - Sentinel watcher - diff --git a/examples/databio/soils.js b/examples/databio/soils.js deleted file mode 100644 index e0a2bed69f..0000000000 --- a/examples/databio/soils.js +++ /dev/null @@ -1,171 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - entity.polygon.material = new Cesium.Color.fromCssColorString('rgba(237, 189, 113, 0.6)'); - var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions; - var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center; - polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter); - entity.position = polyCenter; - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.code.getValue(), - font: '16px Helvetica', - fillColor: Cesium.Color.WHITE, - outlineColor: Cesium.Color.BLACK, - showBackground: true, - style: Cesium.LabelStyle.FILL, - distanceDisplayCondition: new Cesium.DistanceDisplayCondition(10.0, 10000.0), - disableDepthTestDistance: Number.POSITIVE_INFINITY, - scaleByDistance: new Cesium.NearFarScalar(500, 1, 20000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND - }) - entity.styled = true; - //entity.onclick = entityClicked - } - } - - var me = { - get: function(map, utils, rect) { - if (map.getView().getResolution() > lyr.getMaxResolution() || lyr.getVisible() == false) return; - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX olu: - PREFIX common: - - - SELECT DISTINCT ?plot ?soilType ?code ?shortId ?landUse ?coordPlotFinal - FROM - WHERE { - ?plot a foodie:Plot ; - foodie:code ?code ; - foodie-cz:shortId ?shortId ; - olu:specificLandUse ?landUse ; - geo:hasGeometry ?geoPlotFinal . - ?geoPlotFinal ogcgs:asWKT ?coordPlotFinal . - FILTER(bif:st_intersects(?coordPlotFinal, ?coordSoil)) . - GRAPH ?graph1 { - SELECT ?soil (?label as ?soilType) ?codeSoil ?description ?link ?coordSoil - FROM - WHERE { - ?soil a foodie:Plot ; - geo:hasGeometry ?geoSoil . - optional {?soil rdfs:label ?label }. - optional {?soil foodie:code ?codeSoil }. - optional {?soil common:link ?link }. - optional {?soil foodie:description ?description }. - ?geoSoil ogcgs:asWKT ?coordSoil . - FILTER(STRSTARTS(STR(?label),"${$scope.soilType}") ). - FILTER(bif:st_intersects (?coordSoil, bif:st_geomFromText("${extents}"))) . - } - } - } - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordPlotFinal', response, 'code', { - plot: 'plot', - shortId: 'shortId', - code: 'code', - soilType: 'soilType' - }, map, $scope, $scope) - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Fields with soil type"), - maxResolution: 4.777314267823516, - source: src, - visible: false, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(237, 189, 113, 0.6)', - width: 2 - }), - fill: new ol.style.Fill({ - color: 'rgba(237, 189, 113, 0.8)' - }) - }) - ]; - } - }); - return lyr; - }, - fillClassificators() { - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(`PREFIX foodie-cz: - PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX poi: - PREFIX rdfs: - PREFIX foodie-cz: - PREFIX foodie: - PREFIX olu: - PREFIX common: - - SELECT DISTINCT ?label - FROM - WHERE { - ?soil a foodie:Plot . - optional {?soil rdfs:label ?label }. - } - - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function(response) { - $scope.soilTypes = response.results.bindings.map(function(r) { - return r.label.value; - }) - }) - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - me.fillClassificators(); - } - } - return me; - } -) diff --git a/examples/databio/sparql_helpers.js b/examples/databio/sparql_helpers.js deleted file mode 100644 index 8575f974f1..0000000000 --- a/examples/databio/sparql_helpers.js +++ /dev/null @@ -1,76 +0,0 @@ -define(['ol'], - - function(ol) { - - var me = { - fillFeatures: function(src, geom_name, response, id_field, attrs, map, $scope) { - if (angular.isUndefined(response.results)) return; - var features = []; - var format = new ol.format.WKT(); - src.getFeatures().forEach(function(feature) { - feature._flaged_for_removal = true; - }) - for (var i = 0; i < response.results.bindings.length; i++) { - try { - var b = response.results.bindings[i]; - if (b[geom_name].datatype == "http://www.openlinksw.com/schemas/virtrdf#Geometry" && b[geom_name].value.indexOf('e+') == -1 && b[geom_name].value.indexOf('e-') == -1) { - if (src.getFeatureById(b[id_field].value) == null) { - var g_feature = format.readFeature(b[geom_name].value.toUpperCase()); - var geom_transformed = g_feature.getGeometry().transform('EPSG:4326', map.getView().getProjection()); - var fields = { - geometry: geom_transformed - }; - for (key in attrs) { - if (typeof b[attrs[key]] == 'undefined') { - console.error('Missing key', key); - } else { - fields[key] = b[attrs[key]].value; - } - } - var feature = new ol.Feature(fields); - feature.setId(b[id_field].value); - features.push(feature); - } else { - src.getFeatureById(b[id_field].value)._flaged_for_removal = false; - } - } - } catch (ex) { - console.log(ex); - } - } - src.addFeatures(features); - src.getFeatures().forEach(function(feature) { - if (feature._flaged_for_removal) src.removeFeature(feature); - }) - me.completeLoading(src, $scope); - }, - startLoading(src, $scope) { - src.set('loaded', false); - src.loaded = false; - if (!$scope.$$phase) $scope.$apply(); - }, - completeLoading(src, $scope) { - src.set('loaded', true); - src.loaded = true; - if (!$scope.$$phase) $scope.$apply(); - src.dispatchEvent('features:loaded', src); - }, - zoomToFetureExtent(src, camera, map) { - if (src.getFeatures().length > 0) { - var extent = src.getFeatures()[0].getGeometry().getExtent().slice(0); - src.getFeatures().forEach(function(feature) { - ol.extent.extend(extent, feature.getGeometry().getExtent()) - }); - extent = ol.proj.transformExtent(extent, map.getView().getProjection(), 'EPSG:4326'); - camera.flyTo({ - destination: Cesium.Rectangle.fromDegrees(extent[0], extent[1], extent[2], extent[3]) - }) - } - - } - } - return me; - - } - -) diff --git a/examples/databio/template.pot b/examples/databio/template.pot deleted file mode 100644 index 7dca4b2f41..0000000000 --- a/examples/databio/template.pot +++ /dev/null @@ -1,185 +0,0 @@ -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Project-Id-Version: \n" - -#: examples/databio/about.html:7 -msgid "About Databio pilot" -msgstr "" - -#: examples/databio/hud.html:17 -msgid "Actions:" -msgstr "" - -#: examples/databio/hud.html:191 -#: examples/databio/hud.html:82 -msgid "CTVDPB" -msgstr "" - -#: examples/databio/sentineldirective.html:26 -msgid "Clear" -msgstr "" - -#: examples/databio/about.html:5 -#: examples/databio/info.html:5 -#: examples/databio/sentineldirective.html:5 -msgid "Close" -msgstr "" - -#: examples/databio/hud.html:128 -#: examples/databio/hud.html:153 -msgid "Crop type" -msgstr "" - -#: examples/databio/hud.html:73 -msgid "Crop types for fields with CTVDPB code" -msgstr "" - -#: examples/databio/hud.html:96 -msgid "Crop types for fields with LPIS ID" -msgstr "" - -#: examples/databio/hud.html:159 -msgid "Distance in km" -msgstr "" - -#: examples/databio/hud.html:36 -msgid "Distance to water bodies in km" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "EndUTC" -msgstr "" - -#: examples/databio/erosion_zones.js:146 -msgid "Erosion zones" -msgstr "" - -#: examples/databio/parcels_with_id.js:164 -msgid "Fields by ID_UZ attribute from LPIS db" -msgstr "" - -#: examples/databio/parcels_with_crop_types.js:103 -msgid "Fields by crop types" -msgstr "" - -#: examples/databio/parcels_with_crop_types_by_distance.js:103 -msgid "Fields by crop types and distance" -msgstr "" - -#: examples/databio/parcels_with_CTVDPB.js:84 -msgid "Fields filtered by CTVDPD code" -msgstr "" - -#: examples/databio/soils.js:103 -msgid "Fields with soil type" -msgstr "" - -#: examples/databio/hud.html:109 -#: examples/databio/hud.html:134 -#: examples/databio/hud.html:163 -#: examples/databio/hud.html:195 -#: examples/databio/hud.html:220 -#: examples/databio/hud.html:40 -#: examples/databio/hud.html:63 -#: examples/databio/hud.html:86 -msgid "Filter" -msgstr "" - -#: examples/databio/hud.html:144 -msgid "Filter fields by crop and distance to map center" -msgstr "" - -#: examples/databio/hud.html:205 -msgid "Filter fields by soil type in area" -msgstr "" - -#: examples/databio/hud.html:28 -msgid "Filter fields which are near water" -msgstr "" - -#: examples/databio/hud.html:173 -msgid "Find erosion zones" -msgstr "" - -#: examples/databio/hud.html:119 -msgid "Find fields with crop type in area" -msgstr "" - -#: examples/databio/sentineltoolbar.html:1 -msgid "Get Sentinel satellite crossings" -msgstr "" - -#: examples/databio/hud.html:105 -msgid "ID" -msgstr "" - -#: examples/databio/hud.html:59 -msgid "ID Uz" -msgstr "" - -#: examples/databio/hud.html:182 -msgid "LPIS FARM ID (ID_UZ)" -msgstr "" - -#: examples/databio/hud.html:50 -msgid "Land usage for fields with LPIS ID" -msgstr "" - -#: examples/databio/sentineldirective.html:15 -msgid "Map based web application for identifying of usable remote sensing data from Sentinel satellites. Right click or double click on the map to choose one or multiple positions (for example fields, forests etc.) and the application prepare a forecast based on location, minimal satellite elevation and minimal crossing duration for Sentinel 2A and 2B satellites. The application calculates timetable of satellites crossing time and weather (clouds) forecast as a result. User gets information when his selected position(s) can be photographed and which imagery can be used for further processing." -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "MaxUTC" -msgstr "" - -#: examples/databio/parcels_near_water.js:101 -msgid "Plots intersecting water bodies" -msgstr "" - -#: examples/databio/sentineldirective.html:2 -#: examples/databio/sentineltoolbar.html:3 -msgid "Sentinel watcher" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "Sn" -msgstr "" - -#: examples/databio/hud.html:214 -msgid "Soil type" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "StartUTC" -msgstr "" - -#: examples/databio/water_bodies.js:70 -msgid "Water bodies" -msgstr "" - -#: examples/databio/sentineldirective.html:20 -msgid "Weather" -msgstr "" - -#: examples/databio/sentineldirective.html:18 -msgid "at" -msgstr "" - -#: examples/databio/hud.html:84 -msgid "code eg. 57011607501" -msgstr "" - -#: examples/databio/hud.html:61 -msgid "e.g. 17614" -msgstr "" - -#: examples/databio/hud.html:193 -msgid "e.g. 57011607501" -msgstr "" - -#: examples/databio/hud.html:107 -msgid "e.g. 6423" -msgstr "" diff --git a/examples/databio/water_bodies.js b/examples/databio/water_bodies.js deleted file mode 100644 index 63593e04f1..0000000000 --- a/examples/databio/water_bodies.js +++ /dev/null @@ -1,102 +0,0 @@ -define(['ol', 'sparql_helpers'], - - function(ol, sparql_helpers) { - var src = new ol.source.Vector(); - var $scope; - var $compile; - var map; - var utils; - var lyr; - var selected_entity; - - function entityClicked(entity) { - if (selected_entity) selected_entity.polygon.material.color = entity.original_color; - selected_entity = entity; - entity.polygon.material.color = new Cesium.Color.fromCssColorString('rgba(250, 250, 250, 0.6)'); - } - - src.cesiumStyler = function(dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - entity.polygon.outline = false; - entity.original_color = new Cesium.Color.fromCssColorString('rgb(31, 90, 186)'); - entity.polygon.material = new Cesium.ColorMaterialProperty(entity.original_color); - entity.styled = true; - entity.onmouseup = entityClicked - } - } - - var me = { - get: function(map, utils, rect) { - if (map.getView().getResolution() > lyr.getMaxResolution() || lyr.getVisible() == false) return; - - function prepareCords(c) { - return c.toString().replaceAll(',', ' ') - } - var extents = `POLYGON ((${prepareCords(rect[0])}, ${prepareCords(rect[1])}, ${prepareCords(rect[2])}, ${prepareCords(rect[3])}, ${prepareCords(rect[0])}, ${prepareCords(rect[1])}))`; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(` - -PREFIX geo: -PREFIX geof: -PREFIX virtrdf: -PREFIX poi: -PREFIX rdfs: -PREFIX foodie-cz: -PREFIX foodie: -PREFIX olu: - -SELECT ?waterBody ?label ?coordWBody -FROM -WHERE { - ?waterBody a foodie-cz:WaterBody ; - rdfs:label ?label ; - geo:hasGeometry ?geoWBody . - ?geoWBody ogcgs:asWKT ?coordWBody . -FILTER(bif:st_intersects (?coordWBody, bif:st_geomFromText("${extents}"))) . -} - `) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - sparql_helpers.startLoading(src, $scope); - $.ajax({ - url: q - }) - .done(function(response) { - sparql_helpers.fillFeatures(src, 'coordWBody', response, 'waterBody', { - waterBody: 'waterBody', - label: 'label' - }, map, $scope) - }) - }, - createLayer: function(gettext) { - lyr = new ol.layer.Vector({ - title: gettext("Water bodies"), - source: src, - visible: false, - maxResolution: 4.777314267823516 * 8, - style: function(feature, resolution) { - return [ - new ol.style.Style({ - fill: new ol.style.Stroke({ - color: 'rgba(0, 0, 220, 0.8)' - }) - }) - ]; - } - }); - return lyr; - }, - getLayer() { - return lyr; - }, - init: function(_$scope, _$compile, _map, _utils) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - } - } - return me; - } -) diff --git a/examples/databiocc/app.js b/examples/databiocc/app.js deleted file mode 100755 index f4a02837af..0000000000 --- a/examples/databiocc/app.js +++ /dev/null @@ -1,373 +0,0 @@ -'use strict'; - -define(['ol', 'toolbar', 'moment-interval', 'moment', 'layermanager', 'geojson', 'sidebar', 'query', 'search', 'print', 'permalink', 'measure', 'geolocation', 'api', 'hscesium', 'ows', 'datasource_selector', 'bootstrap'], - - function (ol, toolbar, momentinterval, moment, layermanager, geojson) { - var module = angular.module('hs', [ - 'hs.toolbar', - 'hs.layermanager', - 'hs.query', - 'hs.search', 'hs.print', 'hs.permalink', - 'hs.datasource_selector', - 'hs.geolocation', - 'hs.cesium', - 'hs.sidebar', - 'hs.ows' - ]); - - module.directive('hs', ['hs.map.service', 'Core', '$compile', '$timeout', function (OlMap, Core, $compile, $timeout) { - return { - templateUrl: hsl_path + 'hslayers.html', - link: function (scope, element) { - $timeout(function () { Core.fullScreenMap(element) }, 0); - } - }; - }]); - - module.directive('hs.hud', function () { - return { - templateUrl: './hud.html?bust=' + gitsha, - link: function (scope, element, attrs) { - - } - }; - }); - - function getHostname() { - var url = window.location.href - var urlArr = url.split("/"); - var domain = urlArr[2]; - return urlArr[0] + "//" + domain; - }; - - function prepareTimeSteps(step_string) { - var step_array = step_string.split(','); - var steps = []; - for (var i = 0; i < step_array.length; i++) { - if (step_array[i].indexOf('/') == -1) { - steps.push(new Date(step_array[i])); - //console.log(new Date(step_array[i]).toISOString()); - } else { - //"2016-03-16T12:00:00.000Z/2016-07-16T12:00:00.000Z/P30DT12H" - var interval_def = step_array[i].split('/'); - var step = moment.interval(interval_def[2]); - var interval = moment.interval(interval_def[0] + '/' + interval_def[1]); - while (interval.start() <= interval.end()) { - //console.log(interval.start().toDate().toISOString()); - steps.push(interval.start().toDate()); - interval.start(moment.utc(interval.start().toDate()).add(step.period())); - } - } - } - return steps; - } - - var layers = [ - new ol.layer.Tile({ - source: new ol.source.OSM(), - title: "OpenStreetMap", - base: true, - visible: false, - minimumTerrainLevel: 15 - }),/* - new ol.layer.Image({ - title: "Road segments of Open Transport Map vizualized by their average daily traffic volumes", - source: new ol.source.ImageWMS({ - url: 'https://intenzitadopravy.plzen.eu/wms-t', - params: { - LAYERS: 'may', - VERSION: '1.3.0', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - time: '2018-03-28T09:00:00.000Z', - minimumTerrainLevel: 12 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/wms/transport/open_transport_map?service=WMS&request=GetLegendGraphic&layer=roads__traffic_volumes&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }),*/ - ]; - - layers.push(new ol.layer.Image({ - title: 'Latest temperature', - source: new ol.source.ImageWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/copernicus_marine.map', - params: { - LAYERS: 'temperature', - VERSION: '1.3.0', - FORMAT: "image/png", - INFO_FORMAT: "text/html" - }, - crossOrigin: null - }), - legends: [`http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/copernicus_marine.map?REQUEST=GetLegendGraphic&LAYER=temperature`], - visible: true, - opacity: 0.7, - })); - - var caps = $.ajax({ - type: "GET", - url: '/cgi-bin/hsproxy.cgi?url='+encodeURIComponent('http://nrt.cmems-du.eu/thredds/wms/global-analysis-forecast-phy-001-024?service=WMS&request=GetCapabilities'), - async: false - }).responseText; - - var depths = '-0.49402499198913574,-1.5413750410079956,-2.6456689834594727,-3.8194949626922607,-5.078224182128906,-6.440614223480225,-7.92956018447876,-9.572997093200684,-11.404999732971191,-13.467140197753906,-15.810070037841797,-18.495559692382812,-21.598819732666016,-25.211410522460938,-29.444730758666992,-34.43415069580078,-40.344051361083984,-47.37369155883789,-55.76428985595703,-65.80726623535156,-77.85385131835938,-92.3260726928711,-109.72930145263672,-130.66600036621094,-155.85069274902344,-186.12559509277344,-222.47520446777344,-266.0403137207031,-318.1274108886719,-380.2130126953125,-453.9377136230469,-541.0889282226562,-643.5667724609375,-763.3331298828125,-902.3392944335938,-1062.43994140625,-1245.291015625,-1452.2509765625,-1684.2840576171875,-1941.8929443359375,-2225.077880859375,-2533.3359375,-2865.702880859375,-3220.820068359375,-3597.031982421875,-3992.48388671875,-4405.22412109375,-4833.291015625,-5274.7841796875,-5727.9169921875'; - - angular.forEach([ - { - title: "Density ocean mixed layer thickness", - layer: 'mlotst', - style: 'boxfill/ferret', - palette: 'ferret' - }, - { - title: "Sea surface height", - layer: 'zos', - style: 'boxfill/ncview', - palette: 'ncview' - }, - { - title: "Sea floor potential temperature", - layer: 'bottomT', - style: 'boxfill/occam', - palette: 'occam' - }, - { - title: "Sea ice thickness", - layer: 'sithick', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Ice concentration", - layer: 'siconc', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Temperature", - layer: 'thetao', - style: 'boxfill/rainbow', - palette: 'rainbow', - elevation: depths - }, - { - title: "Salinity", - layer: 'so', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Automatically-generated sea ice velocity vector field", - layer: 'sea_ice_velocity', - style: 'boxfill/rainbow', - palette: 'rainbow' - } - ], function (def) { - var timeInterval = $("Layer Name:contains('" + def.layer + "')", caps).parent().find('Dimension[name="time"]').html(); - var timeSteps = prepareTimeSteps(timeInterval); - var elevations; - if($("Layer Name:contains('" + def.layer + "')", caps).parent().find('Dimension[name="elevation"]').length > 0) - elevations = $("Layer Name:contains('" + def.layer + "')", caps).parent().find('Dimension[name="elevation"]').html(); - layers.push(new ol.layer.Image({ - title: def.title, - source: new ol.source.ImageWMS({ - url: 'http://nrt.cmems-du.eu/thredds/wms/global-analysis-forecast-phy-001-024?', - params: { - LAYERS: def.layer, - VERSION: '1.3.0', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - time: timeSteps[timeSteps.length - 1].toISOString(), - STYLE: def.style - }, - crossOrigin: null - }), - legends: [`http://nrt.cmems-du.eu/thredds/wms/global-analysis-forecast-phy-001-024?REQUEST=GetLegendGraphic&LAYER=${def.layer}&PALETTE=${def.palette}`], - dimensions: { - time: {name: 'time', values: timeSteps }, - elevation: def.elevation ? { name: 'elevation', label: 'depth', values: elevations.split(',') } : undefined - }, - visible: def.visible || false, - opacity: 0.7, - path: 'Daily mean fields from Global Ocean Physics Analysis and Forecast, updated daily GLOBAL_ANALYSIS_FORECAST_PHY_001_024' - })); - }); - - caps = $.ajax({ - type: "GET", - url: '/cgi-bin/hsproxy.cgi?url='+encodeURIComponent('http://nrt.cmems-du.eu/thredds/wms/dataset-global-analysis-forecast-bio-001-014?service=WMS&request=GetCapabilities'), - async: false - }).responseText; - - angular.forEach([ - { - title: "Mole Concentration of Dissolved iron in Sea Water", - layer: 'Fe', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mole Concentration of Nitrate in Sea Water", - layer: 'NO3', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mole Concentration of Dissolved Oxygen in Sea Water", - layer: 'O2', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mole Concentration of Phosphate in Sea Water", - layer: 'PO4', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mole Concentration of Silicate in Sea Water", - layer: 'Si', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Net Primary Productivity of Carbon Per Unit Volume", - layer: 'PP', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mass Concentration of Chlorophyll in Sea Water", - layer: 'CHL', - style: 'boxfill/rainbow', - palette: 'rainbow' - }, - { - title: "Mole Concentration of Phytoplankton expressed as carbon in sea water", - layer: 'PHYC', - style: 'boxfill/rainbow', - palette: 'rainbow' - } - - ], function (def) { - var timeInterval = $("Layer Name:contains('" + def.layer + "')", caps).parent().find('Dimension[name="time"]').html(); - var timeSteps = prepareTimeSteps(timeInterval); - layers.push(new ol.layer.Image({ - title: def.title, - source: new ol.source.ImageWMS({ - url: 'http://nrt.cmems-du.eu/thredds/wms/dataset-global-analysis-forecast-bio-001-014', - params: { - LAYERS: def.layer, - VERSION: '1.3.0', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - time: timeSteps[timeSteps.length - 1].toISOString(), - STYLE: def.style - }, - crossOrigin: null - }), - legends: [`http://nrt.cmems-du.eu/thredds/wms/dataset-global-analysis-forecast-bio-001-014?REQUEST=GetLegendGraphic&LAYER=${def.layer}&PALETTE=${def.palette}`], - dimensions: { time: {name: 'time', values: timeSteps }}, - visible: def.visible || false, - opacity: 0.7, - path: 'Weekly mean fields from Global Ocean Biogeochemistry Analysis GLOBAL_ANALYSIS_FORECAST_BIO_001_014' - })); - }); - - module.value('config', { - cesiumTimeline: true, - cesiumAnimation: true, - terrain_provider: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - terrain_providers: [{ - title: 'Local terrain', - url: 'http://gis.lesprojekt.cz/cts/tilesets/rostenice_dmp1g/', - active: false - }, { - title: 'EU-DEM', - url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - active: true - }], - default_layers: layers, - project_name: 'erra/map', - hostname: { - "default": { - "title": "Default", - "type": "default", - "editable": false, - "url": getHostname() - } - }, - 'catalogue_url': "/php/metadata/csw", - 'compositions_catalogue_url': "/php/metadata/csw", - status_manager_url: '/wwwlibs/statusmanager2/index.php', - default_view: new ol.View({ - center: ol.proj.transform([1208534.8815206578, 5761821.705531779], 'EPSG:3857', 'EPSG:4326'), - zoom: 5, - units: "m", - projection: 'EPSG:4326' - }) - }); - - module.controller('Main', ['$scope', '$compile', '$element', 'Core', 'hs.map.service', 'config', '$rootScope', 'hs.utils.service', '$sce', - function ($scope, $compile, $element, Core, hs_map, config, $rootScope, utils, $sce) { - var map; - - $scope.hsl_path = hsl_path; //Get this from hslayers.js file - $scope.Core = Core; - - Core.singleDatasources = true; - Core.panelEnabled('compositions', true); - Core.panelEnabled('status_creator', false); - $scope.Core.setDefaultPanel('layermanager'); - $scope.depths = depths.split(','); - - function createHud() { - var el = angular.element('
'); - $(".page-content").append(el); - $compile(el)($scope); - } - - $rootScope.$on('map.loaded', function () { - map = hs_map.map; - }); - - $rootScope.$on('map.sync_center', function (e, center, bounds) { - - }) - - $rootScope.$on('cesiummap.loaded', function (e, viewer, HsCesium) { - viewer.targetFrameRate = 30; - viewer.timeline.zoomTo(Cesium.JulianDate.fromDate(new Date('2016-01-01')), Cesium.JulianDate.fromDate(new Date())); - setTimeout(createHud, 3000); - $scope.$watch('current_depth', function () { - for (var i = 0; i < viewer.imageryLayers.length; i++) { - var layer = viewer.imageryLayers.get(i); - if (angular.isUndefined(layer.prm_cache) || angular.isUndefined(layer.prm_cache.dimensions) || angular.isUndefined(layer.prm_cache.dimensions.elevation)) continue; - HsCesium.HsCsLayers.changeLayerParam(layer, 'elevation', $scope.current_depth); - HsCesium.HsCsLayers.removeLayersWithOldParams(); - } - }); - }); - - $rootScope.$on('cesium.time_layers_changed', function (e, time_layers) { - $scope.time_layers = time_layers; - if (!$scope.$$phase) $scope.$apply(); - angular.element('.hud .layerlist').show(); - if ($scope.timeFader) { - clearTimeout($scope.timeFader); - } - $scope.timeFader = setTimeout(function () { - angular.element('.hud .layerlist').fadeOut(); - }, 5000) - }) - - $scope.$on('infopanel.updated', function (event) { }); - } - ]); - - return module; - }); diff --git a/examples/databiocc/hslayers.js b/examples/databiocc/hslayers.js deleted file mode 100755 index 30a6588b52..0000000000 --- a/examples/databiocc/hslayers.js +++ /dev/null @@ -1,38 +0,0 @@ -'use strict'; - -var hsl_path = '../../'; -var gitsha = ''; - -require.config({ - urlArgs: 'bust=' + gitsha, - paths: { - toolbar: hsl_path + 'components/toolbar/toolbar', - layermanager: hsl_path + 'components/layermanager/layermanager', - map: hsl_path + 'components/map/map', - query: hsl_path + 'components/query/query', - search: hsl_path + 'components/search/search', - print: hsl_path + 'components/print/print', - permalink: hsl_path + 'components/permalink/permalink', - geolocation: hsl_path + 'components/geolocation/geolocation', - measure: hsl_path + 'components/measure/measure', - legend: hsl_path + 'components/legend/legend', - app: 'app', - core: hsl_path + 'components/core/core', - api: hsl_path + 'components/api/api', - translations: hsl_path + 'components/translations/js/translations', - hscesium: hsl_path + 'components/hscesium/hscesium', - pois: 'poi' - } -}); - -//http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap -window.name = "NG_DEFER_BOOTSTRAP!"; - -require(['core'], function(app) { - require(['app'], function(app) { - var $html = angular.element(document.getElementsByTagName('html')[0]); - angular.element().ready(function() { - angular.resumeBootstrap([app['name']]); - }); - }); -}); diff --git a/examples/databiocc/hud.html b/examples/databiocc/hud.html deleted file mode 100644 index 14c3757648..0000000000 --- a/examples/databiocc/hud.html +++ /dev/null @@ -1,58 +0,0 @@ -
- -
- - - - - -
{{time_layer.name}}{{time_layer.time}}
-
- -
-
-
- -
- -
-
-
-
-
\ No newline at end of file diff --git a/examples/databiocc/index.html b/examples/databiocc/index.html deleted file mode 100755 index f2c077a311..0000000000 --- a/examples/databiocc/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - HS Layers - - - - - - - - -
- - - - - - diff --git a/examples/rogainonline/app.js b/examples/rogainonline/app.js deleted file mode 100755 index 13964c9716..0000000000 --- a/examples/rogainonline/app.js +++ /dev/null @@ -1,419 +0,0 @@ -'use strict'; - -define(['ol', 'toolbar', 'layermanager', 'geojson', 'pois', 'olus', 'stations', 'character', 'sidebar', 'query', 'print', 'permalink', 'measure', 'geolocation', 'api', 'hscesium', 'ows', 'bootstrap'], - - function (ol, toolbar, layermanager, geojson, pois, olus, stations, character) { - var module = angular.module('hs', [ - 'hs.layermanager', - 'hs.query', - 'hs.print', 'hs.permalink', - 'hs.geolocation', - 'hs.cesium', - 'hs.sidebar' - ]); - - module.directive('hs', ['hs.map.service', 'Core', '$compile', '$timeout', function (OlMap, Core, $compile, $timeout) { - return { - templateUrl: hsl_path + 'hslayers.html', - link: function (scope, element) { - $timeout(function () { Core.fullScreenMap(element) }, 0); - } - }; - }]); - - module.directive('hs.enddialog', function () { - function link(scope, element, attrs) { - setTimeout(function () { - $('#end-dialog').modal('show'); - }, 1500); - } - return { - templateUrl: './end.html?bust=' + gitsha, - link: link - }; - }); - - module.directive('hs.hud', function () { - return { - templateUrl: './hud.html?bust=' + gitsha, - link: function (scope, element, attrs) { - - } - }; - }) - - - module.directive('hs.foodiezones.infoDirective', function () { - return { - templateUrl: './info.html?bust=' + gitsha, - link: function (scope, element, attrs) { - $('#zone-info-dialog').modal('show'); - } - }; - }) - - module.directive('description', ['$compile', 'hs.utils.service', function ($compile, utils) { - return { - templateUrl: './description.html?bust=' + gitsha, - scope: { - object: '=', - url: '@' - }, - link: function (scope, element, attrs) { - scope.describe = function (e, attribute) { - if (angular.element(e.target).parent().find('table').length > 0) { - angular.element(e.target).parent().find('table').remove(); - } else { - var table = angular.element('
'); - angular.element(e.target).parent().append(table); - $compile(table)(scope.$parent); - } - } - if (angular.isUndefined(scope.object) && angular.isDefined(attrs.url) && typeof attrs.url == 'string') { - scope.object = { attributes: [] }; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent('describe <' + attrs.url + '>') + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - $.ajax({ - url: utils.proxify(q) - }) - .done(function (response) { - if (angular.isUndefined(response.results)) return; - for (var i = 0; i < response.results.bindings.length; i++) { - var b = response.results.bindings[i]; - var short_name = b.p.value; - if (short_name.indexOf('#') > -1) - short_name = short_name.split('#')[1]; - scope.object.attributes.push({ short_name: short_name, value: b.o.value }); - if (!scope.$$phase) scope.$apply(); - } - }) - } - } - }; - }]); - - module.value('config', { - terrain_provider: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - terrain_providers: [{ - title: 'EU-DEM', - url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - active: true - }], - default_layers: [ - new ol.layer.Tile({ - source: new ol.source.OSM(), - title: "OpenStreetMap", - base: true, - visible: false, - minimumTerrainLevel: 15 - }), - //pois.createPoiLayer(), - olus.createOluLayer(), - stations.createLayer() - ], - default_view: new ol.View({ - center: ol.proj.transform([1208534.8815206578, 5761821.705531779], 'EPSG:3857', 'EPSG:4326'), - zoom: 16, - units: "m", - projection: 'EPSG:4326' - }) - }); - - module.controller('Main', ['$scope', '$compile', '$element', 'Core', 'hs.map.service', 'config', '$rootScope', 'hs.utils.service', '$sce', '$timeout', 'hs.geolocation.service', - function ($scope, $compile, $element, Core, hs_map, config, $rootScope, utils, $sce, $timeout, geolocation) { - var map; - var viewer; - var last_time = 0; - var last_hud_updated = 0; - var last_run_counted = 0; - var zero_date = new Date(2000, 1, 0, 0, 0, 0, 0, 1); - var full_date = new Date(2000, 1, 0, 4, 30, 0, 0); - var running_start_date = new Date(2000, 1, 0, 4, 0, 0, 0); - var time_game_started; - var last_measure_pick, last_run_position = null; - var planning_line_segments = []; - var running_line_segments = []; - - $scope.hsl_path = hsl_path; //Get this from hslayers.js file - $scope.Core = Core; - Core.singleDatasources = true; - Core.panelEnabled('compositions', false); - Core.panelEnabled('status_creator', false); - Core.panelEnabled('print', false); - $scope.Core.setDefaultPanel('layermanager'); - Core.sidebarExpanded = false; - Core.classicSidebar = false; - $scope.time_remaining = new Date(2000, 1, 0, 4, 30, 0, 0); - $scope.points_collected = 0; - pois.init($scope, $compile); - stations.init($scope, $compile, olus); - $scope.game_state = 'before_game'; - $scope.game_mode = 'virtual'; - $scope.time_penalty = 0; - $scope.ajax_loader = hsl_path + 'img/ajax-loader.gif'; - $scope.time_multiplier = 10; - - function createHud() { - var el = angular.element('
'); - $(".page-content").append(el); - $compile(el)($scope); - } - - function disableRightMouse(scene) { - var screenSpaceEventHandler = viewer.screenSpaceEventHandler; - screenSpaceEventHandler.setInputAction(function () { - scene.screenSpaceCameraController.enableZoom = false; - }, Cesium.ScreenSpaceEventType.RIGHT_DOWN); - - screenSpaceEventHandler.setInputAction(function () { - scene.screenSpaceCameraController.enableZoom = true; - }, Cesium.ScreenSpaceEventType.RIGHT_UP); - } - - function tick(timestamp) { - if (timestamp) { - var time_ellapsed = timestamp - last_time; - if ($scope.game_started) { - $scope.time_remaining = full_date - (timestamp - time_game_started) * $scope.time_multiplier; - if ($scope.time_remaining <= running_start_date && $scope.game_state == 'planning') { - $scope.game_state = 'running'; - character.flyToInitialLocation(); - playGo(); - } - if ($scope.time_remaining <= zero_date) { - $scope.time_remaining = zero_date; - $scope.time_penalty = Math.ceil((zero_date - (full_date - (timestamp - time_game_started) * $scope.time_multiplier)) / 60000); - } - } - - character.positionCharacter(time_ellapsed, timestamp); - last_time = timestamp; - updHud(); - if ($scope.game_state == 'running') { - countRunDistance() - } - } - Cesium.requestAnimationFrame(tick); - } - - function updHud() { - if (last_time - last_hud_updated < 500) return; - last_hud_updated = last_time; - if (!$scope.$$phase) $scope.$apply(); - } - - function countRunDistance() { - if (last_time - last_run_counted < 1000) return; - last_run_counted = last_time; - addRunPosition(character.currentPos()); - } - - createHud(); - - $scope.createNewMap = function (hours) { - $scope.game_started = true; - $scope.game_state = 'generating'; - if (!$scope.$$phase) $scope.$apply(); - $timeout(function () { - $scope.points_collected = 0; - full_date = new Date(2000, 1, 0, hours, 30, 0, 0); - running_start_date = new Date(2000, 1, 0, hours, 0, 0, 0); - time_game_started = last_time; - stations.createStations(map, utils, character.currentPos(), function (bounds) { - $scope.game_state = 'planning'; - last_measure_pick = character.currentPos(); - flyToWholeMapView(hours, bounds); - }, hours); - }, 0) - } - - function flyToWholeMapView(hours, bounds) { - var pos_lon_lat = character.currentPos(); - var needed = viewer.camera.getRectangleCameraCoordinates(new Cesium.Rectangle.fromDegrees(bounds.west, bounds.south, bounds.east, bounds.north)); - viewer.camera.flyTo({ - destination: needed, - orientation: { - heading: Cesium.Math.toRadians(0.0), - pitch: Cesium.Math.toRadians(-90.0), - roll: 0.0 - } - }) - } - - $rootScope.$on('cesium_position_clicked', function (event, lon_lat) { - if (last_measure_pick == null) - last_measure_pick = character.currentPos(); - if ($scope.game_state == 'running') { - character.changeTargetPosition(lon_lat, last_time); - } - if ($scope.game_state == 'planning') { - addMeasurementPosition(lon_lat); - } - }); - - $scope.total_distance = 0; - function addMeasurementPosition(lon_lat) { - var distance = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(last_measure_pick[0], last_measure_pick[1]), Cesium.Cartesian3.fromDegrees(lon_lat[0], lon_lat[1])); - $scope.total_distance += distance; - var rectangleInstance = new Cesium.GeometryInstance({ - geometry: new Cesium.CorridorGeometry({ - positions: Cesium.Cartesian3.fromDegreesArray([last_measure_pick[0], last_measure_pick[1], lon_lat[0], lon_lat[1]]), - width: 5 - }), - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute(0.9, .2, .2, 0.8) - } - }); - var line = viewer.scene.primitives.add(new Cesium.GroundPrimitive({ - geometryInstances: rectangleInstance - })); - line.distance = distance; - planning_line_segments.push(line); - last_measure_pick = lon_lat; - } - - function addRunPosition(lon_lat) { - if (last_run_position == null) - last_run_position = character.currentPos(); - var distance = Cesium.Cartesian3.distance(Cesium.Cartesian3.fromDegrees(last_run_position[0], last_run_position[1]), Cesium.Cartesian3.fromDegrees(lon_lat[0], lon_lat[1])); - if (distance > 0) { - $scope.total_distance_run += distance; - var rectangleInstance = new Cesium.GeometryInstance({ - geometry: new Cesium.CorridorGeometry({ - positions: Cesium.Cartesian3.fromDegreesArray([last_run_position[0], last_run_position[1], lon_lat[0], lon_lat[1]]), - width: 5 - }), - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute(0.9, .9, .1, 0.8) - } - }); - var line = viewer.scene.primitives.add(new Cesium.GroundPrimitive({ - geometryInstances: rectangleInstance - })); - line.point = [lon_lat[0], lon_lat[1], lon_lat[2]]; - line.time = new Date(); - line.distance = distance; - running_line_segments.push(line); - } - last_run_position = [lon_lat[0], lon_lat[1], lon_lat[2]]; - } - - function playGo() { - var audio = new Audio('sounds/go.mp3'); - audio.play(); - } - - $rootScope.$on('map.loaded', function () { - map = hs_map.map; - if (Core.isMobile()) { - if (angular.isUndefined(geolocation.geolocation)) - geolocation.gpsStatus = true; - else - geolocation.startGpsWatch(); - } - }); - - $rootScope.$on('cesiummap.loaded', function (event, _viewer) { - viewer = _viewer; - var scene = viewer.scene; - scene.globe.depthTestAgainstTerrain = true; - disableRightMouse(scene); - character.currentPos([hs_map.map.getView().getCenter()[0], hs_map.map.getView().getCenter()[1], 0]); - character.init($scope, $compile, olus, viewer, stations); - olus.init($scope, $compile, map, utils, _viewer, character); - tick(); - }); - - $rootScope.$on('map.sync_center', function (e, center, bounds) { - if ($scope.game_state == 'before_game' && angular.isUndefined($scope.geolocated)) - character.currentPos(center); - }) - - $scope.$on('infopanel.updated', function (event) { }); - - $scope.donePlanning = function () { - $scope.game_started = true; - $scope.game_state = 'running'; - time_game_started = last_time; - full_date = running_start_date; - playGo(); - character.flyToInitialLocation(); - } - - $scope.endGame = function () { - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - $scope.game_started = false; - var audio = new Audio('sounds/fanfare.mp3'); - audio.play(); - } - - $scope.getGpx = function () { - var head = ` - - - - - - http://www.rogainonline.com/ - - rogainonline - - ORIENTEERING - - `; - var trkpts = running_line_segments.reduce((accumulator, l) => `${accumulator} - ${l.point[2]} - - `, ''); - var end = ` - -`; - - download('rogainonline_' + (new Date()).toISOString() + '.gpx', head + trkpts + end); - } - - function download(filename, text) { - var element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); - element.setAttribute('download', filename); - - element.style.display = 'none'; - document.body.appendChild(element); - - element.click(); - - document.body.removeChild(element); - } - - var last_good_altitude = null; - $scope.$on('geolocation.updated', function (event, data) { - if (data && angular.isDefined(data.latlng)) { - $scope.geolocated = true; - var l = data.latlng; - if (character.currentPos()[2] > 0) - last_good_altitude = character.currentPos()[2] - var altitude_bad = data.altitude == null || angular.isUndefined(data.altitude); - var altitude = (data.altitude || last_good_altitude) || 0; - character.currentPos([l[0], l[1], altitude]); - if (altitude_bad) { - character.calculateAltitude(last_time) - } - - } - }); - - $scope.locateMe = function () { - if (geolocation.last_location && angular.isDefined(geolocation.last_location.latlng)) { - geolocation - $scope.geolocated = true; - var l = geolocation.last_location.latlng; - character.currentPos([l[0], l[1]]); - character.flyToInitialLocation(); - } - } - } - ]); - - return module; - }); diff --git a/examples/rogainonline/hud.html b/examples/rogainonline/hud.html deleted file mode 100644 index 0e49678e62..0000000000 --- a/examples/rogainonline/hud.html +++ /dev/null @@ -1,80 +0,0 @@ -
- - -
- - {{min_km}} min/km - - - {{time_remaining|date:'HH:mm:ss'}} - - - {{points_collected}} - -{{time_penalty}} - - -   -
-
-

Rogaining RPG

-

- This is a game which simulates a rogaining (orienteering) competition.
- The objective is to visit as many stations as possible in a fixed amount of time in any order.
You get different amount of points for each station. Be back at start until 0:00.
-

-

- Location: -

-

- Game mode: SimulationReal -

-

- Time mode: 10xReal time -

-

Length: - - - -

-

- This application visualises the Open Land Use dataset on top of the EU-DEM terrain model in a perspective view. -

- -
-
-

Planning mode

-

Right click on map to draw a draft route of around 20km. -
Planned - {{(total_distance / 1000).toFixed(1)}} km

-
- -
-
\ No newline at end of file diff --git a/examples/rogainonline/olu.js b/examples/rogainonline/olu.js deleted file mode 100644 index 13189664b9..0000000000 --- a/examples/rogainonline/olu.js +++ /dev/null @@ -1,268 +0,0 @@ -define(['ol'], - - function (ol) { - var olu_source = new ol.source.Vector(); - var $scope; - var $compile; - var greenery = ["27", "19"]; - var last_position_loaded = null; - var last_map_calculated = 0; - var map; - var utils; - var direction_changed = false; - var character; - var view_sector = null; - - function entityClicked(entity) { - $scope.showInfo(entity); - if ($('#zone-info-dialog').length > 0) { - angular.element('#zone-info-dialog').parent().remove(); - } - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - - olu_source.cesiumStyler = function (dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - if (entity.styled) continue; - var name = entity.properties.label; - var s = entity.properties.use.getValue(); - entity.polygon.outline = false; - if (greenery.indexOf(s) > -1) - entity.polygon.material = Cesium.Color.GREEN.withAlpha(0.4); - else - switch (s) { - case "17": - entity.polygon.material = Cesium.Color.WHITE.withAlpha(0.2); - break; - case "10": - entity.polygon.material = Cesium.Color.BLUE.withAlpha(0.4); - break; - case "13": - entity.polygon.material = new Cesium.Color(1, 162 / 255, 140 / 255, 1); - function fillHeight() { - return this.entity.properties.height || 0 - } - var cbp = new Cesium.CallbackProperty(fillHeight, false); - function fillExtrudedHeight() { - return (this.entity.properties.height || 0) + 5.0 - } - var cbpex = new Cesium.CallbackProperty(fillExtrudedHeight, false); - entity.polygon.extrudedHeight = cbpex; - cbp.entity = entity; - cbpex.entity = entity; - entity.polygon.height = cbp; - var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions; - var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center; - polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter); - entity.position = polyCenter; - var cartoPos = Cesium.Cartographic.fromCartesian(polyCenter); - cartoPos.entity = entity; - var promise = Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [ - cartoPos - ]); - Cesium.when(promise, function (updatedPositions) { - updatedPositions[0].entity.properties.height = updatedPositions[0].height; - updatedPositions[0].entity.polygon.extrudedHeight.setCallback(fillExtrudedHeight, true); - updatedPositions[0].entity.polygon.height.setCallback(fillHeight, true); - }); - break; - default: - entity.polygon.material = new Cesium.Color(1, 1, 1, 0.09); - - } - entity.styled = true; - //entity.onclick = entityClicked - } - } - - function createViewSector(pnts) { - if (view_sector != null) - viewer.scene.primitives.remove(view_sector); - var rectangleInstance = new Cesium.GeometryInstance({ - geometry: new Cesium.PolygonGeometry({ - polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(pnts)) - }), - attributes: { - color: new Cesium.ColorGeometryInstanceAttribute(0.0, .6, .8, 0.3) - } - }); - view_sector = viewer.scene.primitives.add(new Cesium.GroundPrimitive({ - geometryInstances: rectangleInstance - })); - } - - function generateViewSectorPoints(c) { - var target = character.getTargetPosition(); - if (target == null) return; - var elips = new Cesium.EllipsoidGeodesic(Cesium.Cartographic.fromDegrees(target[0], target[1]), Cesium.Cartographic.fromDegrees(c[0], c[1])) - var head_rad = -elips.startHeading - Math.PI / 2; - var view_distance = 0.5; //km - var pnts = [c[0], c[1]]; - for (var a = - Math.PI / 6; a < + Math.PI / 6; a += + Math.PI / 24) { - pnts.push(c[0] + Math.cos(head_rad + a) * (view_distance / (111.320 * Math.cos(c[1] * Math.PI / 180)))); //At equator 1 lon degree is 110km, at poles 0 - pnts.push(c[1] + Math.sin(head_rad + a) * (view_distance / 110)) //Latitude is 1 degree=110km - }; - pnts.push(c[0]); - pnts.push(c[1]); - return pnts; - } - - var me = { - visionDistance: function () { - return 0.0006; - }, - maxSpeed: function () { - return 0.00008; - }, - directionChanged: function (v) { - if (v) direction_changed = true; - return direction_changed; - }, - updMap: function (timestamp, pos_lon_lat) { - if (timestamp - last_map_calculated < 300) return; - last_map_calculated = timestamp; - if (last_position_loaded == null) last_position_loaded = [pos_lon_lat[0] - 0.001, pos_lon_lat[1] - 0.001]; - var diff = { x: pos_lon_lat[0] - last_position_loaded[0], y: pos_lon_lat[1] - last_position_loaded[1] }; - if (last_map_calculated == 0 || Math.sqrt(diff.x * diff.x + diff.y * diff.y) > me.visionDistance() * 0.5 || me.directionChanged()) { - me.getOlus(pos_lon_lat); - last_position_loaded = [pos_lon_lat[0], pos_lon_lat[1]]; - } - }, - getOlus: function (c) { - var format = new ol.format.WKT(); - var ver_off = me.visionDistance(); - var hor_off = me.visionDistance(); - var pnts = generateViewSectorPoints(c); - direction_changed = false; - createViewSector(pnts); - - olu_source.getFeatures().forEach(function (feature) { - feature.set('flaged', true); - }) - //console.log('done', (new Date()).getTime() - window.lasttime); window.lasttime = (new Date()).getTime(); - var spnts = ''; - for (var i = 0; i < pnts.length; i++) { - spnts += pnts[i].toString() + ' '; - if (i % 2 == 1 && i != pnts.length - 1) spnts += ', '; - }; - var extents = `POLYGON ((${spnts}))`; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(`PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX rdfs: - SELECT ?o ?wkt ?use - FROM - WHERE { ?o geo:hasGeometry ?geometry. - ?geometry geo:asWKT ?wkt. - FILTER(bif:st_intersects(bif:st_geomfromtext("${extents}"), ?wkt)). - ?o ?use. - FILTER(?use!="17"^^xsd:string) - }`) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - olu_source.set('loaded', false); - $.ajax({ - url: q - }) - .done(function (response) { - if (angular.isUndefined(response.results)) return; - //console.log('got it', (new Date()).getTime() - window.lasttime); window.lasttime = (new Date()).getTime(); - var features = []; - for (var i = 0; i < response.results.bindings.length; i++) { - try { - var b = response.results.bindings[i]; - if (b.wkt.datatype == "http://www.openlinksw.com/schemas/virtrdf#Geometry" && b.wkt.value.indexOf('e+') == -1 && b.wkt.value.indexOf('e-') == -1) { - if (olu_source.getFeatureById(b.o.value) == null) { - var g_feature = format.readFeature(b.wkt.value.toUpperCase()); - var ext = g_feature.getGeometry().getExtent() - var geom_transformed = g_feature.getGeometry().transform('EPSG:4326', map.getView().getProjection()); - var feature = new ol.Feature({ geometry: geom_transformed, olu: b.o.value, use: b.use.value, flaged: false }); - feature.setId(b.o.value); - features.push(feature); - } else { - olu_source.getFeatureById(b.o.value).set('flaged', false); - } - } - } catch (ex) { - //console.log(ex); - } - } - //olu_source.clear(); - olu_source.addFeatures(features); - olu_source.getFeatures().forEach(function (feature) { - if (feature.get('flaged') == true) olu_source.removeFeature(feature); - }) - olu_source.set('loaded', true); - //console.log('ol features added', (new Date()).getTime() - window.lasttime); window.lasttime = (new Date()).getTime(); - olu_source.dispatchEvent('features:loaded', olu_source); - }) - }, - createOluLayer: function () { - return new ol.layer.Vector({ - title: "Open land use parcels", - source: olu_source, - visible: true - }) - }, - getOluUnder: function (cord) { - var features = olu_source.getFeaturesAtCoordinate(cord); - return features.map((f) => f.get('use')); - }, - buildingExistsAtCoordinate: function (c) { - var point = `POINT (${c.x} ${c.y})`; - var tmp_result = false; - var q = 'https://www.foodie-cloud.org/sparql?default-graph-uri=&query=' + encodeURIComponent(`PREFIX geo: - PREFIX geof: - PREFIX virtrdf: - PREFIX rdfs: - SELECT ?o - FROM - WHERE { ?o geo:hasGeometry ?geometry. - ?geometry geo:asWKT ?wkt. - FILTER(bif:st_intersects(bif:st_geomfromtext("${point}"), ?wkt)). - ?o ?use. - FILTER(?use="13"^^xsd:string) - } LIMIT 1`) + '&should-sponge=&format=application%2Fsparql-results%2Bjson&timeout=0&debug=on'; - - $.ajax({ - url: q, - async: false - }) - .done(function (response) { - tmp_result = response.results.bindings.length > 0 - }) - return tmp_result; - }, - getSpeed: function (cord) { - var speed = me.maxSpeed(); - me.getOluUnder(cord).forEach(function (use) { - if (use == '13') { - speed = 0; - var audio = new Audio('sounds/oof.mp3'); - audio.volume = .5; - audio.play(); - } - if (use == '10') { - speed = me.maxSpeed() / 6.0; - } - if (greenery.indexOf(use) > -1) speed = me.maxSpeed() / 2.0; - }); - return speed * $scope.time_multiplier; - }, - init: function (_$scope, _$compile, _map, _utils, _viewer, _character) { - $scope = _$scope; - $compile = _$compile; - map = _map; - utils = _utils; - viewer = _viewer; - character = _character; - $scope.val1 = 1; - $scope.val2 = 1; - } - } - return me; - } -) diff --git a/examples/rogainonline/stations.js b/examples/rogainonline/stations.js deleted file mode 100644 index 11450d3e25..0000000000 --- a/examples/rogainonline/stations.js +++ /dev/null @@ -1,143 +0,0 @@ -define(['ol'], - - function (ol) { - var source = new ol.source.Vector(); - var $scope; - var $compile; - var olus; - var anything_collected = false; - - function entityClicked(entity) { - $scope.showInfo(entity); - if ($('#zone-info-dialog').length > 0) { - angular.element('#zone-info-dialog').parent().remove(); - } - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - - source.cesiumStyler = function (dataSource) { - var entities = dataSource.entities.values; - for (var i = 0; i < entities.length; i++) { - var entity = entities[i]; - styleEntity(entity); - } - } - - function styleEntity(entity) { - entity.billboard.scaleByDistance = new Cesium.NearFarScalar(50, 1.5, 40000, 0.0); - var picture = entity.properties.visited.getValue() ? 'viewpoint' : 'other'; - entity.billboard.image = entity.properties.start ? 'triangle-outline-64.png' : `../foodie-zones/symbols/${picture}.png`; - entity.billboard.eyeOffset = new Cesium.Cartesian3(0.0,0.0,-100.0); - entity.label = new Cesium.LabelGraphics({ - text: entity.properties.label, - font: '18px "Lato", sans-serif', - fillColor: Cesium.Color.WHITE, - outlineColor: new Cesium.Color(0.1, 0.1, 0.1, 0.9), - outlineWidth: 2, - showBackground: true, - style: Cesium.LabelStyle.FILL_AND_OUTLINE, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(0, entity.properties.start ? -50 : -40), - pixelOffsetScaleByDistance: new Cesium.NearFarScalar(50, 1.5, 20000, 0.0), - scaleByDistance: new Cesium.NearFarScalar(50, 1.5, 20000, 0.0), - heightReference: Cesium.HeightReference.CLAMP_TO_GROUND, - eyeOffset: new Cesium.Cartesian3(0.0,0.0,-200.0) - }); - } - - function stationExistsAtCoordinate(try_pnt, features) { - var found_close = false; - for (j = 0; j < features.length; j++) { - var diff = { x: features[j].getGeometry().getCoordinates()[0] - try_pnt.x, y: features[j].getGeometry().getCoordinates()[1] - try_pnt.y }; - if (Math.sqrt(diff.x * diff.x + diff.y * diff.y) < 0.003) { - found_close = true; - break; - } - } - return found_close - } - - function getMapWidth(hours) { - return 10 * hours / 4; - } - return { - getMapWidth: getMapWidth, - createStations: function (map, utils, c, callback, hours) { - var points_added = 0; - source.clear(); - var features = [new ol.Feature({ - geometry: new ol.geom.Point([c[0], c[1]]), - label: 'START / FINISH', - points: 0, - start: true, - visited: false - })]; - var bounds = {west: null, east: null, north: null, south: null }; - for (i = 1; i < 1000; i++) { - var to_deg_x = (111.320 * Math.cos(c[1] * Math.PI / 180)); - var to_deg_y = 110; - var try_pnt = { - x: c[0] - getMapWidth(hours) / 2.0 / to_deg_x + Math.random() * getMapWidth(hours) / to_deg_x, - y: c[1] - getMapWidth(hours) / 2.0 / to_deg_y + Math.random() * getMapWidth(hours) / to_deg_y - }; - if (!olus.buildingExistsAtCoordinate(try_pnt) && !stationExistsAtCoordinate(try_pnt, features)) { - var points = Math.floor((20 + Math.random() * 69)); - var feature = new ol.Feature({ - geometry: new ol.geom.Point([try_pnt.x, try_pnt.y]), - label: points.toFixed(0), - points: points, - visited: false - }); - if(bounds.west==null || try_pnt.x < bounds.west) bounds.west = try_pnt.x; - if(bounds.east==null || try_pnt.x > bounds.east) bounds.east = try_pnt.x; - if(bounds.north==null || try_pnt.y > bounds.north) bounds.north = try_pnt.y; - if(bounds.south==null || try_pnt.y < bounds.south) bounds.south = try_pnt.y; - features.push(feature); - points_added++; - } - if (points_added >= 40 * (hours / 3)) break; - } - source.addFeatures(features); - source.set('loaded', true); - source.dispatchEvent('features:loaded', source); - callback(bounds); - }, - createLayer: function (gettext) { - return new ol.layer.Vector({ - title: gettext("Stations"), - source: source, - visible: true - }) - }, - checkAtCoords: function (coords) { - var collected = 0.0; - source.cesium_layer.entities.values.forEach(function (entity) { - if (Cesium.Cartesian3.distance(entity.position.getValue(), coords) < 15 && entity.properties.visited.getValue() == false) { - if (entity.properties.start) { - if (anything_collected) { - entity.properties.visited.setValue(true); - anything_collected = false; - $scope.endGame(); - } - } else { - entity.properties.visited.setValue(true); - var audio = new Audio('sounds/collectcoin.mp3'); - audio.play(); - anything_collected = true; - styleEntity(entity); - collected = Math.floor(entity.properties.points.getValue() / 10); - } - } - }); - return collected; - }, - init: function (_$scope, _$compile, _olus) { - $scope = _$scope; - $compile = _$compile; - olus = _olus; - } - } - } -) diff --git a/examples/rostenice/about.html b/examples/rostenice/about.html deleted file mode 100644 index b30d76ce8d..0000000000 --- a/examples/rostenice/about.html +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/examples/rostenice/app.js b/examples/rostenice/app.js deleted file mode 100755 index 441d382169..0000000000 --- a/examples/rostenice/app.js +++ /dev/null @@ -1,253 +0,0 @@ -'use strict'; - -define(['ol', 'toolbar', 'layermanager', 'geojson', 'sidebar', 'query', 'search', 'print', 'permalink', 'measure', 'geolocation', 'api', 'hscesium', 'ows', 'bootstrap', 'datasource_selector'], - - function(ol, toolbar, layermanager, geojson) { - var module = angular.module('hs', [ - 'hs.toolbar', - 'hs.layermanager', - 'hs.query', - 'hs.search', 'hs.print', 'hs.permalink', - 'hs.datasource_selector', - 'hs.geolocation', - 'hs.cesium', - 'hs.sidebar', - 'hs.ows' - ]); - - module.directive('hs', ['hs.map.service', 'Core', '$compile', '$timeout', function(OlMap, Core, $compile, $timeout) { - return { - templateUrl: hsl_path + 'hslayers.html', - link: function(scope, element) { - $timeout(function() { - Core.fullScreenMap(element) - }, 0); - } - }; - }]); - - module.directive('hs.aboutproject', function() { - function link(scope,element,attrs) { - setTimeout(function(){ - $('#about-dialog').modal('show'); - }, 1500); - } - return { - templateUrl: './about.html?bust=' + gitsha, - link: link - }; - }); - - function getHostname() { - var url = window.location.href - var urlArr = url.split("/"); - var domain = urlArr[2]; - return urlArr[0] + "//" + domain; - }; - - module.value('config', { - terrain_provider: 'http://gis.lesprojekt.cz/cts/tilesets/rostenice_dmp1g/', - terrain_providers: [{ - title: 'Local surface model', - url: 'http://gis.lesprojekt.cz/cts/tilesets/rostenice_dmp1g/', - active: true - }, { - title: 'Local terrain model', - url: 'http://gis.lesprojekt.cz/cts/tilesets/rostenice_dmr5g/', - active: false - }, { - title: 'EU-DEM', - url: 'https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles', - active: false - }], - default_layers: [ - new ol.layer.Tile({ - source: new ol.source.OSM(), - title: "OpenStreetMap", - base: true, - visible: false, - minimumTerrainLevel: 15 - }), - new ol.layer.Tile({ - title: "Open-Land-Use (WMS)", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/olu/openlandusemap.map', - params: { - LAYERS: 'olu_bbox_srid', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 15 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/openlandusemap.map&service=WMS&request=GetLegendGraphic&layer=olu_bbox_srid&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Slope (in degrees)", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'slope', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=slope&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Slope orientation", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'orientation', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=orientation&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Normalized difference vegetation index (NDVI) ", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'ndvi_rostenice', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=ndvi_rostenice&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Compound topographic index (CTI)", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'cti_rostenice', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=cti_rostenice&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: false, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Yield potential Rostenice", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'yield_potential', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=yield_potential&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: true, - opacity: 0.7 - }), - new ol.layer.Tile({ - title: "Machinery tracklines", - source: new ol.source.TileWMS({ - url: 'http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map', - params: { - LAYERS: 'machinery_tracklines_average_slope', - FORMAT: "image/png", - INFO_FORMAT: "text/html", - minimumTerrainLevel: 14 - }, - crossOrigin: null - }), - legends: ['http://gis.lesprojekt.cz/cgi-bin/mapserv?map=/home/dima/maps/3d_olu/rostenice.map&service=WMS&request=GetLegendGraphic&layer=machinery_tracklines_average_slope&version=1.3.0&format=image/png&sld_version=1.1.0'], - maxResolution: 8550, - visible: true, - opacity: 0.8 - }) - - ], - project_name: 'erra/map', - datasources: [ - { - title: "Datasets", - url: "http://otn-dev.intrasoft-intl.com/otnServices-1.0/platform/ckanservices/datasets", - language: 'eng', - type: "ckan", - download: true - }, { - title: "Services", - url: "http://cat.ccss.cz/csw/", - language: 'eng', - type: "micka", - code_list_url: 'http://www.whatstheplan.eu/php/metadata/util/codelists.php?_dc=1440156028103&language=eng&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22label%22%7D%5D' - }, { - title: "Hub layers", - url: "http://opentnet.eu/php/metadata/csw/", - language: 'eng', - type: "micka", - code_list_url: 'http://opentnet.eu/php/metadata/util/codelists.php?_dc=1440156028103&language=eng&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22label%22%7D%5D' - } - ], - hostname: { - "default": { - "title": "Default", - "type": "default", - "editable": false, - "url": getHostname() - } - }, - 'catalogue_url': "/php/metadata/csw", - 'compositions_catalogue_url': "/php/metadata/csw", - status_manager_url: '/wwwlibs/statusmanager2/index.php', - default_view: new ol.View({ - center: ol.proj.transform([16.8290202, 49.0751890], 'EPSG:4326', 'EPSG:3857'), //Latitude longitude to Spherical Mercator - zoom: 15, - units: "m" - }) - }); - - module.controller('Main', ['$scope', '$compile', '$element', 'Core', 'hs.map.service', 'config', - function($scope, $compile, $element, Core, OlMap, config) { - $scope.hsl_path = hsl_path; //Get this from hslayers.js file - $scope.Core = Core; - - Core.singleDatasources = true; - Core.panelEnabled('compositions', true); - Core.panelEnabled('status_creator', false); - - $scope.$on('infopanel.updated', function(event) {}); - - function createAboutDialog() { - var el = angular.element('
'); - $("#hs-dialog-area").append(el); - $compile(el)($scope); - } - createAboutDialog(); - } - ]); - - return module; - }); diff --git a/examples/rostenice/hslayers.js b/examples/rostenice/hslayers.js deleted file mode 100755 index 75f2731736..0000000000 --- a/examples/rostenice/hslayers.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict'; - -var hsl_path = '../../'; -var gitsha = $.ajax({ - type: "GET", - url: hsl_path + 'gitsha.js', - async: false -}).responseText; - -require.config({ - urlArgs: 'bust=' + gitsha, - paths: { - toolbar: hsl_path + 'components/toolbar/toolbar', - layermanager: hsl_path + 'components/layermanager/layermanager', - map: hsl_path + 'components/map/map', - query: hsl_path + 'components/query/query', - search: hsl_path + 'components/search/search', - print: hsl_path + 'components/print/print', - permalink: hsl_path + 'components/permalink/permalink', - geolocation: hsl_path + 'components/geolocation/geolocation', - measure: hsl_path + 'components/measure/measure', - legend: hsl_path + 'components/legend/legend', - app: 'app', - core: hsl_path + 'components/core/core', - api: hsl_path + 'components/api/api', - translations: hsl_path + 'components/translations/js/translations', - hscesium: hsl_path + 'components/hscesium/hscesium', - } -}); - -//http://code.angularjs.org/1.2.1/docs/guide/bootstrap#overview_deferred-bootstrap -window.name = "NG_DEFER_BOOTSTRAP!"; - -require(['core'], function(app) { - require(['app'], function(app) { - var $html = angular.element(document.getElementsByTagName('html')[0]); - angular.element().ready(function() { - angular.resumeBootstrap([app['name']]); - }); - }); -}); diff --git a/examples/rostenice/index.html b/examples/rostenice/index.html deleted file mode 100755 index 378e6ff323..0000000000 --- a/examples/rostenice/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - HS Layers - - - - - - - -
- - - - -