|
|
@@ -1,18 +1,16 @@
|
|
|
-//import WMTSTileGrid from 'ol/tilegrid/WMTS';
|
|
|
-import proj4 from 'proj4';
|
|
|
+//import proj4 from 'proj4';
|
|
|
import {Fill, Stroke, Style} from 'ol/style';
|
|
|
import {OSM, TileWMS, Vector as VectorSource, XYZ, WMTS} from 'ol/source';
|
|
|
import {Tile, Vector as VectorLayer} from 'ol/layer';
|
|
|
import {TopoJSON} from 'ol/format';
|
|
|
import {View} from 'ol';
|
|
|
import {get as getProjection, transform} from 'ol/proj';
|
|
|
-//import {getTopLeft, getWidth} from 'ol/extent';
|
|
|
-import {register} from 'ol/proj/proj4';
|
|
|
+//import {register} from 'ol/proj/proj4';
|
|
|
|
|
|
import env from './env.config.json';
|
|
|
import i18n from './translations.json';
|
|
|
|
|
|
-proj4.defs(
|
|
|
+/*proj4.defs(
|
|
|
'EPSG:3045',
|
|
|
'+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'
|
|
|
);
|
|
|
@@ -21,7 +19,7 @@ proj4.defs(
|
|
|
'+proj=krovak +lat_0=49.5 +lon_0=24.83333333333333 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=542.5,89.2,456.9,5.517,2.275,5.516,6.96 +units=m +no_defs'
|
|
|
);
|
|
|
register(proj4);
|
|
|
-const sjtskProjection = getProjection('EPSG:5514');
|
|
|
+const sjtskProjection = getProjection('EPSG:5514');*/
|
|
|
//const utm33nProjection = getProjection('EPSG:3045');
|
|
|
|
|
|
function getHostname() {
|
|
|
@@ -33,7 +31,7 @@ function getHostname() {
|
|
|
|
|
|
export const cartodbLayer = new Tile({
|
|
|
properties: {
|
|
|
- title: 'OpenStreetMap svฤtlรก',
|
|
|
+ title: 'OpenStreetMap bright',
|
|
|
base: true,
|
|
|
editor: {editable: false},
|
|
|
removable: false,
|
|
|
@@ -51,7 +49,7 @@ export const cartodbLayer = new Tile({
|
|
|
|
|
|
export const osmLayer = new Tile({
|
|
|
properties: {
|
|
|
- title: 'OpenStreetMap barevnรก',
|
|
|
+ title: 'OpenStreetMap colorful',
|
|
|
base: true,
|
|
|
editor: {editable: false},
|
|
|
removable: false,
|
|
|
@@ -60,82 +58,6 @@ export const osmLayer = new Tile({
|
|
|
visible: false,
|
|
|
});
|
|
|
|
|
|
-export const zm100Layer = new Tile({
|
|
|
- properties: {
|
|
|
- title: 'Mapa ฤR 1:100 000',
|
|
|
- base: true,
|
|
|
- removable: false,
|
|
|
- },
|
|
|
- source: new TileWMS({
|
|
|
- url: 'https://geoportal.cuzk.cz/WMS_ZM100_PUB/WMService.aspx',
|
|
|
- params: {
|
|
|
- LAYERS: 'GR_ZM100',
|
|
|
- },
|
|
|
- attributions: ['ยฉ <a href="geoportal.cuzk.cz" target="_blank">ฤรZK</a>'],
|
|
|
- }),
|
|
|
- /*source: new TileWMS({
|
|
|
- url:
|
|
|
- 'https://ags.cuzk.cz/arcgis/services/VektorovaMapa/MapServer/WmsServer?',
|
|
|
- params: {
|
|
|
- //https://ags.cuzk.cz/arcgis/services/VektorovaMapa/MapServer/WmsServer?request=GetCapabilities&service=WMS
|
|
|
- LAYERS: `1,2,3,4,5,6,7,8,9,10,11,12,13,14,193,194,195,196,
|
|
|
-17,18,15,16,82,83,84,85,86,87,88,89,90,91,182,183,184,185,186,187,188,189,190,191,192,
|
|
|
-19,20,78,79,80,81,23,24,21,22,197,198,199,200,201,202,203,204,205,
|
|
|
-52,53,54,
|
|
|
-26,27,92,94,93,95,96,
|
|
|
-29,30,31,32,76,97,98,99,100,101,102,103,104,108,109,105,106,107,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155`,
|
|
|
- },
|
|
|
- }),*/
|
|
|
- /*source: new WMTS({
|
|
|
- url: 'https://geoportal.cuzk.cz/WMTS_ZM/WMTService.aspx',
|
|
|
- format: 'image/png',
|
|
|
- layer: 'zm',
|
|
|
- matrixSet: 'jtsk:epsg:5514',
|
|
|
- tileGrid: new WMTSTileGrid({
|
|
|
- origin: [51.874963785131, 11.082166373399],
|
|
|
- resolutions: [
|
|
|
- 3,2,1
|
|
|
- ],
|
|
|
- matrixIds: [1, 2, 3],
|
|
|
- }),
|
|
|
- }),*/
|
|
|
- visible: false,
|
|
|
-});
|
|
|
-
|
|
|
-export const mcr500Layer = new Tile({
|
|
|
- properties: {
|
|
|
- title: 'Mapa ฤR 1:500 000',
|
|
|
- base: true,
|
|
|
- removable: false,
|
|
|
- },
|
|
|
- source: new TileWMS({
|
|
|
- url: 'https://geoportal.cuzk.cz/WMS_MCR500/WMService.aspx',
|
|
|
- params: {
|
|
|
- LAYERS: 'GR_MCR500',
|
|
|
- },
|
|
|
- attributions: ['ยฉ <a href="geoportal.cuzk.cz" target="_blank">ฤรZK</a>'],
|
|
|
- }),
|
|
|
-
|
|
|
- visible: false,
|
|
|
-});
|
|
|
-
|
|
|
-export const ortofotoLayer = new Tile({
|
|
|
- properties: {
|
|
|
- title: 'Ortofoto ฤรZK',
|
|
|
- base: true,
|
|
|
- removable: false,
|
|
|
- thumbnail: 'https://www.agrihub.sk/hsl-ng/img/orto.jpg',
|
|
|
- },
|
|
|
- source: new TileWMS({
|
|
|
- url: 'https://geoportal.cuzk.cz/WMS_ORTOFOTO_PUB/WMService.aspx',
|
|
|
- params: {
|
|
|
- LAYERS: 'GR_ORTFOTORGB',
|
|
|
- },
|
|
|
- attributions: ['ยฉ <a href="geoportal.cuzk.cz" target="_blank">ฤรZK</a>'],
|
|
|
- }),
|
|
|
- visible: false,
|
|
|
-});
|
|
|
-
|
|
|
export const perc2color = (perc: number): string => {
|
|
|
perc = perc * 100;
|
|
|
let r;
|
|
|
@@ -185,109 +107,55 @@ const indexStyle = (feature) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-export const obce = new VectorSource({
|
|
|
- format: new TopoJSON({dataProjection: 'EPSG:5514'}),
|
|
|
- url: require('./data/obce_cr_20210310_5p_5514.topojson').default,
|
|
|
+export const districts = new VectorSource({
|
|
|
+ format: new TopoJSON({dataProjection: 'EPSG:4326'}),
|
|
|
+ url: require('./data/kenya+uganda_districts_10p_4326.topojson').default,
|
|
|
overlaps: false,
|
|
|
- attributions: ['CC-BY ฤรZK, 2021'],
|
|
|
+ attributions: ['HDX, IEBC, Uganda Bureau of Statistics with support from WHO'],
|
|
|
});
|
|
|
|
|
|
-export const obceIndexLayer = new VectorLayer({
|
|
|
+export const districtsIndexLayer = new VectorLayer({
|
|
|
properties: {
|
|
|
editor: {editable: false},
|
|
|
autoLegend: false,
|
|
|
- title: 'Obce ฤR: Rural attractiveness index',
|
|
|
+ title: 'Kenya & Uganda districts: Rural attractiveness index',
|
|
|
},
|
|
|
- source: obce,
|
|
|
+ source: districts,
|
|
|
visible: true,
|
|
|
style: indexStyle,
|
|
|
});
|
|
|
-obceIndexLayer.set('popUp', {
|
|
|
+districtsIndexLayer.set('popUp', {
|
|
|
attributes: [
|
|
|
{
|
|
|
attribute: 'aggregate',
|
|
|
- label: 'agregovanรฝ index',
|
|
|
+ label: 'aggregated',
|
|
|
displayFunction: decimal2prettyPerc,
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
-obceIndexLayer.set('editable', false);
|
|
|
+districtsIndexLayer.set('editable', false);
|
|
|
//obceIndexLayer.set('queryable', false);
|
|
|
|
|
|
-const masStyle = (feature) =>
|
|
|
- new Style({
|
|
|
- fill: new Fill({
|
|
|
- color: feature.get('mas_type') == 'member' ? '#1d941d' : '#f6cd61',
|
|
|
- }),
|
|
|
- stroke: new Stroke({
|
|
|
- color: '#ffffff',
|
|
|
- width: 0.6,
|
|
|
- }),
|
|
|
- });
|
|
|
-
|
|
|
-export const masLayer = new VectorLayer({
|
|
|
- properties: {
|
|
|
- editor: {editable: false},
|
|
|
- title: 'MAS ฤR',
|
|
|
- attributions: ['© NS MAS ฤR, http://nsmascr.cz/o-nas/'],
|
|
|
- popUp: {
|
|
|
- attributes: [
|
|
|
- /*{attribute: 'mas_type', label: 'ฤlen NS MAS?', displayFunction: (attr) => {TODO:}}*/
|
|
|
- ],
|
|
|
- },
|
|
|
- },
|
|
|
- source: new VectorSource({
|
|
|
- format: new TopoJSON({dataProjection: 'EPSG:5514'}),
|
|
|
- url: require('./data/mas_2021.topojson').default,
|
|
|
- overlaps: false,
|
|
|
- }),
|
|
|
- visible: false,
|
|
|
- opacity: 0.8,
|
|
|
- style: masStyle,
|
|
|
-});
|
|
|
-
|
|
|
-const okresyStyle = new Style({
|
|
|
- stroke: new Stroke({
|
|
|
- color: '#111111',
|
|
|
- width: 0.4,
|
|
|
- }),
|
|
|
-});
|
|
|
-
|
|
|
-export const okresyLayer = new VectorLayer({
|
|
|
- properties: {
|
|
|
- editor: {editable: false},
|
|
|
- title: 'Okresy ฤR',
|
|
|
- attributions: ['CC-BY ฤรZK, 2021'],
|
|
|
- },
|
|
|
- source: new VectorSource({
|
|
|
- format: new TopoJSON({dataProjection: 'EPSG:5514'}),
|
|
|
- url: require('./data/okresy_cr_20210310_5p_5514.topojson').default,
|
|
|
- overlaps: false,
|
|
|
- }),
|
|
|
- visible: false,
|
|
|
- style: okresyStyle,
|
|
|
-});
|
|
|
-
|
|
|
-const krajeStyle = new Style({
|
|
|
+const countryStyle = new Style({
|
|
|
stroke: new Stroke({
|
|
|
color: '#000000',
|
|
|
width: 0.6,
|
|
|
}),
|
|
|
});
|
|
|
|
|
|
-export const krajeLayer = new VectorLayer({
|
|
|
+export const countryLayer = new VectorLayer({
|
|
|
properties: {
|
|
|
editor: {editable: false},
|
|
|
- title: 'Kraje ฤR',
|
|
|
- attributions: ['CC-BY ฤรZK, 2021'],
|
|
|
+ title: 'Uganda',
|
|
|
},
|
|
|
source: new VectorSource({
|
|
|
- format: new TopoJSON({dataProjection: 'EPSG:5514'}),
|
|
|
- url: require('./data/kraje_cr_20210310_5p_5514.topojson').default,
|
|
|
+ format: new TopoJSON({dataProjection: 'EPSG:4326'}),
|
|
|
+ url: require('./data/uganda_districts_2020_10p_4326.topojson').default,
|
|
|
+ attributions: ['HDX, Uganda Bureau of Statistics with support from WHO'],
|
|
|
overlaps: false,
|
|
|
}),
|
|
|
visible: true,
|
|
|
- style: krajeStyle,
|
|
|
+ style: countryStyle,
|
|
|
});
|
|
|
|
|
|
export const AppConfig = {
|
|
|
@@ -295,13 +163,13 @@ export const AppConfig = {
|
|
|
useProxy: false,
|
|
|
//proxyPrefix: '../8085/',
|
|
|
geonamesUser: env.geonamesUser,
|
|
|
- default_layers: [cartodbLayer, osmLayer, mcr500Layer, ortofotoLayer],
|
|
|
+ default_layers: [cartodbLayer, osmLayer],
|
|
|
popUpDisplay: 'hover',
|
|
|
project_name: 'erra/map',
|
|
|
default_view: new View({
|
|
|
- projection: sjtskProjection,
|
|
|
- center: transform([15.628, 49.864249], 'EPSG:4326', 'EPSG:5514'),
|
|
|
- zoom: 7.6,
|
|
|
+ //projection: sjtskProjection,
|
|
|
+ center: transform([34.2, 1.1], 'EPSG:4326', 'EPSG:3857'),
|
|
|
+ zoom: 6.3,
|
|
|
}),
|
|
|
advanced_form: true,
|
|
|
datasources: [],
|