@yesilyazilim/web.spa.gis 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -14,17 +14,18 @@ var $8zHUo$olgeom = require("ol/geom");
14
14
  var $8zHUo$olproj = require("ol/proj");
15
15
  var $8zHUo$terraformerarcgis = require("@terraformer/arcgis");
16
16
  var $8zHUo$proj4 = require("proj4");
17
- var $8zHUo$ol = require("ol");
17
+ var $8zHUo$olsourceTileWMS = require("ol/source/TileWMS");
18
18
  var $8zHUo$olstyle = require("ol/style");
19
+ var $8zHUo$olstyleCircle = require("ol/style/Circle");
20
+ var $8zHUo$olObservable = require("ol/Observable");
21
+ var $8zHUo$olrender = require("ol/render");
22
+ var $8zHUo$oleasing = require("ol/easing");
23
+ var $8zHUo$ol = require("ol");
19
24
  var $8zHUo$olcolor = require("ol/color");
20
25
  var $8zHUo$olextent = require("ol/extent");
21
26
  var $8zHUo$olgeomPolygon = require("ol/geom/Polygon");
22
- var $8zHUo$olrender = require("ol/render");
23
27
  var $8zHUo$olgeomPoint = require("ol/geom/Point");
24
28
  var $8zHUo$olgeomLineString = require("ol/geom/LineString");
25
- var $8zHUo$olstyleCircle = require("ol/style/Circle");
26
- var $8zHUo$olObservable = require("ol/Observable");
27
- var $8zHUo$oleasing = require("ol/easing");
28
29
  var $8zHUo$coordinateparser = require("coordinate-parser");
29
30
  var $8zHUo$olsphere = require("ol/sphere");
30
31
  var $8zHUo$ollayer = require("ol/layer");
@@ -1804,594 +1805,418 @@ $parcel$export($9f1e53e2f5ceab7e$exports, "WmsLayer", () => $9f1e53e2f5ceab7e$ex
1804
1805
 
1805
1806
 
1806
1807
 
1807
- var $e2e9872d2858bcde$exports = {};
1808
-
1809
- $parcel$export($e2e9872d2858bcde$exports, "MapManager", () => $e2e9872d2858bcde$export$c521bb0b406df9a3);
1810
-
1811
-
1812
-
1813
-
1814
-
1815
-
1816
-
1817
- var $6e4a0fdd3e43ca7d$exports = {};
1818
-
1819
- $parcel$export($6e4a0fdd3e43ca7d$exports, "SymbologyFactory", () => $6e4a0fdd3e43ca7d$export$a1c933612b1f668c);
1820
-
1821
-
1808
+ var $979d8cb30b62358d$exports = {};
1822
1809
 
1810
+ $parcel$export($979d8cb30b62358d$exports, "GeoserverChannelTiled", () => $979d8cb30b62358d$export$f79174341f8b6465);
1811
+ $parcel$export($979d8cb30b62358d$exports, "GeoserverChannelImage", () => $979d8cb30b62358d$export$c5cf5c7d936c413);
1823
1812
 
1824
1813
 
1825
1814
 
1826
1815
 
1827
- const $6e4a0fdd3e43ca7d$var$setAlpha = function(color, alpha) {
1828
- if (color.length == 4) return [
1829
- color[0],
1830
- color[1],
1831
- color[2],
1832
- alpha
1833
- ];
1834
- else return color.concat(alpha);
1816
+ var $979d8cb30b62358d$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
1817
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1818
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1819
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1820
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1835
1821
  };
1836
- class $6e4a0fdd3e43ca7d$export$a1c933612b1f668c {
1837
- static createSimplePoint(color, radius = 5) {
1838
- return new (0, $8zHUo$olstyle.Style)({
1839
- image: new (0, $8zHUo$olstyle.Circle)({
1840
- radius: radius,
1841
- fill: new (0, $8zHUo$olstyle.Fill)({
1842
- color: color
1843
- })
1844
- })
1822
+ var $979d8cb30b62358d$var$__metadata = undefined && undefined.__metadata || function(k, v) {
1823
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
1824
+ };
1825
+ var $979d8cb30b62358d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
1826
+ function adopt(value) {
1827
+ return value instanceof P ? value : new P(function(resolve) {
1828
+ resolve(value);
1845
1829
  });
1846
1830
  }
1847
- static createSimpleLine(color, width = 2) {
1848
- return new (0, $8zHUo$olstyle.Style)({
1849
- stroke: new (0, $8zHUo$olstyle.Stroke)({
1850
- color: color,
1851
- width: width
1852
- })
1831
+ return new (P || (P = Promise))(function(resolve, reject) {
1832
+ function fulfilled(value) {
1833
+ try {
1834
+ step(generator.next(value));
1835
+ } catch (e) {
1836
+ reject(e);
1837
+ }
1838
+ }
1839
+ function rejected(value) {
1840
+ try {
1841
+ step(generator["throw"](value));
1842
+ } catch (e) {
1843
+ reject(e);
1844
+ }
1845
+ }
1846
+ function step(result) {
1847
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
1848
+ }
1849
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
1850
+ });
1851
+ };
1852
+ var $979d8cb30b62358d$var$_a;
1853
+ class $979d8cb30b62358d$var$GeoserverChannelBase {
1854
+ constructor(_wmsProps){
1855
+ this._wmsProps = _wmsProps;
1856
+ this._proxyUrl = new URL('/proxy', this.storeService.appProperties.apiEndPoint).toString() + '?';
1857
+ }
1858
+ IdentifyAsync(inp) {
1859
+ return $979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
1860
+ const up = new URLSearchParams();
1861
+ up.append('SERVICE', 'WMS');
1862
+ up.append('VERSION', '1.3');
1863
+ up.append('REQUEST', 'GetFeatureInfo');
1864
+ up.append('INFO_FORMAT', 'application/json');
1865
+ up.append('LAYERS', this._wmsProps.layers);
1866
+ up.append('QUERY_LAYERS', this._wmsProps.layers);
1867
+ up.append('STYLES', '');
1868
+ up.append('BBOX', inp.mapExtent.join(','));
1869
+ up.append('FEATURE_COUNT', '10');
1870
+ up.append('HEIGHT', inp.imageDisplay.h.toFixed(0).toString());
1871
+ up.append('WIDTH', inp.imageDisplay.w.toFixed(0).toString());
1872
+ up.append('SRS', 'EPSG:4326');
1873
+ up.append('X', Math.round(inp.screenPoint[0]).toString());
1874
+ up.append('Y', Math.round(inp.screenPoint[1]).toString());
1875
+ this._fillCustomParams('identify', up);
1876
+ const url = this._wmsProps.url + '?' + up.toString();
1877
+ if (!url) return null;
1878
+ const headers = {};
1879
+ let purl = url;
1880
+ if (this._wmsProps.useProxy) {
1881
+ headers["Authorization"] = (0, $8zHUo$yesilyazilimwebspa.TokenManager).headerValue;
1882
+ purl = this._proxyUrl + encodeURIComponent(url);
1883
+ }
1884
+ const res = yield fetch(purl, {
1885
+ headers: headers,
1886
+ method: 'GET'
1887
+ });
1888
+ if (res.ok) {
1889
+ const json = yield res.json();
1890
+ const ft = (0, $10571313f00c012e$export$4691a8a9ff232a6b).fromGeojsonFeatures(json);
1891
+ return ft;
1892
+ }
1893
+ return null;
1853
1894
  });
1854
1895
  }
1855
- static createSimplePolygon(color, strokeWidth = 2, fillOpacity = 0.1) {
1856
- if (fillOpacity == 0) return new (0, $8zHUo$olstyle.Style)({
1857
- stroke: new (0, $8zHUo$olstyle.Stroke)({
1858
- width: strokeWidth,
1859
- color: color
1860
- })
1896
+ GetLegendAsync(size = 20, scale = 0) {
1897
+ return $979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
1898
+ const up = new URLSearchParams();
1899
+ up.append('VERSION', '1.0.0');
1900
+ up.append('REQUEST', 'GetLegendGraphic');
1901
+ up.append('FORMAT', 'image/png');
1902
+ up.append('WIDTH', size.toFixed(0));
1903
+ up.append('HEIGHT', size.toFixed(0));
1904
+ up.append('LAYER', this._wmsProps.layers);
1905
+ if (scale) up.append('SCALE', scale.toFixed(0));
1906
+ const url = this._wmsProps.url + '?' + up.toString();
1907
+ if (!url) return null;
1908
+ const headers = {};
1909
+ let purl = url;
1910
+ if (this._wmsProps.useProxy) {
1911
+ headers["Authorization"] = (0, $8zHUo$yesilyazilimwebspa.TokenManager).headerValue;
1912
+ purl = this._proxyUrl + encodeURIComponent(url);
1913
+ }
1914
+ const res = yield fetch(purl, {
1915
+ headers: headers,
1916
+ method: 'GET'
1917
+ });
1918
+ if (res.ok) return yield res.blob();
1919
+ return null;
1861
1920
  });
1862
- const fc = (0, $8zHUo$olcolor.fromString)(color);
1863
- if (fc.length === 3) fc.push(fillOpacity);
1864
- else fc[3] = fillOpacity;
1865
- return new (0, $8zHUo$olstyle.Style)({
1866
- stroke: new (0, $8zHUo$olstyle.Stroke)({
1867
- width: strokeWidth,
1868
- color: color,
1869
- lineJoin: 'miter'
1870
- }),
1871
- fill: new (0, $8zHUo$olstyle.Fill)({
1872
- color: fc
1873
- })
1921
+ }
1922
+ _getImageData(url) {
1923
+ return $979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
1924
+ return new Promise((resolve, reject)=>{
1925
+ const client = new XMLHttpRequest();
1926
+ client.responseType = 'blob';
1927
+ let purl = url;
1928
+ if (this._wmsProps.useProxy) purl = this._proxyUrl + encodeURIComponent(url);
1929
+ client.open('GET', purl);
1930
+ if (this._wmsProps.useProxy) client.setRequestHeader("Authorization", (0, $8zHUo$yesilyazilimwebspa.TokenManager).headerValue);
1931
+ client.onload = function() {
1932
+ const ct = client.getResponseHeader('content-type') || '';
1933
+ if (ct.toLocaleLowerCase().startsWith('image')) resolve(URL.createObjectURL(client.response));
1934
+ else resolve(null);
1935
+ };
1936
+ client.send();
1937
+ });
1874
1938
  });
1875
1939
  }
1876
- static createStyleFromDef(def) {
1877
- if (def.type == 'simple') switch(def.geomType){
1878
- case 'Point':
1879
- return $6e4a0fdd3e43ca7d$var$createSimplePointStyle(def);
1880
- case 'LineString':
1881
- return $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(def);
1882
- case 'Polygon':
1883
- return $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(def);
1884
- default:
1885
- break;
1886
- }
1887
- else if (def.type == 'unique') switch(def.geomType){
1888
- case 'Point':
1889
- return $6e4a0fdd3e43ca7d$var$createUVPointStyle(def);
1890
- case 'LineString':
1891
- return $6e4a0fdd3e43ca7d$var$createUVLineStyle(def);
1892
- case 'Polygon':
1893
- return $6e4a0fdd3e43ca7d$var$createUVPolygonStyle(def);
1894
- default:
1895
- break;
1940
+ _getWithCustomParams(action, url) {
1941
+ const uri = URL.parse(url);
1942
+ const sp = uri.searchParams;
1943
+ this._fillCustomParams(action, sp);
1944
+ return uri.toString();
1945
+ }
1946
+ _fillCustomParams(action, sp) {
1947
+ var _a, _b;
1948
+ if (this.customParamsFnc) {
1949
+ const cparams = this.customParamsFnc(action);
1950
+ if (cparams) for (const key of Object.keys(cparams)){
1951
+ let obj = (_b = (_a = cparams[key]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
1952
+ sp.append(key, obj);
1953
+ }
1896
1954
  }
1897
1955
  }
1898
- static createFlashedStyles() {
1899
- const color = $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.FlashColor;
1900
- const map = new Map();
1901
- map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedPoint(color));
1902
- map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedLine(color));
1903
- map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedPolygon(color));
1904
- return map;
1956
+ }
1957
+ $979d8cb30b62358d$var$__decorate([
1958
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
1959
+ $979d8cb30b62358d$var$__metadata("design:type", typeof ($979d8cb30b62358d$var$_a = typeof (0, $8zHUo$yesilyazilimwebspa.StoreService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.StoreService)) === "function" ? $979d8cb30b62358d$var$_a : Object)
1960
+ ], $979d8cb30b62358d$var$GeoserverChannelBase.prototype, "storeService", void 0);
1961
+ class $979d8cb30b62358d$export$f79174341f8b6465 extends $979d8cb30b62358d$var$GeoserverChannelBase {
1962
+ constructor(wmsProps){
1963
+ super(wmsProps);
1964
+ this.source = new (0, ($parcel$interopDefault($8zHUo$olsourceTileWMS)))({
1965
+ url: this._wmsProps.url,
1966
+ params: {
1967
+ LAYERS: this._wmsProps.layers,
1968
+ format: this._wmsProps.imagetype,
1969
+ transparent: true,
1970
+ serverType: 'geoserver',
1971
+ TILED: true
1972
+ },
1973
+ transition: 0,
1974
+ crossOrigin: 'anonymous',
1975
+ serverType: 'geoserver',
1976
+ tileLoadFunction: (tile, src)=>$979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
1977
+ const urlWithParams = this._getWithCustomParams('getmap', src);
1978
+ const obj = yield this._getImageData(urlWithParams);
1979
+ if (obj) tile.getImage().src = obj;
1980
+ else tile.setState(3);
1981
+ })
1982
+ });
1905
1983
  }
1906
- static createHoverStyles() {
1907
- const circleSize = 6;
1908
- const lineSize = 4;
1909
- const color = 'rgb(124, 207, 0)';
1910
- const map = new Map();
1911
- map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePoint(color, circleSize));
1912
- map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimpleLine(color, lineSize));
1913
- map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePolygon(color, lineSize, 0.2));
1914
- return map;
1984
+ }
1985
+ class $979d8cb30b62358d$export$c5cf5c7d936c413 extends $979d8cb30b62358d$var$GeoserverChannelBase {
1986
+ constructor(wmsProps){
1987
+ super(wmsProps);
1988
+ this.source = new (0, $8zHUo$olsource.ImageWMS)({
1989
+ url: wmsProps.url,
1990
+ params: {
1991
+ LAYERS: wmsProps.layers,
1992
+ format: wmsProps.imagetype,
1993
+ transparent: true,
1994
+ serverType: 'geoserver'
1995
+ },
1996
+ crossOrigin: 'anonymous',
1997
+ serverType: 'geoserver',
1998
+ imageLoadFunction: (iw, url)=>$979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
1999
+ const urlWithParams = this._getWithCustomParams('getmap', url);
2000
+ const obj = yield this._getImageData(urlWithParams);
2001
+ if (obj) iw.getImage().src = obj;
2002
+ })
2003
+ });
1915
2004
  }
1916
- static createSelectionStyles() {
1917
- const circleSize = 6;
1918
- const lineSize = 4;
1919
- const map = new Map();
1920
- map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePoint($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, circleSize));
1921
- map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimpleLine($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, lineSize));
1922
- map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePolygon($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, lineSize, 0.2));
1923
- return map;
1924
- }
1925
- static getSelectionSymbol() {
1926
- const fc = (0, $8zHUo$olcolor.fromString)($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor);
1927
- if (fc.length === 3) fc.push(0.5);
1928
- else fc[3] = 0.5;
1929
- return new (0, $8zHUo$olstyle.Style)({
1930
- stroke: new (0, $8zHUo$olstyle.Stroke)({
1931
- color: $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor,
1932
- width: 8
1933
- }),
1934
- fill: new (0, $8zHUo$olstyle.Fill)({
1935
- color: fc
1936
- }),
1937
- image: new (0, $8zHUo$olstyle.Circle)({
1938
- radius: 12,
1939
- fill: new (0, $8zHUo$olstyle.Fill)({
1940
- color: $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor
1941
- })
1942
- })
2005
+ }
2006
+
2007
+
2008
+
2009
+ var $9f1e53e2f5ceab7e$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2010
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2011
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2012
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2013
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2014
+ };
2015
+ var $9f1e53e2f5ceab7e$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2016
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2017
+ };
2018
+ var $9f1e53e2f5ceab7e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2019
+ function adopt(value) {
2020
+ return value instanceof P ? value : new P(function(resolve) {
2021
+ resolve(value);
1943
2022
  });
1944
2023
  }
1945
- static createCanvas(style, type) {
1946
- const canvas = document.createElement('canvas');
1947
- switch(type){
1948
- case 'Point':
1949
- {
1950
- const width = 30;
1951
- const height = 30;
1952
- const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
1953
- size: [
1954
- width,
1955
- height
1956
- ]
1957
- });
1958
- vectorContext.setStyle(style);
1959
- vectorContext.drawGeometry(new (0, ($parcel$interopDefault($8zHUo$olgeomPoint)))([
1960
- width / 2,
1961
- height / 2
1962
- ]));
1963
- }
1964
- break;
1965
- case 'LineString':
1966
- {
1967
- const width = 30;
1968
- const height = 30;
1969
- const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
1970
- size: [
1971
- width,
1972
- height
1973
- ]
1974
- });
1975
- vectorContext.setStyle(style);
1976
- vectorContext.drawGeometry(new (0, ($parcel$interopDefault($8zHUo$olgeomLineString)))([
1977
- [
1978
- 0,
1979
- height / 2
1980
- ],
1981
- [
1982
- width,
1983
- height / 2
1984
- ]
1985
- ]));
1986
- }
1987
- break;
1988
- case 'Polygon':
1989
- {
1990
- const width = 30;
1991
- const height = 30;
1992
- const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
1993
- size: [
1994
- width,
1995
- height
1996
- ]
1997
- });
1998
- vectorContext.setStyle(style);
1999
- const ext = $8zHUo$olextent.boundingExtent([
2000
- [
2001
- 3,
2002
- 3
2003
- ],
2004
- [
2005
- width - 3,
2006
- height - 3
2007
- ]
2008
- ]);
2009
- vectorContext.drawGeometry((0, $8zHUo$olgeomPolygon.fromExtent)(ext));
2010
- }
2011
- break;
2012
- default:
2013
- break;
2024
+ return new (P || (P = Promise))(function(resolve, reject) {
2025
+ function fulfilled(value) {
2026
+ try {
2027
+ step(generator.next(value));
2028
+ } catch (e) {
2029
+ reject(e);
2030
+ }
2014
2031
  }
2015
- return canvas;
2016
- }
2017
- static createCanvasFromFeature(style, feature, width = 100, height = 100) {
2018
- const canvas = document.createElement('canvas');
2019
- const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
2020
- size: [
2021
- width,
2022
- height
2023
- ]
2032
+ function rejected(value) {
2033
+ try {
2034
+ step(generator["throw"](value));
2035
+ } catch (e) {
2036
+ reject(e);
2037
+ }
2038
+ }
2039
+ function step(result) {
2040
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
2041
+ }
2042
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2043
+ });
2044
+ };
2045
+ var $9f1e53e2f5ceab7e$var$_a, $9f1e53e2f5ceab7e$var$_b, $9f1e53e2f5ceab7e$var$_c;
2046
+ class $9f1e53e2f5ceab7e$export$4f2c359228ce6008 extends (0, $3ecb066746a16c54$export$23eba0cb71a4e506) {
2047
+ constructor(ld){
2048
+ super(ld);
2049
+ this.identifyType = 'remote';
2050
+ if (ld.props.tiled) {
2051
+ this._channel = new (0, $979d8cb30b62358d$export$f79174341f8b6465)(ld.props);
2052
+ this._channel.customParamsFnc = (action)=>{
2053
+ return this.getCustomParams(action);
2054
+ };
2055
+ this._layer = new (0, ($parcel$interopDefault($8zHUo$ollayerTile)))({
2056
+ source: this._channel.source,
2057
+ visible: ld.visible,
2058
+ minZoom: ld.minZoom,
2059
+ maxZoom: ld.maxZoom
2060
+ });
2061
+ } else {
2062
+ this._channel = new (0, $979d8cb30b62358d$export$c5cf5c7d936c413)(ld.props);
2063
+ this._channel.customParamsFnc = (action)=>{
2064
+ return this.getCustomParams(action);
2065
+ };
2066
+ this._layer = new (0, ($parcel$interopDefault($8zHUo$ollayerImage)))({
2067
+ source: this._channel.source,
2068
+ visible: ld.visible,
2069
+ minZoom: ld.minZoom,
2070
+ maxZoom: ld.maxZoom
2071
+ });
2072
+ }
2073
+ this._layer.setProperties({
2074
+ mapLayer: this,
2075
+ name: this._definition.key,
2076
+ canEdit: false,
2077
+ canFlash: true,
2078
+ canSelect: true
2024
2079
  });
2025
- vectorContext.setStyle(style);
2026
- vectorContext.drawFeature(feature, style);
2027
- return canvas;
2028
- }
2029
- static createGlowedLine(color, steps = 7) {
2030
- const styles = [];
2031
- let c = (0, $8zHUo$olcolor.fromString)(color);
2032
- if (c.length > 3) c = [
2033
- c[0],
2034
- c[1],
2035
- c[2]
2036
- ];
2037
- for(let i = 0; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2038
- stroke: new (0, $8zHUo$olstyle.Stroke)({
2039
- color: c.concat([
2040
- 1 / (steps - i)
2041
- ]),
2042
- width: (steps - i) * 2 - 1
2043
- })
2044
- }));
2045
- return styles;
2046
2080
  }
2047
- static createGlowedPoint(color, steps = 7) {
2048
- const styles = [];
2049
- let c = (0, $8zHUo$olcolor.fromString)(color);
2050
- if (c.length > 3) c = [
2051
- c[0],
2052
- c[1],
2053
- c[2]
2054
- ];
2055
- for(let i = 0; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2056
- image: new (0, $8zHUo$olstyle.Circle)({
2057
- radius: (steps - i) * 2 - 1,
2058
- fill: new (0, $8zHUo$olstyle.Fill)({
2059
- color: c.concat([
2060
- 1 / (steps - i)
2061
- ])
2062
- })
2063
- })
2064
- }));
2065
- return styles;
2081
+ getIdentifyPriority(feature) {
2082
+ return 0;
2066
2083
  }
2067
- static createGlowedPolygon(color, steps = 7) {
2068
- const styles = [];
2069
- let c = (0, $8zHUo$olcolor.fromString)(color);
2070
- if (c.length > 3) c = [
2071
- c[0],
2072
- c[1],
2073
- c[2]
2074
- ];
2075
- styles.push(new (0, $8zHUo$olstyle.Style)({
2076
- fill: new (0, $8zHUo$olstyle.Fill)({
2077
- color: c.concat([
2078
- 0.2
2079
- ])
2080
- })
2081
- }));
2082
- for(let i = 1; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2083
- stroke: new (0, $8zHUo$olstyle.Stroke)({
2084
- color: c.concat([
2085
- 1 / (steps - i)
2086
- ]),
2087
- width: (steps - i) * 2 - 1
2088
- })
2089
- }));
2090
- return styles;
2084
+ getLegendInfos() {
2085
+ return [];
2091
2086
  }
2092
2087
  }
2093
- $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.DefaultSymbolNum = -9999;
2094
- $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor = 'rgb(83, 234, 253)';
2095
- $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.FlashColor = 'rgb(83, 234, 253)';
2096
- function $6e4a0fdd3e43ca7d$var$createText(li) {
2097
- const color = (0, $8zHUo$olcolor.fromString)(li.textColor);
2098
- const textStyle = new (0, $8zHUo$olstyle.Text)({
2099
- font: `${li.textSize}px Roboto,sans-serif`,
2100
- overflow: !!li.overflow,
2101
- offsetY: li.offsetY | 0,
2102
- offsetX: li.offsetX | 0,
2103
- fill: new (0, $8zHUo$olstyle.Fill)({
2104
- color: color
2105
- }),
2106
- stroke: new (0, $8zHUo$olstyle.Stroke)({
2107
- color: '#fff',
2108
- width: 4
2109
- })
2110
- });
2111
- return textStyle;
2112
- }
2113
- function $6e4a0fdd3e43ca7d$var$createSimplePointStyle(def) {
2114
- const stroke = def.stroke ? new (0, $8zHUo$olstyle.Stroke)({
2115
- color: def.stroke.color,
2116
- width: def.stroke.size
2117
- }) : null;
2118
- const s = new (0, $8zHUo$olstyle.Style)({
2119
- stroke: stroke
2120
- });
2121
- if (def.pointProps) {
2122
- const fill = new (0, $8zHUo$olstyle.Fill)({
2123
- color: def.color
2124
- });
2125
- switch(def.pointProps.shape){
2126
- case 'circle':
2127
- s.setImage(new (0, $8zHUo$olstyle.Circle)({
2128
- radius: def.size,
2129
- fill: fill,
2130
- stroke: stroke
2131
- }));
2132
- break;
2133
- case 'triangle':
2134
- s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2135
- points: 3,
2136
- radius: def.size,
2137
- fill: fill,
2138
- stroke: stroke
2139
- }));
2140
- break;
2141
- case 'square':
2142
- s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2143
- points: 4,
2144
- radius: def.size,
2145
- fill: fill,
2146
- angle: Math.PI / 4,
2147
- stroke: stroke
2148
- }));
2149
- break;
2150
- case 'pentagon':
2151
- s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2152
- points: 5,
2153
- radius: def.size,
2154
- fill: fill,
2155
- stroke: stroke
2156
- }));
2157
- break;
2158
- case 'star':
2159
- s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2160
- points: 5,
2161
- radius: def.size,
2162
- radius2: def.size / 2,
2163
- fill: fill,
2164
- stroke: stroke
2165
- }));
2166
- break;
2167
- case 'image':
2168
- s.setImage(new (0, $8zHUo$olstyle.Icon)({
2169
- anchor: def.pointProps.anchor,
2170
- anchorXUnits: 'fraction',
2171
- anchorYUnits: 'fraction',
2172
- src: def.pointProps.src,
2173
- height: def.pointProps.height,
2174
- width: def.pointProps.width,
2175
- offset: def.pointProps.offset
2176
- }));
2177
- break;
2178
- default:
2179
- break;
2180
- }
2088
+ $9f1e53e2f5ceab7e$var$__decorate([
2089
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2090
+ $9f1e53e2f5ceab7e$var$__metadata("design:type", Object)
2091
+ ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "mapManager", void 0);
2092
+ $9f1e53e2f5ceab7e$var$__decorate([
2093
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2094
+ $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_a = typeof (0, $8zHUo$yesilyazilimwebspa.StoreService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.StoreService)) === "function" ? $9f1e53e2f5ceab7e$var$_a : Object)
2095
+ ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "storeService", void 0);
2096
+ $9f1e53e2f5ceab7e$var$__decorate([
2097
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2098
+ $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_b = typeof (0, $8zHUo$yesilyazilimwebspa.EventService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.EventService)) === "function" ? $9f1e53e2f5ceab7e$var$_b : Object)
2099
+ ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "eventService", void 0);
2100
+ class $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8 extends $9f1e53e2f5ceab7e$export$4f2c359228ce6008 {
2101
+ getCustomParams(action) {
2102
+ const map = this._layer.getMapInternal();
2103
+ const view = map.getView();
2104
+ let extArr = view.calculateExtent(map.getSize());
2105
+ let defaultParams = `scale:${this.calculateEpsForScreenDistance(map)};xmin:${extArr[0]};ymin:${extArr[1]};xmax:${extArr[2]};ymax:${extArr[3]};`;
2106
+ const user = this.authService.currentUser;
2107
+ if (user) defaultParams = defaultParams + `uid:${user.id};`;
2108
+ if (this._currentTime > 0) defaultParams = defaultParams + `epctime:${this._currentTime};`;
2109
+ const obj = {
2110
+ "viewParams": defaultParams
2111
+ };
2112
+ return obj;
2113
+ }
2114
+ queryIdentifyAsync(data) {
2115
+ return $9f1e53e2f5ceab7e$var$__awaiter(this, void 0, void 0, function*() {
2116
+ const res = yield this._channel.IdentifyAsync(data);
2117
+ if (res && res.length > 0) {
2118
+ const items = res.map((f)=>({
2119
+ layerTitle: this.definition.title,
2120
+ layerKey: this.definition.key,
2121
+ feature: f
2122
+ }));
2123
+ return {
2124
+ success: true,
2125
+ data: items
2126
+ };
2127
+ } else return {
2128
+ success: true,
2129
+ data: []
2130
+ };
2131
+ });
2132
+ }
2133
+ generatePopupItemsAsync(feature) {
2134
+ return $9f1e53e2f5ceab7e$var$__awaiter(this, void 0, void 0, function*() {
2135
+ return [];
2136
+ });
2137
+ }
2138
+ calculateEpsForScreenDistance(map) {
2139
+ const view = map.getView();
2140
+ const resolution = view.getResolution();
2141
+ const center = view.getCenter();
2142
+ const lat = center[1];
2143
+ const zoom = view.getZoom();
2144
+ let pixelMeters = 15;
2145
+ if (zoom <= 6) pixelMeters = 7.5;
2146
+ else if (zoom <= 7) pixelMeters = 10;
2147
+ const metersDistance = pixelMeters * resolution;
2148
+ const metersPerDegree = 111320 * Math.cos(lat * Math.PI / 180);
2149
+ const eps = metersDistance / metersPerDegree;
2150
+ return this.exponentToDecimals(eps);
2151
+ }
2152
+ exponentToDecimals(num) {
2153
+ if (num < 0.000001) {
2154
+ let numChunks = [];
2155
+ numChunks = num.toString().split('e');
2156
+ let numOfZeroes = Math.abs(numChunks[1]) - 1;
2157
+ let decimalNumber = '';
2158
+ let zeroes = '';
2159
+ let int = numChunks[0];
2160
+ for(let i = 0; i < int.length; i++)int = int.replace('.', '');
2161
+ for(let i = 0; i < numOfZeroes; i++)zeroes += '0';
2162
+ return '0.' + zeroes + int;
2163
+ } else return num;
2181
2164
  }
2182
- if (def.labelDef) s.setText($6e4a0fdd3e43ca7d$var$createText(def.labelDef));
2183
- return s;
2184
- }
2185
- function $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(def) {
2186
- return new (0, $8zHUo$olstyle.Style)({
2187
- stroke: new (0, $8zHUo$olstyle.Stroke)({
2188
- width: def.size,
2189
- color: def.color
2190
- })
2191
- });
2192
- }
2193
- function $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(def) {
2194
- let strokeColor = (0, $8zHUo$olcolor.fromString)(def.color);
2195
- let fillColor = (0, $8zHUo$olcolor.fromString)(def.color);
2196
- let strokeSize = 3;
2197
- if (def.stroke) {
2198
- strokeColor = (0, $8zHUo$olcolor.fromString)(def.stroke.color);
2199
- strokeSize = def.stroke.size;
2200
- } else fillColor = $6e4a0fdd3e43ca7d$var$setAlpha(fillColor, 0.1);
2201
- const s = new (0, $8zHUo$olstyle.Style)({
2202
- stroke: new (0, $8zHUo$olstyle.Stroke)({
2203
- width: strokeSize,
2204
- color: strokeColor
2205
- }),
2206
- fill: new (0, $8zHUo$olstyle.Fill)({
2207
- color: fillColor
2208
- })
2209
- });
2210
- if (def.labelDef) s.setText($6e4a0fdd3e43ca7d$var$createText(def.labelDef));
2211
- return s;
2212
- }
2213
- function $6e4a0fdd3e43ca7d$var$createUVPointStyle(def) {
2214
- const map = new Map();
2215
- for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimplePointStyle(uv.symbol));
2216
- return map;
2217
- }
2218
- function $6e4a0fdd3e43ca7d$var$createUVLineStyle(def) {
2219
- const map = new Map();
2220
- for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(uv.symbol));
2221
- return map;
2222
- }
2223
- function $6e4a0fdd3e43ca7d$var$createUVPolygonStyle(def) {
2224
- const map = new Map();
2225
- for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(uv.symbol));
2226
- return map;
2227
2165
  }
2166
+ $9f1e53e2f5ceab7e$var$__decorate([
2167
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2168
+ $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_c = typeof (0, $8zHUo$yesilyazilimwebspa.AuthService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.AuthService)) === "function" ? $9f1e53e2f5ceab7e$var$_c : Object)
2169
+ ], $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8.prototype, "authService", void 0);
2228
2170
 
2229
2171
 
2230
- var $9e9fe0098715b2dd$exports = {};
2231
-
2232
- $parcel$export($9e9fe0098715b2dd$exports, "getLayerProps", () => $9e9fe0098715b2dd$export$901d0a0c97b4d88a);
2233
- function $9e9fe0098715b2dd$export$901d0a0c97b4d88a(layer) {
2234
- return layer.getProperties();
2172
+ var $53e9cc699e7a4a99$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2173
+ function adopt(value) {
2174
+ return value instanceof P ? value : new P(function(resolve) {
2175
+ resolve(value);
2176
+ });
2177
+ }
2178
+ return new (P || (P = Promise))(function(resolve, reject) {
2179
+ function fulfilled(value) {
2180
+ try {
2181
+ step(generator.next(value));
2182
+ } catch (e) {
2183
+ reject(e);
2184
+ }
2185
+ }
2186
+ function rejected(value) {
2187
+ try {
2188
+ step(generator["throw"](value));
2189
+ } catch (e) {
2190
+ reject(e);
2191
+ }
2192
+ }
2193
+ function step(result) {
2194
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
2195
+ }
2196
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
2197
+ });
2198
+ };
2199
+ class $53e9cc699e7a4a99$export$e8f1b5fbf8989533 {
2200
+ constructor(){
2201
+ this.type = (0, $91d76f4d8e753f27$export$3c6428acb8ce7fb9).WMS;
2202
+ }
2203
+ createAsync(ld) {
2204
+ return $53e9cc699e7a4a99$var$__awaiter(this, void 0, void 0, function*() {
2205
+ const opres = {
2206
+ success: true,
2207
+ data: new (0, $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8)(ld)
2208
+ };
2209
+ return Promise.resolve(opres);
2210
+ });
2211
+ }
2235
2212
  }
2236
2213
 
2237
2214
 
2238
-
2239
-
2240
- var $69345a20bc0f2569$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2241
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2242
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2243
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2244
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2245
- };
2246
- var $69345a20bc0f2569$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2247
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2248
- };
2249
- let $69345a20bc0f2569$export$a67c77aa289f97c1 = class FeatureContextMenuComponent extends (0, $8zHUo$yesilyazilimwebspa.BaseElement) {
2250
- constructor(_loc, items, action, isGlass){
2251
- super();
2252
- this._loc = _loc;
2253
- this.action = action;
2254
- this.isGlass = isGlass;
2255
- this._closeHandler = 0;
2256
- const arr = this._groupItems(items);
2257
- for(let i = 0; i < arr.length; i++){
2258
- const kvp = arr[i];
2259
- this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).span(kvp.title, 'GroupTitle'));
2260
- let count = 0;
2261
- const limit = 10;
2262
- for (const item of kvp.items)if (++count > limit) {
2263
- item.title = "++ Di\u011Fer " + (kvp.items.length - limit).toString();
2264
- this.appendChild(new $69345a20bc0f2569$var$ContextMenuItemComponent(this, item, true));
2265
- break;
2266
- } else this.appendChild(new $69345a20bc0f2569$var$ContextMenuItemComponent(this, item));
2267
- if (i < arr.length - 1) this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).div('Seperator'));
2268
- }
2269
- if (isGlass) this.classList.add("glass");
2270
- }
2271
- setActive(key, value) {}
2272
- setDisabled(key, value) {}
2273
- onConnected() {
2274
- this.style.top = this._loc.y + 'px';
2275
- this.style.left = this._loc.x + 'px';
2276
- this.addEventListener('mouseleave', ()=>{
2277
- this._closeHandler = setTimeout(()=>{
2278
- this._closeHandler = 0;
2279
- this.remove();
2280
- }, 200);
2281
- }, {
2282
- once: true
2283
- });
2284
- this.addEventListener('mouseenter', ()=>{
2285
- if (this._closeHandler) {
2286
- clearTimeout(this._closeHandler);
2287
- this._closeHandler = 0;
2288
- }
2289
- });
2290
- document.body.addEventListener('mouseenter', ()=>{
2291
- this._closeHandler = setTimeout(()=>{
2292
- this._closeHandler = 0;
2293
- this.remove();
2294
- }, 200);
2295
- }, {
2296
- once: true
2297
- });
2298
- }
2299
- onItemMouseEnter(child) {
2300
- this.action('enter', child.item);
2301
- }
2302
- onItemMouseLeave(child) {
2303
- this.action('leave', child.item);
2304
- }
2305
- onItemMouseClick(child) {
2306
- this.action('leave', child.item);
2307
- this.action('click', child.item);
2308
- this.remove();
2309
- }
2310
- _groupItems(items) {
2311
- const map = new Map();
2312
- for (const item of items){
2313
- const gkey = item.group || '';
2314
- let garr = map.get(gkey);
2315
- if (!garr) {
2316
- garr = [];
2317
- map.set(gkey, garr);
2318
- }
2319
- garr.push(item);
2320
- }
2321
- const arr = [];
2322
- map.forEach((v, k)=>{
2323
- arr.push({
2324
- title: k,
2325
- items: v
2326
- });
2327
- });
2328
- return arr;
2329
- }
2330
- };
2331
- $69345a20bc0f2569$export$a67c77aa289f97c1 = $69345a20bc0f2569$var$__decorate([
2332
- (0, $8zHUo$yesilyazilimwebspa.Component)({
2333
- elementName: 'map-feat-cm'
2334
- }),
2335
- $69345a20bc0f2569$var$__metadata("design:paramtypes", [
2336
- Object,
2337
- Array,
2338
- Object,
2339
- Boolean
2340
- ])
2341
- ], $69345a20bc0f2569$export$a67c77aa289f97c1);
2342
- let $69345a20bc0f2569$var$ContextMenuItemComponent = class ContextMenuItemComponent extends (0, $8zHUo$yesilyazilimwebspa.BaseElement) {
2343
- constructor(menu, item, disabled = false){
2344
- super();
2345
- this.menu = menu;
2346
- this.item = item;
2347
- if (disabled) {
2348
- this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).label(item.title, "cm-title"));
2349
- this.disabled = true;
2350
- } else {
2351
- this.addEventListener('mouseenter', ()=>{
2352
- this.menu.onItemMouseEnter(this);
2353
- });
2354
- this.addEventListener('mouseleave', ()=>{
2355
- this.menu.onItemMouseLeave(this);
2356
- });
2357
- this.addEventListener('click', ()=>{
2358
- this.menu.onItemMouseClick(this);
2359
- });
2360
- if (item.iconClass) {
2361
- const iconElm = (0, $8zHUo$yesilyazilimwebspa.ELF).icon("cm-icon " + item.iconClass);
2362
- this.appendChild(iconElm);
2363
- }
2364
- this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).label(item.title, "cm-title"));
2365
- }
2366
- }
2367
- };
2368
- $69345a20bc0f2569$var$ContextMenuItemComponent = $69345a20bc0f2569$var$__decorate([
2369
- (0, $8zHUo$yesilyazilimwebspa.Component)({
2370
- elementName: 'map-feat-cm-item'
2371
- }),
2372
- $69345a20bc0f2569$var$__metadata("design:paramtypes", [
2373
- $69345a20bc0f2569$export$a67c77aa289f97c1,
2374
- Object,
2375
- Boolean
2376
- ])
2377
- ], $69345a20bc0f2569$var$ContextMenuItemComponent);
2378
-
2379
-
2380
-
2381
- var $e2e9872d2858bcde$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2382
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2383
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2384
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2385
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2386
- };
2387
- var $e2e9872d2858bcde$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2388
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2389
- };
2390
- var $e2e9872d2858bcde$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2391
- function adopt(value) {
2392
- return value instanceof P ? value : new P(function(resolve) {
2393
- resolve(value);
2394
- });
2215
+ var $4542e2c018b508ca$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2216
+ function adopt(value) {
2217
+ return value instanceof P ? value : new P(function(resolve) {
2218
+ resolve(value);
2219
+ });
2395
2220
  }
2396
2221
  return new (P || (P = Promise))(function(resolve, reject) {
2397
2222
  function fulfilled(value) {
@@ -2414,433 +2239,634 @@ var $e2e9872d2858bcde$var$__awaiter = undefined && undefined.__awaiter || functi
2414
2239
  step((generator = generator.apply(thisArg, _arguments || [])).next());
2415
2240
  });
2416
2241
  };
2417
- var $e2e9872d2858bcde$var$_a, $e2e9872d2858bcde$var$_b;
2418
- const $e2e9872d2858bcde$var$LO_SELECTION = 10000;
2419
- const $e2e9872d2858bcde$var$LO_FLASH = 10020;
2420
- let $e2e9872d2858bcde$export$c521bb0b406df9a3 = class MapManager {
2421
- constructor(){
2422
- this._activeDraw = null;
2423
- this._selectionDict = new Map();
2424
- this._animations = new Map();
2425
- this._animationHandler = 0;
2426
- this.commandDisplayer = new $e2e9872d2858bcde$var$CmxCommandDisplayer();
2427
- this._onGotoExtendRequested = (ed)=>{
2428
- return new Promise((resolve, reject)=>{
2429
- this._view.fit(ed.extent, {
2430
- maxZoom: 20,
2431
- duration: 300,
2432
- callback: (isOk)=>{
2433
- resolve(isOk);
2434
- }
2435
- });
2242
+ class $4542e2c018b508ca$export$5612f11f554f467 {
2243
+ constructor(customLayerFactories){
2244
+ this._map = new Map();
2245
+ this._register(new (0, $ebdb133fb916235d$export$70cc7c4c8953dde9)());
2246
+ this._register(new (0, $53e9cc699e7a4a99$export$e8f1b5fbf8989533)());
2247
+ for (const lf of customLayerFactories)this._register(lf);
2248
+ }
2249
+ createAsync(ld) {
2250
+ return $4542e2c018b508ca$var$__awaiter(this, void 0, void 0, function*() {
2251
+ const lf = this._map.get(ld.type);
2252
+ if (!lf) return Promise.resolve({
2253
+ success: false,
2254
+ message: 'LayerFactory type not registered > ' + ld.type
2436
2255
  });
2437
- };
2438
- this._onFlashGeomRequested = (ed)=>{
2439
- return this.flash(ed);
2440
- };
2441
- this._completed = true;
2442
- this._animator = ()=>{
2443
- if (this._animationHandler == 0) return;
2444
- if (!this._completed) return;
2445
- this._completed = false;
2446
- const zoom = this.zoom;
2447
- for (const animation of this._animations.values())if (zoom >= animation.minZoom && animation.layer.checked && !animation.layer.passive) {
2448
- animation.animateFunction();
2449
- animation.layer.layerObj.changed();
2256
+ const res = yield lf.createAsync(ld);
2257
+ if (res.success && res.data) {
2258
+ if (yield res.data.prepareAsync()) return res;
2259
+ return {
2260
+ success: false,
2261
+ message: 'Layer Prepare error > ' + ld.key
2262
+ };
2450
2263
  }
2451
- this._completed = true;
2452
- };
2453
- }
2454
- init(map, view, popupDiv, layerManager) {
2455
- if (this._map) return;
2456
- this._layerManager = layerManager;
2457
- this._map = map;
2458
- this._view = view;
2459
- this._popupDiv = popupDiv;
2460
- this._initPopup();
2461
- this._selectionLayer = new (0, ($parcel$interopDefault($8zHUo$ollayerVector)))({
2462
- source: new (0, ($parcel$interopDefault($8zHUo$olsourceVector)))(),
2463
- style: (0, $6e4a0fdd3e43ca7d$export$a1c933612b1f668c).getSelectionSymbol(),
2464
- zIndex: $e2e9872d2858bcde$var$LO_SELECTION,
2465
- map: this._map
2466
- });
2467
- this._flashLayer = new (0, ($parcel$interopDefault($8zHUo$ollayerVector)))({
2468
- source: new (0, ($parcel$interopDefault($8zHUo$olsourceVector)))(),
2469
- style: this._getFlashSymbol(),
2470
- zIndex: $e2e9872d2858bcde$var$LO_FLASH,
2471
- map: this._map
2264
+ return res;
2472
2265
  });
2473
- this.eventService.listen((0, $91d76f4d8e753f27$export$3b3923acac36255a).MapGotoExtentRequest, this._onGotoExtendRequested);
2474
- this.eventService.listen((0, $91d76f4d8e753f27$export$3b3923acac36255a).MapFlashGeomRequest, this._onFlashGeomRequested);
2475
- }
2476
- get map() {
2477
- return this._map;
2478
- }
2479
- get view() {
2480
- return this._view;
2481
- }
2482
- get zoom() {
2483
- return Math.trunc(this._view.getZoom());
2484
- }
2485
- startDraw(draw) {
2486
- this.cancelDraw();
2487
- this._activeDraw = draw;
2488
- this._map.addInteraction(this._activeDraw);
2489
- }
2490
- cancelDraw() {
2491
- if (this._activeDraw) {
2492
- if (this._activeDraw.getActive()) this._activeDraw.abortDrawing();
2493
- this._map.removeInteraction(this._activeDraw);
2494
- }
2495
- this._activeDraw = null;
2496
- }
2497
- setSelectedFeatures(dict) {
2498
- this._selectionLayer.getSource().clear();
2499
- for (const layer of this._selectionDict.keys())if (layer.identifyType == 'mvt' && layer.setFeaturesSelected) layer.setFeaturesSelected([]);
2500
- this._selectionDict.clear();
2501
- if (!(dict && dict.size > 0)) return;
2502
- const cloneFeat = (layer, feat)=>{
2503
- const copy = new (0, $8zHUo$ol.Feature)(feat.getGeometry());
2504
- return copy;
2505
- };
2506
- const selLayerFeats = [];
2507
- for (const layer of dict.keys()){
2508
- const features = dict.get(layer);
2509
- if (layer.identifyType == 'mvt' && layer.setFeaturesSelected) layer.setFeaturesSelected(features);
2510
- else {
2511
- const feats = features.map((_)=>cloneFeat(layer, _));
2512
- selLayerFeats.push(...feats);
2513
- }
2514
- this._selectionDict.set(layer, features);
2515
- }
2516
- this._selectionLayer.getSource().addFeatures(selLayerFeats);
2517
2266
  }
2518
- showPopup(at, content) {
2519
- if (!(at && content)) {
2520
- this._popup.setPosition(undefined);
2521
- return;
2522
- }
2523
- const contentDiv = this._popupDiv.querySelector('.popup-content');
2524
- if (contentDiv) {
2525
- contentDiv.innerHTML = '';
2526
- contentDiv.appendChild(content);
2527
- }
2528
- this._popup.setPosition(at);
2267
+ _register(lf) {
2268
+ this._map.set(lf.type, lf);
2529
2269
  }
2530
- startAnimate(key, animation) {
2531
- this._animations.set(key, animation);
2532
- this._beginAnimate();
2533
- }
2534
- endAnimate(key) {
2535
- if (this._animations.delete(key) && this._animations.size == 0) this._endAnimate();
2270
+ }
2271
+
2272
+
2273
+ var $a93fef52f234fd9d$exports = {};
2274
+
2275
+ $parcel$export($a93fef52f234fd9d$exports, "FlashLayer", () => $a93fef52f234fd9d$export$deefba2ead809686);
2276
+
2277
+
2278
+
2279
+
2280
+
2281
+
2282
+
2283
+
2284
+
2285
+
2286
+ var $e2e9872d2858bcde$exports = {};
2287
+
2288
+ $parcel$export($e2e9872d2858bcde$exports, "MapManager", () => $e2e9872d2858bcde$export$c521bb0b406df9a3);
2289
+
2290
+
2291
+
2292
+
2293
+
2294
+
2295
+
2296
+ var $6e4a0fdd3e43ca7d$exports = {};
2297
+
2298
+ $parcel$export($6e4a0fdd3e43ca7d$exports, "SymbologyFactory", () => $6e4a0fdd3e43ca7d$export$a1c933612b1f668c);
2299
+
2300
+
2301
+
2302
+
2303
+
2304
+
2305
+
2306
+ const $6e4a0fdd3e43ca7d$var$setAlpha = function(color, alpha) {
2307
+ if (color.length == 4) return [
2308
+ color[0],
2309
+ color[1],
2310
+ color[2],
2311
+ alpha
2312
+ ];
2313
+ else return color.concat(alpha);
2314
+ };
2315
+ class $6e4a0fdd3e43ca7d$export$a1c933612b1f668c {
2316
+ static createSimplePoint(color, radius = 5) {
2317
+ return new (0, $8zHUo$olstyle.Style)({
2318
+ image: new (0, $8zHUo$olstyle.Circle)({
2319
+ radius: radius,
2320
+ fill: new (0, $8zHUo$olstyle.Fill)({
2321
+ color: color
2322
+ })
2323
+ })
2324
+ });
2536
2325
  }
2537
- hasAnimate(key) {
2538
- return this._animations.has(key);
2326
+ static createSimpleLine(color, width = 2) {
2327
+ return new (0, $8zHUo$olstyle.Style)({
2328
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2329
+ color: color,
2330
+ width: width
2331
+ })
2332
+ });
2539
2333
  }
2540
- stopAnimations() {
2541
- this._endAnimate();
2542
- this.eventService.raise((0, $91d76f4d8e753f27$export$3b3923acac36255a).DisableAnimations, null);
2543
- return new Promise((resolve)=>{
2544
- setTimeout(()=>{
2545
- requestAnimationFrame(()=>{
2546
- resolve();
2547
- });
2548
- }, 50);
2334
+ static createSimplePolygon(color, strokeWidth = 2, fillOpacity = 0.1) {
2335
+ if (fillOpacity == 0) return new (0, $8zHUo$olstyle.Style)({
2336
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2337
+ width: strokeWidth,
2338
+ color: color
2339
+ })
2340
+ });
2341
+ const fc = (0, $8zHUo$olcolor.fromString)(color);
2342
+ if (fc.length === 3) fc.push(fillOpacity);
2343
+ else fc[3] = fillOpacity;
2344
+ return new (0, $8zHUo$olstyle.Style)({
2345
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2346
+ width: strokeWidth,
2347
+ color: color,
2348
+ lineJoin: 'miter'
2349
+ }),
2350
+ fill: new (0, $8zHUo$olstyle.Fill)({
2351
+ color: fc
2352
+ })
2549
2353
  });
2550
2354
  }
2551
- resumeAnimation() {
2552
- this._beginAnimate();
2355
+ static createStyleFromDef(def) {
2356
+ if (def.type == 'simple') switch(def.geomType){
2357
+ case 'Point':
2358
+ return $6e4a0fdd3e43ca7d$var$createSimplePointStyle(def);
2359
+ case 'LineString':
2360
+ return $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(def);
2361
+ case 'Polygon':
2362
+ return $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(def);
2363
+ default:
2364
+ break;
2365
+ }
2366
+ else if (def.type == 'unique') switch(def.geomType){
2367
+ case 'Point':
2368
+ return $6e4a0fdd3e43ca7d$var$createUVPointStyle(def);
2369
+ case 'LineString':
2370
+ return $6e4a0fdd3e43ca7d$var$createUVLineStyle(def);
2371
+ case 'Polygon':
2372
+ return $6e4a0fdd3e43ca7d$var$createUVPolygonStyle(def);
2373
+ default:
2374
+ break;
2375
+ }
2553
2376
  }
2554
- changeCursor(cursor = '') {
2555
- this.map.getTargetElement().style.cursor = cursor;
2377
+ static createFlashedStyles() {
2378
+ const color = $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.FlashColor;
2379
+ const map = new Map();
2380
+ map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedPoint(color));
2381
+ map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedLine(color));
2382
+ map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createGlowedPolygon(color));
2383
+ return map;
2556
2384
  }
2557
- getCurrentIdentifyDataFor(pixel) {
2558
- const vse = this._view.getViewStateAndExtent();
2559
- const rect = this._map.getTargetElement().getBoundingClientRect();
2560
- const inp = {
2561
- coords: this._map.getCoordinateFromPixel(pixel),
2562
- imageDisplay: {
2563
- w: rect.width,
2564
- h: rect.height,
2565
- dpi: 96
2566
- },
2567
- mapExtent: vse.extent,
2568
- screenPoint: pixel,
2569
- tolerance: 3,
2570
- resolution: this._view.getResolution()
2571
- };
2572
- return inp;
2385
+ static createHoverStyles() {
2386
+ const circleSize = 6;
2387
+ const lineSize = 4;
2388
+ const color = 'rgb(124, 207, 0)';
2389
+ const map = new Map();
2390
+ map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePoint(color, circleSize));
2391
+ map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimpleLine(color, lineSize));
2392
+ map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePolygon(color, lineSize, 0.2));
2393
+ return map;
2573
2394
  }
2574
- getOneFeatureAt(pixel, opt) {
2575
- return $e2e9872d2858bcde$var$__awaiter(this, void 0, void 0, function*() {
2576
- let contents = [];
2577
- let maxPri = 0;
2578
- const forEachFeatureCallback = (feature, layer)=>{
2579
- var _a;
2580
- if (!layer) return;
2581
- if (opt.featureFilter) {
2582
- if (!opt.featureFilter(feature)) return;
2395
+ static createSelectionStyles() {
2396
+ const circleSize = 6;
2397
+ const lineSize = 4;
2398
+ const map = new Map();
2399
+ map.set('Point', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePoint($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, circleSize));
2400
+ map.set('LineString', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimpleLine($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, lineSize));
2401
+ map.set('Polygon', $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.createSimplePolygon($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor, lineSize, 0.2));
2402
+ return map;
2403
+ }
2404
+ static getSelectionSymbol() {
2405
+ const fc = (0, $8zHUo$olcolor.fromString)($6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor);
2406
+ if (fc.length === 3) fc.push(0.5);
2407
+ else fc[3] = 0.5;
2408
+ return new (0, $8zHUo$olstyle.Style)({
2409
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2410
+ color: $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor,
2411
+ width: 8
2412
+ }),
2413
+ fill: new (0, $8zHUo$olstyle.Fill)({
2414
+ color: fc
2415
+ }),
2416
+ image: new (0, $8zHUo$olstyle.Circle)({
2417
+ radius: 12,
2418
+ fill: new (0, $8zHUo$olstyle.Fill)({
2419
+ color: $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor
2420
+ })
2421
+ })
2422
+ });
2423
+ }
2424
+ static createCanvas(style, type) {
2425
+ const canvas = document.createElement('canvas');
2426
+ switch(type){
2427
+ case 'Point':
2428
+ {
2429
+ const width = 30;
2430
+ const height = 30;
2431
+ const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
2432
+ size: [
2433
+ width,
2434
+ height
2435
+ ]
2436
+ });
2437
+ vectorContext.setStyle(style);
2438
+ vectorContext.drawGeometry(new (0, ($parcel$interopDefault($8zHUo$olgeomPoint)))([
2439
+ width / 2,
2440
+ height / 2
2441
+ ]));
2583
2442
  }
2584
- const mapLayer = (_a = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(layer)) === null || _a === void 0 ? void 0 : _a.mapLayer;
2585
- if (!!!(mapLayer === null || mapLayer === void 0 ? void 0 : mapLayer.getFeatureTitle)) return;
2586
- const title = mapLayer.getFeatureTitle(feature);
2587
- if (title && contents.findIndex((old)=>old.layer === layer && old.feature.getId() === feature.getId()) < 0) {
2588
- const pri = mapLayer.getIdentifyPriority(feature);
2589
- if (pri >= maxPri) {
2590
- if (pri > maxPri) {
2591
- contents = [];
2592
- maxPri = pri;
2593
- }
2594
- contents.push({
2595
- feature: feature,
2596
- layer: layer,
2597
- mapLayer: mapLayer,
2598
- title: title,
2599
- iconClass: 'bi bi-caret-right-fill'
2600
- });
2601
- }
2443
+ break;
2444
+ case 'LineString':
2445
+ {
2446
+ const width = 30;
2447
+ const height = 30;
2448
+ const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
2449
+ size: [
2450
+ width,
2451
+ height
2452
+ ]
2453
+ });
2454
+ vectorContext.setStyle(style);
2455
+ vectorContext.drawGeometry(new (0, ($parcel$interopDefault($8zHUo$olgeomLineString)))([
2456
+ [
2457
+ 0,
2458
+ height / 2
2459
+ ],
2460
+ [
2461
+ width,
2462
+ height / 2
2463
+ ]
2464
+ ]));
2602
2465
  }
2603
- };
2604
- this.map.forEachFeatureAtPixel(pixel, forEachFeatureCallback, opt);
2605
- let imageLayers = this._layerManager.layerList.filter((ml)=>ml.identifyType == 'remote');
2606
- if (opt.layerFilter) imageLayers = imageLayers.filter((ml)=>opt.layerFilter(ml.layerObj));
2607
- const arr = [];
2608
- for (const iml of imageLayers){
2609
- const imgLyr = iml;
2610
- const inp = this.getCurrentIdentifyDataFor(pixel);
2611
- const prms = new Promise((resolve)=>{
2612
- imgLyr.queryIdentifyAsync(inp).then((r)=>{
2613
- resolve({
2614
- lyr: imgLyr,
2615
- result: r
2616
- });
2466
+ break;
2467
+ case 'Polygon':
2468
+ {
2469
+ const width = 30;
2470
+ const height = 30;
2471
+ const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
2472
+ size: [
2473
+ width,
2474
+ height
2475
+ ]
2617
2476
  });
2618
- });
2619
- arr.push(prms);
2620
- }
2621
- const prmsResults = yield Promise.all(arr);
2622
- for (const prmRes of prmsResults){
2623
- const res = prmRes.result;
2624
- if (!res.success) continue;
2625
- for (const item of res.data){
2626
- const pri = prmRes.lyr.getIdentifyPriority(item.feature);
2627
- if (pri >= maxPri) {
2628
- if (pri > maxPri) {
2629
- contents = [];
2630
- maxPri = pri;
2631
- }
2632
- contents.push({
2633
- feature: item.feature,
2634
- layer: prmRes.lyr.layerObj,
2635
- mapLayer: prmRes.lyr,
2636
- title: item.layerTitle,
2637
- iconClass: 'bi bi-caret-right-fill'
2638
- });
2639
- }
2477
+ vectorContext.setStyle(style);
2478
+ const ext = $8zHUo$olextent.boundingExtent([
2479
+ [
2480
+ 3,
2481
+ 3
2482
+ ],
2483
+ [
2484
+ width - 3,
2485
+ height - 3
2486
+ ]
2487
+ ]);
2488
+ vectorContext.drawGeometry((0, $8zHUo$olgeomPolygon.fromExtent)(ext));
2640
2489
  }
2641
- }
2642
- if (contents && contents.length > 0) {
2643
- if (contents.length === 1) return Promise.resolve(contents[0]);
2644
- else return new Promise((resolve)=>{
2645
- var self = this;
2646
- const cmdAction = function(action, item) {
2647
- var _a, _b;
2648
- if (action == 'enter') {
2649
- const maplayer = (_a = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(item.layer)) === null || _a === void 0 ? void 0 : _a.mapLayer;
2650
- if (maplayer.identifyType == 'feature') maplayer.flashFeatures(item.feature);
2651
- else if (maplayer.identifyType == 'mvt') maplayer.flashFeatures(item.feature);
2652
- else if (maplayer.identifyType == 'remote') {
2653
- const ft = item.feature;
2654
- self.flashGeom(ft.getGeometry());
2655
- }
2656
- } else if (action == 'leave') {
2657
- const maplayer = (_b = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(item.layer)) === null || _b === void 0 ? void 0 : _b.mapLayer;
2658
- if (maplayer.identifyType == 'feature') maplayer.flashFeatures(null);
2659
- else if (maplayer.identifyType == 'mvt') maplayer.flashFeatures(null);
2660
- else if (maplayer.identifyType == 'remote') self.flashGeom(null);
2661
- } else if (action == 'click') resolve(item);
2662
- };
2663
- this.showContextMenuAt(opt.menux, opt.menuy, contents, cmdAction, true);
2664
- });
2665
- }
2666
- return Promise.resolve(null);
2490
+ break;
2491
+ default:
2492
+ break;
2493
+ }
2494
+ return canvas;
2495
+ }
2496
+ static createCanvasFromFeature(style, feature, width = 100, height = 100) {
2497
+ const canvas = document.createElement('canvas');
2498
+ const vectorContext = (0, $8zHUo$olrender.toContext)(canvas.getContext('2d'), {
2499
+ size: [
2500
+ width,
2501
+ height
2502
+ ]
2667
2503
  });
2504
+ vectorContext.setStyle(style);
2505
+ vectorContext.drawFeature(feature, style);
2506
+ return canvas;
2507
+ }
2508
+ static createGlowedLine(color, steps = 7) {
2509
+ const styles = [];
2510
+ let c = (0, $8zHUo$olcolor.fromString)(color);
2511
+ if (c.length > 3) c = [
2512
+ c[0],
2513
+ c[1],
2514
+ c[2]
2515
+ ];
2516
+ for(let i = 0; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2517
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2518
+ color: c.concat([
2519
+ 1 / (steps - i)
2520
+ ]),
2521
+ width: (steps - i) * 2 - 1
2522
+ })
2523
+ }));
2524
+ return styles;
2525
+ }
2526
+ static createGlowedPoint(color, steps = 7) {
2527
+ const styles = [];
2528
+ let c = (0, $8zHUo$olcolor.fromString)(color);
2529
+ if (c.length > 3) c = [
2530
+ c[0],
2531
+ c[1],
2532
+ c[2]
2533
+ ];
2534
+ for(let i = 0; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2535
+ image: new (0, $8zHUo$olstyle.Circle)({
2536
+ radius: (steps - i) * 2 - 1,
2537
+ fill: new (0, $8zHUo$olstyle.Fill)({
2538
+ color: c.concat([
2539
+ 1 / (steps - i)
2540
+ ])
2541
+ })
2542
+ })
2543
+ }));
2544
+ return styles;
2545
+ }
2546
+ static createGlowedPolygon(color, steps = 7) {
2547
+ const styles = [];
2548
+ let c = (0, $8zHUo$olcolor.fromString)(color);
2549
+ if (c.length > 3) c = [
2550
+ c[0],
2551
+ c[1],
2552
+ c[2]
2553
+ ];
2554
+ styles.push(new (0, $8zHUo$olstyle.Style)({
2555
+ fill: new (0, $8zHUo$olstyle.Fill)({
2556
+ color: c.concat([
2557
+ 0.2
2558
+ ])
2559
+ })
2560
+ }));
2561
+ for(let i = 1; i < steps; i++)styles.push(new (0, $8zHUo$olstyle.Style)({
2562
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2563
+ color: c.concat([
2564
+ 1 / (steps - i)
2565
+ ]),
2566
+ width: (steps - i) * 2 - 1
2567
+ })
2568
+ }));
2569
+ return styles;
2570
+ }
2571
+ }
2572
+ $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.DefaultSymbolNum = -9999;
2573
+ $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.SelectionColor = 'rgb(83, 234, 253)';
2574
+ $6e4a0fdd3e43ca7d$export$a1c933612b1f668c.FlashColor = 'rgb(83, 234, 253)';
2575
+ function $6e4a0fdd3e43ca7d$var$createText(li) {
2576
+ const color = (0, $8zHUo$olcolor.fromString)(li.textColor);
2577
+ const textStyle = new (0, $8zHUo$olstyle.Text)({
2578
+ font: `${li.textSize}px Roboto,sans-serif`,
2579
+ overflow: !!li.overflow,
2580
+ offsetY: li.offsetY | 0,
2581
+ offsetX: li.offsetX | 0,
2582
+ fill: new (0, $8zHUo$olstyle.Fill)({
2583
+ color: color
2584
+ }),
2585
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2586
+ color: '#fff',
2587
+ width: 4
2588
+ })
2589
+ });
2590
+ return textStyle;
2591
+ }
2592
+ function $6e4a0fdd3e43ca7d$var$createSimplePointStyle(def) {
2593
+ const stroke = def.stroke ? new (0, $8zHUo$olstyle.Stroke)({
2594
+ color: def.stroke.color,
2595
+ width: def.stroke.size
2596
+ }) : null;
2597
+ const s = new (0, $8zHUo$olstyle.Style)({
2598
+ stroke: stroke
2599
+ });
2600
+ if (def.pointProps) {
2601
+ const fill = new (0, $8zHUo$olstyle.Fill)({
2602
+ color: def.color
2603
+ });
2604
+ switch(def.pointProps.shape){
2605
+ case 'circle':
2606
+ s.setImage(new (0, $8zHUo$olstyle.Circle)({
2607
+ radius: def.size,
2608
+ fill: fill,
2609
+ stroke: stroke
2610
+ }));
2611
+ break;
2612
+ case 'triangle':
2613
+ s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2614
+ points: 3,
2615
+ radius: def.size,
2616
+ fill: fill,
2617
+ stroke: stroke
2618
+ }));
2619
+ break;
2620
+ case 'square':
2621
+ s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2622
+ points: 4,
2623
+ radius: def.size,
2624
+ fill: fill,
2625
+ angle: Math.PI / 4,
2626
+ stroke: stroke
2627
+ }));
2628
+ break;
2629
+ case 'pentagon':
2630
+ s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2631
+ points: 5,
2632
+ radius: def.size,
2633
+ fill: fill,
2634
+ stroke: stroke
2635
+ }));
2636
+ break;
2637
+ case 'star':
2638
+ s.setImage(new (0, $8zHUo$olstyle.RegularShape)({
2639
+ points: 5,
2640
+ radius: def.size,
2641
+ radius2: def.size / 2,
2642
+ fill: fill,
2643
+ stroke: stroke
2644
+ }));
2645
+ break;
2646
+ case 'image':
2647
+ s.setImage(new (0, $8zHUo$olstyle.Icon)({
2648
+ anchor: def.pointProps.anchor,
2649
+ anchorXUnits: 'fraction',
2650
+ anchorYUnits: 'fraction',
2651
+ src: def.pointProps.src,
2652
+ height: def.pointProps.height,
2653
+ width: def.pointProps.width,
2654
+ offset: def.pointProps.offset
2655
+ }));
2656
+ break;
2657
+ default:
2658
+ break;
2659
+ }
2668
2660
  }
2669
- showContextMenuAt(pageX, pageY, items, itemAction, isGlass) {
2670
- return $e2e9872d2858bcde$var$__awaiter(this, void 0, void 0, function*() {
2671
- const te = this.map.getTargetElement();
2672
- const rect = te.getBoundingClientRect();
2673
- const loc = {
2674
- x: pageX - rect.x,
2675
- y: pageY - rect.y
2676
- };
2677
- const cm = new (0, $69345a20bc0f2569$export$a67c77aa289f97c1)(loc, items, itemAction, isGlass);
2678
- this.commandDisplayer.setCmx(cm);
2679
- te.appendChild(cm);
2680
- });
2661
+ if (def.labelDef) s.setText($6e4a0fdd3e43ca7d$var$createText(def.labelDef));
2662
+ return s;
2663
+ }
2664
+ function $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(def) {
2665
+ return new (0, $8zHUo$olstyle.Style)({
2666
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2667
+ width: def.size,
2668
+ color: def.color
2669
+ })
2670
+ });
2671
+ }
2672
+ function $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(def) {
2673
+ let strokeColor = (0, $8zHUo$olcolor.fromString)(def.color);
2674
+ let fillColor = (0, $8zHUo$olcolor.fromString)(def.color);
2675
+ let strokeSize = 3;
2676
+ if (def.stroke) {
2677
+ strokeColor = (0, $8zHUo$olcolor.fromString)(def.stroke.color);
2678
+ strokeSize = def.stroke.size;
2679
+ } else fillColor = $6e4a0fdd3e43ca7d$var$setAlpha(fillColor, 0.1);
2680
+ const s = new (0, $8zHUo$olstyle.Style)({
2681
+ stroke: new (0, $8zHUo$olstyle.Stroke)({
2682
+ width: strokeSize,
2683
+ color: strokeColor
2684
+ }),
2685
+ fill: new (0, $8zHUo$olstyle.Fill)({
2686
+ color: fillColor
2687
+ })
2688
+ });
2689
+ if (def.labelDef) s.setText($6e4a0fdd3e43ca7d$var$createText(def.labelDef));
2690
+ return s;
2691
+ }
2692
+ function $6e4a0fdd3e43ca7d$var$createUVPointStyle(def) {
2693
+ const map = new Map();
2694
+ for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimplePointStyle(uv.symbol));
2695
+ return map;
2696
+ }
2697
+ function $6e4a0fdd3e43ca7d$var$createUVLineStyle(def) {
2698
+ const map = new Map();
2699
+ for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimpleLineStyle(uv.symbol));
2700
+ return map;
2701
+ }
2702
+ function $6e4a0fdd3e43ca7d$var$createUVPolygonStyle(def) {
2703
+ const map = new Map();
2704
+ for (const uv of def.values)map.set(uv.st, $6e4a0fdd3e43ca7d$var$createSimplePolygonStyle(uv.symbol));
2705
+ return map;
2706
+ }
2707
+
2708
+
2709
+ var $9e9fe0098715b2dd$exports = {};
2710
+
2711
+ $parcel$export($9e9fe0098715b2dd$exports, "getLayerProps", () => $9e9fe0098715b2dd$export$901d0a0c97b4d88a);
2712
+ function $9e9fe0098715b2dd$export$901d0a0c97b4d88a(layer) {
2713
+ return layer.getProperties();
2714
+ }
2715
+
2716
+
2717
+
2718
+
2719
+ var $69345a20bc0f2569$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2720
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2721
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2722
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2723
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
2724
+ };
2725
+ var $69345a20bc0f2569$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2726
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2727
+ };
2728
+ let $69345a20bc0f2569$export$a67c77aa289f97c1 = class FeatureContextMenuComponent extends (0, $8zHUo$yesilyazilimwebspa.BaseElement) {
2729
+ constructor(_loc, items, action, isGlass){
2730
+ super();
2731
+ this._loc = _loc;
2732
+ this.action = action;
2733
+ this.isGlass = isGlass;
2734
+ this._closeHandler = 0;
2735
+ const arr = this._groupItems(items);
2736
+ for(let i = 0; i < arr.length; i++){
2737
+ const kvp = arr[i];
2738
+ this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).span(kvp.title, 'GroupTitle'));
2739
+ let count = 0;
2740
+ const limit = 10;
2741
+ for (const item of kvp.items)if (++count > limit) {
2742
+ item.title = "++ Di\u011Fer " + (kvp.items.length - limit).toString();
2743
+ this.appendChild(new $69345a20bc0f2569$var$ContextMenuItemComponent(this, item, true));
2744
+ break;
2745
+ } else this.appendChild(new $69345a20bc0f2569$var$ContextMenuItemComponent(this, item));
2746
+ if (i < arr.length - 1) this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).div('Seperator'));
2747
+ }
2748
+ if (isGlass) this.classList.add("glass");
2681
2749
  }
2682
- goto(coordinate) {
2683
- this._view.fit(new (0, $8zHUo$olgeom.Point)(coordinate), {
2684
- maxZoom: 20,
2685
- duration: 300
2750
+ setActive(key, value) {}
2751
+ setDisabled(key, value) {}
2752
+ onConnected() {
2753
+ this.style.top = this._loc.y + 'px';
2754
+ this.style.left = this._loc.x + 'px';
2755
+ this.addEventListener('mouseleave', ()=>{
2756
+ this._closeHandler = setTimeout(()=>{
2757
+ this._closeHandler = 0;
2758
+ this.remove();
2759
+ }, 200);
2760
+ }, {
2761
+ once: true
2686
2762
  });
2687
- }
2688
- gotoFly(location) {
2689
- const view = this._view;
2690
- const duration = 2000;
2691
- const zoom = view.getZoom();
2692
- let parts = 2;
2693
- let called = false;
2694
- return new Promise((resolve)=>{
2695
- function callback(complete) {
2696
- --parts;
2697
- if (called) return;
2698
- if (parts === 0 || !complete) {
2699
- called = true;
2700
- resolve(complete);
2701
- }
2763
+ this.addEventListener('mouseenter', ()=>{
2764
+ if (this._closeHandler) {
2765
+ clearTimeout(this._closeHandler);
2766
+ this._closeHandler = 0;
2702
2767
  }
2703
- view.animate({
2704
- center: location,
2705
- duration: duration
2706
- }, callback);
2707
- view.animate({
2708
- zoom: zoom - 1,
2709
- duration: duration / 2
2710
- }, {
2711
- zoom: zoom,
2712
- duration: duration / 2
2713
- }, callback);
2714
2768
  });
2715
- }
2716
- flash(ed) {
2717
- return new Promise((resolve, reject)=>{
2718
- const src = this._flashLayer.getSource();
2719
- if (!ed.keepExist) src.clear();
2720
- if (ed.geom) {
2721
- const feat = new (0, $8zHUo$ol.Feature)(ed.geom);
2722
- src.addFeature(feat);
2723
- if (!ed.skipZoom) this._view.fit(ed.geom.getExtent(), {
2724
- maxZoom: 25,
2725
- duration: 200
2726
- });
2727
- let cnt = 0;
2728
- const timerKey = setInterval(()=>{
2729
- if (cnt > 1) {
2730
- clearInterval(timerKey);
2731
- src.removeFeature(feat);
2732
- return;
2733
- }
2734
- if (cnt % 2 == 0) src.removeFeature(feat);
2735
- else src.addFeature(feat);
2736
- cnt++;
2737
- }, 200);
2738
- }
2769
+ document.body.addEventListener('mouseenter', ()=>{
2770
+ this._closeHandler = setTimeout(()=>{
2771
+ this._closeHandler = 0;
2772
+ this.remove();
2773
+ }, 200);
2774
+ }, {
2775
+ once: true
2739
2776
  });
2740
2777
  }
2741
- flashGeom(geom) {
2742
- this.flash({
2743
- geom: geom,
2744
- skipZoom: true
2745
- });
2778
+ onItemMouseEnter(child) {
2779
+ this.action('enter', child.item);
2746
2780
  }
2747
- flashGeojson(gjs) {
2748
- if (!gjs) return;
2749
- const geom = (0, $10571313f00c012e$export$4691a8a9ff232a6b).fromGeojson(gjs);
2750
- if (!geom) return;
2751
- this.flash({
2752
- geom: geom
2753
- });
2781
+ onItemMouseLeave(child) {
2782
+ this.action('leave', child.item);
2754
2783
  }
2755
- _initPopup() {
2756
- this._popup = new (0, $8zHUo$ol.Overlay)({
2757
- element: this._popupDiv,
2758
- autoPan: {
2759
- animation: {
2760
- duration: 250
2761
- }
2784
+ onItemMouseClick(child) {
2785
+ this.action('leave', child.item);
2786
+ this.action('click', child.item);
2787
+ this.remove();
2788
+ }
2789
+ _groupItems(items) {
2790
+ const map = new Map();
2791
+ for (const item of items){
2792
+ const gkey = item.group || '';
2793
+ let garr = map.get(gkey);
2794
+ if (!garr) {
2795
+ garr = [];
2796
+ map.set(gkey, garr);
2762
2797
  }
2798
+ garr.push(item);
2799
+ }
2800
+ const arr = [];
2801
+ map.forEach((v, k)=>{
2802
+ arr.push({
2803
+ title: k,
2804
+ items: v
2805
+ });
2763
2806
  });
2764
- this._map.addOverlay(this._popup);
2765
- const closer = this._popupDiv.querySelector('.ol-popup-closer');
2766
- closer === null || closer === void 0 || closer.addEventListener('click', ()=>{
2767
- this._popup.setPosition(undefined);
2768
- closer.blur();
2769
- return false;
2770
- });
2807
+ return arr;
2771
2808
  }
2772
- _getFlashSymbol() {
2773
- const fs = (0, $6e4a0fdd3e43ca7d$export$a1c933612b1f668c).createFlashedStyles();
2774
- const arr = [];
2775
- const cnt = fs.get('Point').length;
2776
- const ps = fs.get('Point');
2777
- const ls = fs.get('LineString');
2778
- const gs = fs.get('Polygon');
2779
- for(let i = 0; i < cnt; i++){
2780
- const ts = new (0, $8zHUo$olstyle.Style)({
2781
- stroke: ls[i].getStroke(),
2782
- fill: gs[i].getFill(),
2783
- image: ps[i].getImage()
2809
+ };
2810
+ $69345a20bc0f2569$export$a67c77aa289f97c1 = $69345a20bc0f2569$var$__decorate([
2811
+ (0, $8zHUo$yesilyazilimwebspa.Component)({
2812
+ elementName: 'map-feat-cm'
2813
+ }),
2814
+ $69345a20bc0f2569$var$__metadata("design:paramtypes", [
2815
+ Object,
2816
+ Array,
2817
+ Object,
2818
+ Boolean
2819
+ ])
2820
+ ], $69345a20bc0f2569$export$a67c77aa289f97c1);
2821
+ let $69345a20bc0f2569$var$ContextMenuItemComponent = class ContextMenuItemComponent extends (0, $8zHUo$yesilyazilimwebspa.BaseElement) {
2822
+ constructor(menu, item, disabled = false){
2823
+ super();
2824
+ this.menu = menu;
2825
+ this.item = item;
2826
+ if (disabled) {
2827
+ this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).label(item.title, "cm-title"));
2828
+ this.disabled = true;
2829
+ } else {
2830
+ this.addEventListener('mouseenter', ()=>{
2831
+ this.menu.onItemMouseEnter(this);
2784
2832
  });
2785
- arr.push(ts);
2833
+ this.addEventListener('mouseleave', ()=>{
2834
+ this.menu.onItemMouseLeave(this);
2835
+ });
2836
+ this.addEventListener('click', ()=>{
2837
+ this.menu.onItemMouseClick(this);
2838
+ });
2839
+ if (item.iconClass) {
2840
+ const iconElm = (0, $8zHUo$yesilyazilimwebspa.ELF).icon("cm-icon " + item.iconClass);
2841
+ this.appendChild(iconElm);
2842
+ }
2843
+ this.appendChild((0, $8zHUo$yesilyazilimwebspa.ELF).label(item.title, "cm-title"));
2786
2844
  }
2787
- return arr;
2788
- }
2789
- _beginAnimate() {
2790
- if (this._animationHandler > 0 || this._animations.size == 0) return;
2791
- this._animationHandler = setInterval(this._animator, 30);
2792
- }
2793
- _endAnimate() {
2794
- if (this._animationHandler > 0) clearInterval(this._animationHandler);
2795
- this._animationHandler = 0;
2796
2845
  }
2797
2846
  };
2798
- $e2e9872d2858bcde$var$__decorate([
2799
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2800
- $e2e9872d2858bcde$var$__metadata("design:type", typeof ($e2e9872d2858bcde$var$_a = typeof (0, $8zHUo$yesilyazilimwebspa.EventService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.EventService)) === "function" ? $e2e9872d2858bcde$var$_a : Object)
2801
- ], $e2e9872d2858bcde$export$c521bb0b406df9a3.prototype, "eventService", void 0);
2802
- $e2e9872d2858bcde$var$__decorate([
2803
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2804
- $e2e9872d2858bcde$var$__metadata("design:type", typeof ($e2e9872d2858bcde$var$_b = typeof (0, $8zHUo$yesilyazilimwebspa.CommandService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.CommandService)) === "function" ? $e2e9872d2858bcde$var$_b : Object)
2805
- ], $e2e9872d2858bcde$export$c521bb0b406df9a3.prototype, "commandService", void 0);
2806
- $e2e9872d2858bcde$export$c521bb0b406df9a3 = $e2e9872d2858bcde$var$__decorate([
2807
- (0, $8zHUo$yesilyazilimwebspa.Service)()
2808
- ], $e2e9872d2858bcde$export$c521bb0b406df9a3);
2809
- class $e2e9872d2858bcde$var$CmxCommandDisplayer {
2810
- setCmx(comp) {
2811
- this._comp = comp;
2812
- }
2813
- setActive(key, value) {
2814
- var _a;
2815
- (_a = this._comp) === null || _a === void 0 || _a.setActive(key, value);
2816
- }
2817
- setDisabled(key, value) {
2818
- var _a;
2819
- (_a = this._comp) === null || _a === void 0 || _a.setDisabled(key, value);
2820
- }
2821
- isExist() {
2822
- var _a;
2823
- return ((_a = this._comp) === null || _a === void 0 ? void 0 : _a.isExist()) || false;
2824
- }
2825
- }
2826
-
2827
-
2828
- var $979d8cb30b62358d$exports = {};
2829
-
2830
- $parcel$export($979d8cb30b62358d$exports, "GeoserverChannel", () => $979d8cb30b62358d$export$3013e01cb8ddab96);
2847
+ $69345a20bc0f2569$var$ContextMenuItemComponent = $69345a20bc0f2569$var$__decorate([
2848
+ (0, $8zHUo$yesilyazilimwebspa.Component)({
2849
+ elementName: 'map-feat-cm-item'
2850
+ }),
2851
+ $69345a20bc0f2569$var$__metadata("design:paramtypes", [
2852
+ $69345a20bc0f2569$export$a67c77aa289f97c1,
2853
+ Object,
2854
+ Boolean
2855
+ ])
2856
+ ], $69345a20bc0f2569$var$ContextMenuItemComponent);
2831
2857
 
2832
2858
 
2833
2859
 
2834
- var $979d8cb30b62358d$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2860
+ var $e2e9872d2858bcde$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2835
2861
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2836
2862
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2837
2863
  else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2838
2864
  return c > 3 && r && Object.defineProperty(target, key, r), r;
2839
2865
  };
2840
- var $979d8cb30b62358d$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2866
+ var $e2e9872d2858bcde$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2841
2867
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2842
2868
  };
2843
- var $979d8cb30b62358d$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2869
+ var $e2e9872d2858bcde$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2844
2870
  function adopt(value) {
2845
2871
  return value instanceof P ? value : new P(function(resolve) {
2846
2872
  resolve(value);
@@ -2867,372 +2893,417 @@ var $979d8cb30b62358d$var$__awaiter = undefined && undefined.__awaiter || functi
2867
2893
  step((generator = generator.apply(thisArg, _arguments || [])).next());
2868
2894
  });
2869
2895
  };
2870
- var $979d8cb30b62358d$var$_a;
2871
- class $979d8cb30b62358d$export$3013e01cb8ddab96 {
2872
- constructor(_wmsProps){
2873
- this._wmsProps = _wmsProps;
2874
- this._proxyUrl = new URL('/proxy', this.storeService.appProperties.apiEndPoint).toString() + '?';
2875
- this.source = new (0, $8zHUo$olsource.ImageWMS)({
2876
- url: _wmsProps.url,
2877
- params: {
2878
- LAYERS: _wmsProps.layers,
2879
- format: _wmsProps.imagetype,
2880
- transparent: true,
2881
- serverType: 'geoserver'
2882
- },
2883
- crossOrigin: 'anonymous',
2884
- serverType: 'geoserver',
2885
- imageLoadFunction: (iw, url)=>$979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
2886
- const urlWithParams = this._getWithCustomParams('getmap', url);
2887
- const obj = yield this._getImageData(urlWithParams);
2888
- if (obj) iw.getImage().src = obj;
2889
- })
2890
- });
2891
- }
2892
- IdentifyAsync(inp) {
2893
- return $979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
2894
- const up = new URLSearchParams();
2895
- up.append('SERVICE', 'WMS');
2896
- up.append('VERSION', '1.3');
2897
- up.append('REQUEST', 'GetFeatureInfo');
2898
- up.append('INFO_FORMAT', 'application/json');
2899
- up.append('LAYERS', this._wmsProps.layers);
2900
- up.append('QUERY_LAYERS', this._wmsProps.layers);
2901
- up.append('STYLES', '');
2902
- up.append('BBOX', inp.mapExtent.join(','));
2903
- up.append('FEATURE_COUNT', '10');
2904
- up.append('HEIGHT', inp.imageDisplay.h.toFixed(0).toString());
2905
- up.append('WIDTH', inp.imageDisplay.w.toFixed(0).toString());
2906
- up.append('SRS', 'EPSG:4326');
2907
- up.append('X', Math.round(inp.screenPoint[0]).toString());
2908
- up.append('Y', Math.round(inp.screenPoint[1]).toString());
2909
- this._fillCustomParams('identify', up);
2910
- const url = this._wmsProps.url + '?' + up.toString();
2911
- if (!url) return null;
2912
- const headers = {};
2913
- let purl = url;
2914
- if (this._wmsProps.useProxy) {
2915
- headers["Authorization"] = (0, $8zHUo$yesilyazilimwebspa.TokenManager).headerValue;
2916
- purl = this._proxyUrl + encodeURIComponent(url);
2917
- }
2918
- const res = yield fetch(purl, {
2919
- headers: headers,
2920
- method: 'GET'
2896
+ var $e2e9872d2858bcde$var$_a, $e2e9872d2858bcde$var$_b;
2897
+ const $e2e9872d2858bcde$var$LO_SELECTION = 10000;
2898
+ const $e2e9872d2858bcde$var$LO_FLASH = 10020;
2899
+ let $e2e9872d2858bcde$export$c521bb0b406df9a3 = class MapManager {
2900
+ constructor(){
2901
+ this._activeDraw = null;
2902
+ this._selectionDict = new Map();
2903
+ this._animations = new Map();
2904
+ this._animationHandler = 0;
2905
+ this.commandDisplayer = new $e2e9872d2858bcde$var$CmxCommandDisplayer();
2906
+ this._onGotoExtendRequested = (ed)=>{
2907
+ return new Promise((resolve, reject)=>{
2908
+ this._view.fit(ed.extent, {
2909
+ maxZoom: 20,
2910
+ duration: 300,
2911
+ callback: (isOk)=>{
2912
+ resolve(isOk);
2913
+ }
2914
+ });
2921
2915
  });
2922
- if (res.ok) {
2923
- const json = yield res.json();
2924
- const ft = (0, $10571313f00c012e$export$4691a8a9ff232a6b).fromGeojsonFeatures(json);
2925
- return ft;
2916
+ };
2917
+ this._onFlashGeomRequested = (ed)=>{
2918
+ return this.flash(ed);
2919
+ };
2920
+ this._completed = true;
2921
+ this._animator = ()=>{
2922
+ if (this._animationHandler == 0) return;
2923
+ if (!this._completed) return;
2924
+ this._completed = false;
2925
+ const zoom = this.zoom;
2926
+ for (const animation of this._animations.values())if (zoom >= animation.minZoom && animation.layer.checked && !animation.layer.passive) {
2927
+ animation.animateFunction();
2928
+ animation.layer.layerObj.changed();
2926
2929
  }
2927
- return null;
2928
- });
2930
+ this._completed = true;
2931
+ };
2929
2932
  }
2930
- _getImageData(url) {
2931
- return $979d8cb30b62358d$var$__awaiter(this, void 0, void 0, function*() {
2932
- return new Promise((resolve, reject)=>{
2933
- const client = new XMLHttpRequest();
2934
- client.responseType = 'blob';
2935
- let purl = url;
2936
- if (this._wmsProps.useProxy) purl = this._proxyUrl + encodeURIComponent(url);
2937
- client.open('GET', purl);
2938
- if (this._wmsProps.useProxy) client.setRequestHeader("Authorization", (0, $8zHUo$yesilyazilimwebspa.TokenManager).headerValue);
2939
- client.onload = function() {
2940
- const ct = client.getResponseHeader('content-type') || '';
2941
- if (ct.toLocaleLowerCase().startsWith('image')) resolve(URL.createObjectURL(client.response));
2942
- else resolve(null);
2943
- };
2944
- client.send();
2945
- });
2933
+ init(map, view, popupDiv, layerManager) {
2934
+ if (this._map) return;
2935
+ this._layerManager = layerManager;
2936
+ this._map = map;
2937
+ this._view = view;
2938
+ this._popupDiv = popupDiv;
2939
+ this._initPopup();
2940
+ this._selectionLayer = new (0, ($parcel$interopDefault($8zHUo$ollayerVector)))({
2941
+ source: new (0, ($parcel$interopDefault($8zHUo$olsourceVector)))(),
2942
+ style: (0, $6e4a0fdd3e43ca7d$export$a1c933612b1f668c).getSelectionSymbol(),
2943
+ zIndex: $e2e9872d2858bcde$var$LO_SELECTION,
2944
+ map: this._map
2946
2945
  });
2946
+ this._flashLayer = new (0, ($parcel$interopDefault($8zHUo$ollayerVector)))({
2947
+ source: new (0, ($parcel$interopDefault($8zHUo$olsourceVector)))(),
2948
+ style: this._getFlashSymbol(),
2949
+ zIndex: $e2e9872d2858bcde$var$LO_FLASH,
2950
+ map: this._map
2951
+ });
2952
+ this.eventService.listen((0, $91d76f4d8e753f27$export$3b3923acac36255a).MapGotoExtentRequest, this._onGotoExtendRequested);
2953
+ this.eventService.listen((0, $91d76f4d8e753f27$export$3b3923acac36255a).MapFlashGeomRequest, this._onFlashGeomRequested);
2947
2954
  }
2948
- _getWithCustomParams(action, url) {
2949
- const uri = URL.parse(url);
2950
- const sp = uri.searchParams;
2951
- this._fillCustomParams(action, sp);
2952
- return uri.toString();
2955
+ get map() {
2956
+ return this._map;
2953
2957
  }
2954
- _fillCustomParams(action, sp) {
2955
- var _a, _b;
2956
- if (this.customParamsFnc) {
2957
- const cparams = this.customParamsFnc(action);
2958
- if (cparams) for (const key of Object.keys(cparams)){
2959
- let obj = (_b = (_a = cparams[key]) === null || _a === void 0 ? void 0 : _a.toString()) !== null && _b !== void 0 ? _b : "";
2960
- sp.append(key, obj);
2961
- }
2962
- }
2958
+ get view() {
2959
+ return this._view;
2963
2960
  }
2964
- }
2965
- $979d8cb30b62358d$var$__decorate([
2966
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
2967
- $979d8cb30b62358d$var$__metadata("design:type", typeof ($979d8cb30b62358d$var$_a = typeof (0, $8zHUo$yesilyazilimwebspa.StoreService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.StoreService)) === "function" ? $979d8cb30b62358d$var$_a : Object)
2968
- ], $979d8cb30b62358d$export$3013e01cb8ddab96.prototype, "storeService", void 0);
2969
-
2970
-
2971
- var $9f1e53e2f5ceab7e$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
2972
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2973
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2974
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
2975
- return c > 3 && r && Object.defineProperty(target, key, r), r;
2976
- };
2977
- var $9f1e53e2f5ceab7e$var$__metadata = undefined && undefined.__metadata || function(k, v) {
2978
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
2979
- };
2980
- var $9f1e53e2f5ceab7e$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
2981
- function adopt(value) {
2982
- return value instanceof P ? value : new P(function(resolve) {
2983
- resolve(value);
2984
- });
2961
+ get zoom() {
2962
+ return Math.trunc(this._view.getZoom());
2963
+ }
2964
+ startDraw(draw) {
2965
+ this.cancelDraw();
2966
+ this._activeDraw = draw;
2967
+ this._map.addInteraction(this._activeDraw);
2968
+ }
2969
+ cancelDraw() {
2970
+ if (this._activeDraw) {
2971
+ if (this._activeDraw.getActive()) this._activeDraw.abortDrawing();
2972
+ this._map.removeInteraction(this._activeDraw);
2973
+ }
2974
+ this._activeDraw = null;
2985
2975
  }
2986
- return new (P || (P = Promise))(function(resolve, reject) {
2987
- function fulfilled(value) {
2988
- try {
2989
- step(generator.next(value));
2990
- } catch (e) {
2991
- reject(e);
2976
+ setSelectedFeatures(dict) {
2977
+ this._selectionLayer.getSource().clear();
2978
+ for (const layer of this._selectionDict.keys())if (layer.identifyType == 'mvt' && layer.setFeaturesSelected) layer.setFeaturesSelected([]);
2979
+ this._selectionDict.clear();
2980
+ if (!(dict && dict.size > 0)) return;
2981
+ const cloneFeat = (layer, feat)=>{
2982
+ const copy = new (0, $8zHUo$ol.Feature)(feat.getGeometry());
2983
+ return copy;
2984
+ };
2985
+ const selLayerFeats = [];
2986
+ for (const layer of dict.keys()){
2987
+ const features = dict.get(layer);
2988
+ if (layer.identifyType == 'mvt' && layer.setFeaturesSelected) layer.setFeaturesSelected(features);
2989
+ else {
2990
+ const feats = features.map((_)=>cloneFeat(layer, _));
2991
+ selLayerFeats.push(...feats);
2992
2992
  }
2993
+ this._selectionDict.set(layer, features);
2993
2994
  }
2994
- function rejected(value) {
2995
- try {
2996
- step(generator["throw"](value));
2997
- } catch (e) {
2998
- reject(e);
2999
- }
2995
+ this._selectionLayer.getSource().addFeatures(selLayerFeats);
2996
+ }
2997
+ showPopup(at, content) {
2998
+ if (!(at && content)) {
2999
+ this._popup.setPosition(undefined);
3000
+ return;
3000
3001
  }
3001
- function step(result) {
3002
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
3002
+ const contentDiv = this._popupDiv.querySelector('.popup-content');
3003
+ if (contentDiv) {
3004
+ contentDiv.innerHTML = '';
3005
+ contentDiv.appendChild(content);
3003
3006
  }
3004
- step((generator = generator.apply(thisArg, _arguments || [])).next());
3005
- });
3006
- };
3007
- var $9f1e53e2f5ceab7e$var$_a, $9f1e53e2f5ceab7e$var$_b, $9f1e53e2f5ceab7e$var$_c, $9f1e53e2f5ceab7e$var$_d;
3008
- class $9f1e53e2f5ceab7e$export$4f2c359228ce6008 extends (0, $3ecb066746a16c54$export$23eba0cb71a4e506) {
3009
- constructor(ld){
3010
- super(ld);
3011
- this.identifyType = 'remote';
3012
- this._channel = new (0, $979d8cb30b62358d$export$3013e01cb8ddab96)(ld.props);
3013
- this._channel.customParamsFnc = (action)=>{
3014
- return this.getCustomParams(action);
3015
- };
3016
- this._layer = new (0, ($parcel$interopDefault($8zHUo$ollayerImage)))({
3017
- source: this._channel.source,
3018
- visible: ld.visible,
3019
- minZoom: ld.minZoom,
3020
- maxZoom: ld.maxZoom
3021
- });
3022
- this._layer.setProperties({
3023
- mapLayer: this,
3024
- name: this._definition.key,
3025
- canEdit: false,
3026
- canFlash: true,
3027
- canSelect: true
3028
- });
3007
+ this._popup.setPosition(at);
3029
3008
  }
3030
- getIdentifyPriority(feature) {
3031
- return 0;
3009
+ startAnimate(key, animation) {
3010
+ this._animations.set(key, animation);
3011
+ this._beginAnimate();
3032
3012
  }
3033
- getLegendInfos() {
3034
- return [];
3013
+ endAnimate(key) {
3014
+ if (this._animations.delete(key) && this._animations.size == 0) this._endAnimate();
3035
3015
  }
3036
- }
3037
- $9f1e53e2f5ceab7e$var$__decorate([
3038
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3039
- $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_a = typeof (0, $e2e9872d2858bcde$export$c521bb0b406df9a3) !== "undefined" && (0, $e2e9872d2858bcde$export$c521bb0b406df9a3)) === "function" ? $9f1e53e2f5ceab7e$var$_a : Object)
3040
- ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "mapManager", void 0);
3041
- $9f1e53e2f5ceab7e$var$__decorate([
3042
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3043
- $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_b = typeof (0, $8zHUo$yesilyazilimwebspa.StoreService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.StoreService)) === "function" ? $9f1e53e2f5ceab7e$var$_b : Object)
3044
- ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "storeService", void 0);
3045
- $9f1e53e2f5ceab7e$var$__decorate([
3046
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3047
- $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_c = typeof (0, $8zHUo$yesilyazilimwebspa.EventService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.EventService)) === "function" ? $9f1e53e2f5ceab7e$var$_c : Object)
3048
- ], $9f1e53e2f5ceab7e$export$4f2c359228ce6008.prototype, "eventService", void 0);
3049
- class $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8 extends $9f1e53e2f5ceab7e$export$4f2c359228ce6008 {
3050
- getCustomParams(action) {
3051
- const map = this._layer.getMapInternal();
3052
- const view = map.getView();
3053
- let extArr = view.calculateExtent(map.getSize());
3054
- let defaultParams = `scale:${this.calculateEpsForScreenDistance(map)};xmin:${extArr[0]};ymin:${extArr[1]};xmax:${extArr[2]};ymax:${extArr[3]};`;
3055
- const user = this.authService.currentUser;
3056
- if (user) defaultParams = defaultParams + `uid:${user.id};`;
3057
- if (this._currentTime > 0) defaultParams = defaultParams + `epctime:${this._currentTime};`;
3058
- const obj = {
3059
- "viewParams": defaultParams
3060
- };
3061
- return obj;
3016
+ hasAnimate(key) {
3017
+ return this._animations.has(key);
3062
3018
  }
3063
- queryIdentifyAsync(data) {
3064
- return $9f1e53e2f5ceab7e$var$__awaiter(this, void 0, void 0, function*() {
3065
- const res = yield this._channel.IdentifyAsync(data);
3066
- if (res && res.length > 0) {
3067
- const items = res.map((f)=>({
3068
- layerTitle: this.definition.title,
3069
- layerKey: this.definition.key,
3070
- feature: f
3071
- }));
3072
- return {
3073
- success: true,
3074
- data: items
3075
- };
3076
- } else return {
3077
- success: true,
3078
- data: []
3079
- };
3019
+ stopAnimations() {
3020
+ this._endAnimate();
3021
+ this.eventService.raise((0, $91d76f4d8e753f27$export$3b3923acac36255a).DisableAnimations, null);
3022
+ return new Promise((resolve)=>{
3023
+ setTimeout(()=>{
3024
+ requestAnimationFrame(()=>{
3025
+ resolve();
3026
+ });
3027
+ }, 50);
3080
3028
  });
3081
3029
  }
3082
- generatePopupItemsAsync(feature) {
3083
- return $9f1e53e2f5ceab7e$var$__awaiter(this, void 0, void 0, function*() {
3084
- return [];
3085
- });
3030
+ resumeAnimation() {
3031
+ this._beginAnimate();
3086
3032
  }
3087
- calculateEpsForScreenDistance(map) {
3088
- const view = map.getView();
3089
- const resolution = view.getResolution();
3090
- const center = view.getCenter();
3091
- const lat = center[1];
3092
- const zoom = view.getZoom();
3093
- let pixelMeters = 15;
3094
- if (zoom <= 6) pixelMeters = 7.5;
3095
- else if (zoom <= 7) pixelMeters = 10;
3096
- const metersDistance = pixelMeters * resolution;
3097
- const metersPerDegree = 111320 * Math.cos(lat * Math.PI / 180);
3098
- const eps = metersDistance / metersPerDegree;
3099
- return this.exponentToDecimals(eps);
3033
+ changeCursor(cursor = '') {
3034
+ this.map.getTargetElement().style.cursor = cursor;
3035
+ }
3036
+ getCurrentIdentifyDataFor(pixel) {
3037
+ const vse = this._view.getViewStateAndExtent();
3038
+ const rect = this._map.getTargetElement().getBoundingClientRect();
3039
+ const inp = {
3040
+ coords: this._map.getCoordinateFromPixel(pixel),
3041
+ imageDisplay: {
3042
+ w: rect.width,
3043
+ h: rect.height,
3044
+ dpi: 96
3045
+ },
3046
+ mapExtent: vse.extent,
3047
+ screenPoint: pixel,
3048
+ tolerance: 3,
3049
+ resolution: this._view.getResolution()
3050
+ };
3051
+ return inp;
3052
+ }
3053
+ getOneFeatureAt(pixel, opt) {
3054
+ return $e2e9872d2858bcde$var$__awaiter(this, void 0, void 0, function*() {
3055
+ let contents = [];
3056
+ let maxPri = 0;
3057
+ const forEachFeatureCallback = (feature, layer)=>{
3058
+ var _a;
3059
+ if (!layer) return;
3060
+ if (opt.featureFilter) {
3061
+ if (!opt.featureFilter(feature)) return;
3062
+ }
3063
+ const mapLayer = (_a = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(layer)) === null || _a === void 0 ? void 0 : _a.mapLayer;
3064
+ if (!!!(mapLayer === null || mapLayer === void 0 ? void 0 : mapLayer.getFeatureTitle)) return;
3065
+ const title = mapLayer.getFeatureTitle(feature);
3066
+ if (title && contents.findIndex((old)=>old.layer === layer && old.feature.getId() === feature.getId()) < 0) {
3067
+ const pri = mapLayer.getIdentifyPriority(feature);
3068
+ if (pri >= maxPri) {
3069
+ if (pri > maxPri) {
3070
+ contents = [];
3071
+ maxPri = pri;
3072
+ }
3073
+ contents.push({
3074
+ feature: feature,
3075
+ layer: layer,
3076
+ mapLayer: mapLayer,
3077
+ title: title,
3078
+ iconClass: 'bi bi-caret-right-fill'
3079
+ });
3080
+ }
3081
+ }
3082
+ };
3083
+ this.map.forEachFeatureAtPixel(pixel, forEachFeatureCallback, opt);
3084
+ let imageLayers = this._layerManager.layerList.filter((ml)=>ml.identifyType == 'remote');
3085
+ if (opt.layerFilter) imageLayers = imageLayers.filter((ml)=>opt.layerFilter(ml.layerObj));
3086
+ const arr = [];
3087
+ for (const iml of imageLayers){
3088
+ const imgLyr = iml;
3089
+ const inp = this.getCurrentIdentifyDataFor(pixel);
3090
+ const prms = new Promise((resolve)=>{
3091
+ imgLyr.queryIdentifyAsync(inp).then((r)=>{
3092
+ resolve({
3093
+ lyr: imgLyr,
3094
+ result: r
3095
+ });
3096
+ });
3097
+ });
3098
+ arr.push(prms);
3099
+ }
3100
+ const prmsResults = yield Promise.all(arr);
3101
+ for (const prmRes of prmsResults){
3102
+ const res = prmRes.result;
3103
+ if (!res.success) continue;
3104
+ for (const item of res.data){
3105
+ const pri = prmRes.lyr.getIdentifyPriority(item.feature);
3106
+ if (pri >= maxPri) {
3107
+ if (pri > maxPri) {
3108
+ contents = [];
3109
+ maxPri = pri;
3110
+ }
3111
+ contents.push({
3112
+ feature: item.feature,
3113
+ layer: prmRes.lyr.layerObj,
3114
+ mapLayer: prmRes.lyr,
3115
+ title: item.layerTitle,
3116
+ iconClass: 'bi bi-caret-right-fill'
3117
+ });
3118
+ }
3119
+ }
3120
+ }
3121
+ if (contents && contents.length > 0) {
3122
+ if (contents.length === 1) return Promise.resolve(contents[0]);
3123
+ else return new Promise((resolve)=>{
3124
+ var self = this;
3125
+ const cmdAction = function(action, item) {
3126
+ var _a, _b;
3127
+ if (action == 'enter') {
3128
+ const maplayer = (_a = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(item.layer)) === null || _a === void 0 ? void 0 : _a.mapLayer;
3129
+ if (maplayer.identifyType == 'feature') maplayer.flashFeatures(item.feature);
3130
+ else if (maplayer.identifyType == 'mvt') maplayer.flashFeatures(item.feature);
3131
+ else if (maplayer.identifyType == 'remote') {
3132
+ const ft = item.feature;
3133
+ self.flashGeom(ft.getGeometry());
3134
+ }
3135
+ } else if (action == 'leave') {
3136
+ const maplayer = (_b = (0, $9e9fe0098715b2dd$export$901d0a0c97b4d88a)(item.layer)) === null || _b === void 0 ? void 0 : _b.mapLayer;
3137
+ if (maplayer.identifyType == 'feature') maplayer.flashFeatures(null);
3138
+ else if (maplayer.identifyType == 'mvt') maplayer.flashFeatures(null);
3139
+ else if (maplayer.identifyType == 'remote') self.flashGeom(null);
3140
+ } else if (action == 'click') resolve(item);
3141
+ };
3142
+ this.showContextMenuAt(opt.menux, opt.menuy, contents, cmdAction, true);
3143
+ });
3144
+ }
3145
+ return Promise.resolve(null);
3146
+ });
3100
3147
  }
3101
- exponentToDecimals(num) {
3102
- if (num < 0.000001) {
3103
- let numChunks = [];
3104
- numChunks = num.toString().split('e');
3105
- let numOfZeroes = Math.abs(numChunks[1]) - 1;
3106
- let decimalNumber = '';
3107
- let zeroes = '';
3108
- let int = numChunks[0];
3109
- for(let i = 0; i < int.length; i++)int = int.replace('.', '');
3110
- for(let i = 0; i < numOfZeroes; i++)zeroes += '0';
3111
- return '0.' + zeroes + int;
3112
- } else return num;
3148
+ showContextMenuAt(pageX, pageY, items, itemAction, isGlass) {
3149
+ return $e2e9872d2858bcde$var$__awaiter(this, void 0, void 0, function*() {
3150
+ const te = this.map.getTargetElement();
3151
+ const rect = te.getBoundingClientRect();
3152
+ const loc = {
3153
+ x: pageX - rect.x,
3154
+ y: pageY - rect.y
3155
+ };
3156
+ const cm = new (0, $69345a20bc0f2569$export$a67c77aa289f97c1)(loc, items, itemAction, isGlass);
3157
+ this.commandDisplayer.setCmx(cm);
3158
+ te.appendChild(cm);
3159
+ });
3113
3160
  }
3114
- }
3115
- $9f1e53e2f5ceab7e$var$__decorate([
3116
- (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3117
- $9f1e53e2f5ceab7e$var$__metadata("design:type", typeof ($9f1e53e2f5ceab7e$var$_d = typeof (0, $8zHUo$yesilyazilimwebspa.AuthService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.AuthService)) === "function" ? $9f1e53e2f5ceab7e$var$_d : Object)
3118
- ], $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8.prototype, "authService", void 0);
3119
-
3120
-
3121
- var $53e9cc699e7a4a99$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
3122
- function adopt(value) {
3123
- return value instanceof P ? value : new P(function(resolve) {
3124
- resolve(value);
3161
+ goto(coordinate) {
3162
+ this._view.fit(new (0, $8zHUo$olgeom.Point)(coordinate), {
3163
+ maxZoom: 20,
3164
+ duration: 300
3125
3165
  });
3126
3166
  }
3127
- return new (P || (P = Promise))(function(resolve, reject) {
3128
- function fulfilled(value) {
3129
- try {
3130
- step(generator.next(value));
3131
- } catch (e) {
3132
- reject(e);
3167
+ gotoFly(location) {
3168
+ const view = this._view;
3169
+ const duration = 2000;
3170
+ const zoom = view.getZoom();
3171
+ let parts = 2;
3172
+ let called = false;
3173
+ return new Promise((resolve)=>{
3174
+ function callback(complete) {
3175
+ --parts;
3176
+ if (called) return;
3177
+ if (parts === 0 || !complete) {
3178
+ called = true;
3179
+ resolve(complete);
3180
+ }
3133
3181
  }
3134
- }
3135
- function rejected(value) {
3136
- try {
3137
- step(generator["throw"](value));
3138
- } catch (e) {
3139
- reject(e);
3182
+ view.animate({
3183
+ center: location,
3184
+ duration: duration
3185
+ }, callback);
3186
+ view.animate({
3187
+ zoom: zoom - 1,
3188
+ duration: duration / 2
3189
+ }, {
3190
+ zoom: zoom,
3191
+ duration: duration / 2
3192
+ }, callback);
3193
+ });
3194
+ }
3195
+ flash(ed) {
3196
+ return new Promise((resolve, reject)=>{
3197
+ const src = this._flashLayer.getSource();
3198
+ if (!ed.keepExist) src.clear();
3199
+ if (ed.geom) {
3200
+ const feat = new (0, $8zHUo$ol.Feature)(ed.geom);
3201
+ src.addFeature(feat);
3202
+ if (!ed.skipZoom) this._view.fit(ed.geom.getExtent(), {
3203
+ maxZoom: 25,
3204
+ duration: 200
3205
+ });
3206
+ let cnt = 0;
3207
+ const timerKey = setInterval(()=>{
3208
+ if (cnt > 1) {
3209
+ clearInterval(timerKey);
3210
+ src.removeFeature(feat);
3211
+ return;
3212
+ }
3213
+ if (cnt % 2 == 0) src.removeFeature(feat);
3214
+ else src.addFeature(feat);
3215
+ cnt++;
3216
+ }, 200);
3140
3217
  }
3141
- }
3142
- function step(result) {
3143
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
3144
- }
3145
- step((generator = generator.apply(thisArg, _arguments || [])).next());
3146
- });
3147
- };
3148
- class $53e9cc699e7a4a99$export$e8f1b5fbf8989533 {
3149
- constructor(){
3150
- this.type = (0, $91d76f4d8e753f27$export$3c6428acb8ce7fb9).WMS;
3218
+ });
3151
3219
  }
3152
- createAsync(ld) {
3153
- return $53e9cc699e7a4a99$var$__awaiter(this, void 0, void 0, function*() {
3154
- const opres = {
3155
- success: true,
3156
- data: new (0, $9f1e53e2f5ceab7e$export$8f36746e9bfe5db8)(ld)
3157
- };
3158
- return Promise.resolve(opres);
3220
+ flashGeom(geom) {
3221
+ this.flash({
3222
+ geom: geom,
3223
+ skipZoom: true
3159
3224
  });
3160
3225
  }
3161
- }
3162
-
3163
-
3164
- var $4542e2c018b508ca$var$__awaiter = undefined && undefined.__awaiter || function(thisArg, _arguments, P, generator) {
3165
- function adopt(value) {
3166
- return value instanceof P ? value : new P(function(resolve) {
3167
- resolve(value);
3226
+ flashGeojson(gjs) {
3227
+ if (!gjs) return;
3228
+ const geom = (0, $10571313f00c012e$export$4691a8a9ff232a6b).fromGeojson(gjs);
3229
+ if (!geom) return;
3230
+ this.flash({
3231
+ geom: geom
3168
3232
  });
3169
3233
  }
3170
- return new (P || (P = Promise))(function(resolve, reject) {
3171
- function fulfilled(value) {
3172
- try {
3173
- step(generator.next(value));
3174
- } catch (e) {
3175
- reject(e);
3176
- }
3177
- }
3178
- function rejected(value) {
3179
- try {
3180
- step(generator["throw"](value));
3181
- } catch (e) {
3182
- reject(e);
3234
+ _initPopup() {
3235
+ this._popup = new (0, $8zHUo$ol.Overlay)({
3236
+ element: this._popupDiv,
3237
+ autoPan: {
3238
+ animation: {
3239
+ duration: 250
3240
+ }
3183
3241
  }
3242
+ });
3243
+ this._map.addOverlay(this._popup);
3244
+ const closer = this._popupDiv.querySelector('.ol-popup-closer');
3245
+ closer === null || closer === void 0 || closer.addEventListener('click', ()=>{
3246
+ this._popup.setPosition(undefined);
3247
+ closer.blur();
3248
+ return false;
3249
+ });
3250
+ }
3251
+ _getFlashSymbol() {
3252
+ const fs = (0, $6e4a0fdd3e43ca7d$export$a1c933612b1f668c).createFlashedStyles();
3253
+ const arr = [];
3254
+ const cnt = fs.get('Point').length;
3255
+ const ps = fs.get('Point');
3256
+ const ls = fs.get('LineString');
3257
+ const gs = fs.get('Polygon');
3258
+ for(let i = 0; i < cnt; i++){
3259
+ const ts = new (0, $8zHUo$olstyle.Style)({
3260
+ stroke: ls[i].getStroke(),
3261
+ fill: gs[i].getFill(),
3262
+ image: ps[i].getImage()
3263
+ });
3264
+ arr.push(ts);
3184
3265
  }
3185
- function step(result) {
3186
- result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
3187
- }
3188
- step((generator = generator.apply(thisArg, _arguments || [])).next());
3189
- });
3266
+ return arr;
3267
+ }
3268
+ _beginAnimate() {
3269
+ if (this._animationHandler > 0 || this._animations.size == 0) return;
3270
+ this._animationHandler = setInterval(this._animator, 30);
3271
+ }
3272
+ _endAnimate() {
3273
+ if (this._animationHandler > 0) clearInterval(this._animationHandler);
3274
+ this._animationHandler = 0;
3275
+ }
3190
3276
  };
3191
- class $4542e2c018b508ca$export$5612f11f554f467 {
3192
- constructor(customLayerFactories){
3193
- this._map = new Map();
3194
- this._register(new (0, $ebdb133fb916235d$export$70cc7c4c8953dde9)());
3195
- this._register(new (0, $53e9cc699e7a4a99$export$e8f1b5fbf8989533)());
3196
- for (const lf of customLayerFactories)this._register(lf);
3277
+ $e2e9872d2858bcde$var$__decorate([
3278
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3279
+ $e2e9872d2858bcde$var$__metadata("design:type", typeof ($e2e9872d2858bcde$var$_a = typeof (0, $8zHUo$yesilyazilimwebspa.EventService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.EventService)) === "function" ? $e2e9872d2858bcde$var$_a : Object)
3280
+ ], $e2e9872d2858bcde$export$c521bb0b406df9a3.prototype, "eventService", void 0);
3281
+ $e2e9872d2858bcde$var$__decorate([
3282
+ (0, $8zHUo$yesilyazilimwebspa.Inject)(),
3283
+ $e2e9872d2858bcde$var$__metadata("design:type", typeof ($e2e9872d2858bcde$var$_b = typeof (0, $8zHUo$yesilyazilimwebspa.CommandService) !== "undefined" && (0, $8zHUo$yesilyazilimwebspa.CommandService)) === "function" ? $e2e9872d2858bcde$var$_b : Object)
3284
+ ], $e2e9872d2858bcde$export$c521bb0b406df9a3.prototype, "commandService", void 0);
3285
+ $e2e9872d2858bcde$export$c521bb0b406df9a3 = $e2e9872d2858bcde$var$__decorate([
3286
+ (0, $8zHUo$yesilyazilimwebspa.Service)()
3287
+ ], $e2e9872d2858bcde$export$c521bb0b406df9a3);
3288
+ class $e2e9872d2858bcde$var$CmxCommandDisplayer {
3289
+ setCmx(comp) {
3290
+ this._comp = comp;
3197
3291
  }
3198
- createAsync(ld) {
3199
- return $4542e2c018b508ca$var$__awaiter(this, void 0, void 0, function*() {
3200
- const lf = this._map.get(ld.type);
3201
- if (!lf) return Promise.resolve({
3202
- success: false,
3203
- message: 'LayerFactory type not registered > ' + ld.type
3204
- });
3205
- const res = yield lf.createAsync(ld);
3206
- if (res.success && res.data) {
3207
- if (yield res.data.prepareAsync()) return res;
3208
- return {
3209
- success: false,
3210
- message: 'Layer Prepare error > ' + ld.key
3211
- };
3212
- }
3213
- return res;
3214
- });
3292
+ setActive(key, value) {
3293
+ var _a;
3294
+ (_a = this._comp) === null || _a === void 0 || _a.setActive(key, value);
3215
3295
  }
3216
- _register(lf) {
3217
- this._map.set(lf.type, lf);
3296
+ setDisabled(key, value) {
3297
+ var _a;
3298
+ (_a = this._comp) === null || _a === void 0 || _a.setDisabled(key, value);
3299
+ }
3300
+ isExist() {
3301
+ var _a;
3302
+ return ((_a = this._comp) === null || _a === void 0 ? void 0 : _a.isExist()) || false;
3218
3303
  }
3219
3304
  }
3220
3305
 
3221
3306
 
3222
- var $a93fef52f234fd9d$exports = {};
3223
-
3224
- $parcel$export($a93fef52f234fd9d$exports, "FlashLayer", () => $a93fef52f234fd9d$export$deefba2ead809686);
3225
-
3226
-
3227
-
3228
-
3229
-
3230
-
3231
-
3232
-
3233
-
3234
-
3235
-
3236
3307
  var $a93fef52f234fd9d$var$__decorate = undefined && undefined.__decorate || function(decorators, target, key, desc) {
3237
3308
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3238
3309
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -3591,13 +3662,7 @@ let $60509b0aa95160f5$export$115c55962a382acf = class DefaultTool {
3591
3662
  const items = yield remLayer.generatePopupItemsAsync(item.feature);
3592
3663
  if (!(items && items.length > 0)) return;
3593
3664
  const content = items[0];
3594
- if (content.panelPos) this.application.openPanel({
3595
- header: content.title,
3596
- closable: true,
3597
- name: remLayer.id + '-' + item.feature.getId(),
3598
- content: content.element,
3599
- draggable: true
3600
- }, content.panelPos);
3665
+ if ((0, $8zHUo$yesilyazilimwebspa.System).isFunction(content.element)) content.element(item.feature, coords);
3601
3666
  else this.mapManager.showPopup(coords, content.element);
3602
3667
  }
3603
3668
  });