@inlog/inlog-maps 5.0.6 → 6.0.0

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.
Files changed (244) hide show
  1. package/DOCUMENTATION.md +19 -2
  2. package/_bundles/inlog-maps.js +2 -7239
  3. package/_bundles/inlog-maps.js.LICENSE.txt +20 -0
  4. package/_bundles/inlog-maps.js.map +1 -1
  5. package/_bundles/inlog-maps.min.js +2 -1
  6. package/_bundles/inlog-maps.min.js.LICENSE.txt +20 -0
  7. package/_bundles/inlog-maps.min.js.map +1 -1
  8. package/lib-esm/index.js +46 -45
  9. package/lib-esm/index.js.map +1 -1
  10. package/lib-esm/map.js +1136 -1008
  11. package/lib-esm/map.js.map +1 -1
  12. package/lib-esm/models/apis/google/google-circles.js +133 -128
  13. package/lib-esm/models/apis/google/google-circles.js.map +1 -1
  14. package/lib-esm/models/apis/google/google-geojson.js +72 -69
  15. package/lib-esm/models/apis/google/google-geojson.js.map +1 -1
  16. package/lib-esm/models/apis/google/google-map.js +173 -88
  17. package/lib-esm/models/apis/google/google-map.js.map +1 -1
  18. package/lib-esm/models/apis/google/google-markers.js +324 -288
  19. package/lib-esm/models/apis/google/google-markers.js.map +1 -1
  20. package/lib-esm/models/apis/google/google-overlay.js +101 -94
  21. package/lib-esm/models/apis/google/google-overlay.js.map +1 -1
  22. package/lib-esm/models/apis/google/google-polygons.js +300 -225
  23. package/lib-esm/models/apis/google/google-polygons.js.map +1 -1
  24. package/lib-esm/models/apis/google/google-polylines.js +706 -594
  25. package/lib-esm/models/apis/google/google-polylines.js.map +1 -1
  26. package/lib-esm/models/apis/google/google-popup.js +58 -58
  27. package/lib-esm/models/apis/google/google-popup.js.map +1 -1
  28. package/lib-esm/models/apis/googleMaps.js +448 -352
  29. package/lib-esm/models/apis/googleMaps.js.map +1 -1
  30. package/lib-esm/models/apis/leaflet/leaflet-circle.js +162 -132
  31. package/lib-esm/models/apis/leaflet/leaflet-circle.js.map +1 -1
  32. package/lib-esm/models/apis/leaflet/leaflet-geojson.js +72 -66
  33. package/lib-esm/models/apis/leaflet/leaflet-geojson.js.map +1 -1
  34. package/lib-esm/models/apis/leaflet/leaflet-map.js +139 -83
  35. package/lib-esm/models/apis/leaflet/leaflet-map.js.map +1 -1
  36. package/lib-esm/models/apis/leaflet/leaflet-markers.js +293 -257
  37. package/lib-esm/models/apis/leaflet/leaflet-markers.js.map +1 -1
  38. package/lib-esm/models/apis/leaflet/leaflet-overlay.js +34 -34
  39. package/lib-esm/models/apis/leaflet/leaflet-overlay.js.map +1 -1
  40. package/lib-esm/models/apis/leaflet/leaflet-polygons.js +210 -210
  41. package/lib-esm/models/apis/leaflet/leaflet-polygons.js.map +1 -1
  42. package/lib-esm/models/apis/leaflet/leaflet-polylines.js +705 -588
  43. package/lib-esm/models/apis/leaflet/leaflet-polylines.js.map +1 -1
  44. package/lib-esm/models/apis/leaflet/leaflet-popup.js +73 -73
  45. package/lib-esm/models/apis/leaflet/leaflet-popup.js.map +1 -1
  46. package/lib-esm/models/apis/leaflet.js +463 -358
  47. package/lib-esm/models/apis/leaflet.js.map +1 -1
  48. package/lib-esm/models/apis/mapFunctions.js +1 -0
  49. package/lib-esm/models/dto/event-type.js +38 -38
  50. package/lib-esm/models/dto/map-type.js +5 -5
  51. package/lib-esm/models/dto/polyline-type.js +6 -6
  52. package/lib-esm/models/features/circle/circle-alter-options.js +13 -13
  53. package/lib-esm/models/features/circle/circle-options.js +18 -18
  54. package/lib-esm/models/features/events/event-return.js +7 -7
  55. package/lib-esm/models/features/geojson/geojson-options.js +8 -8
  56. package/lib-esm/models/features/marker/circle-marker-options.js +11 -11
  57. package/lib-esm/models/features/marker/circle-marker-style.js +11 -11
  58. package/lib-esm/models/features/marker/marker-alter-options.js +9 -9
  59. package/lib-esm/models/features/marker/marker-icon.js +9 -9
  60. package/lib-esm/models/features/marker/marker-options.js +17 -17
  61. package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.js +9 -9
  62. package/lib-esm/models/features/overlay/overlay-options.js +14 -14
  63. package/lib-esm/models/features/polygons/polygon-alter-options.js +13 -12
  64. package/lib-esm/models/features/polygons/polygon-alter-options.js.map +1 -1
  65. package/lib-esm/models/features/polygons/polygon-options.js +18 -17
  66. package/lib-esm/models/features/polygons/polygon-options.js.map +1 -1
  67. package/lib-esm/models/features/polyline/navigations-options.js +15 -13
  68. package/lib-esm/models/features/polyline/navigations-options.js.map +1 -1
  69. package/lib-esm/models/features/polyline/polyline-options.js +19 -19
  70. package/lib-esm/models/features/polyline/polyline-options.js.map +1 -1
  71. package/lib-esm/models/features/popup/popup-options.js +12 -12
  72. package/lib-esm/utils/maps-api-loader.service.js +88 -75
  73. package/lib-esm/utils/maps-api-loader.service.js.map +1 -1
  74. package/lib-esm/utils/url-builder.js +43 -43
  75. package/lib-esm/utils/url-builder.js.map +1 -1
  76. package/package.json +67 -63
  77. package/lib/index.d.ts +0 -46
  78. package/lib/index.js +0 -47
  79. package/lib/index.js.map +0 -1
  80. package/lib/map.d.ts +0 -513
  81. package/lib/map.js +0 -1011
  82. package/lib/map.js.map +0 -1
  83. package/lib/models/apis/google/google-circles.d.ts +0 -18
  84. package/lib/models/apis/google/google-circles.js +0 -131
  85. package/lib/models/apis/google/google-circles.js.map +0 -1
  86. package/lib/models/apis/google/google-geojson.d.ts +0 -9
  87. package/lib/models/apis/google/google-geojson.js +0 -72
  88. package/lib/models/apis/google/google-geojson.js.map +0 -1
  89. package/lib/models/apis/google/google-map.d.ts +0 -15
  90. package/lib/models/apis/google/google-map.js +0 -91
  91. package/lib/models/apis/google/google-map.js.map +0 -1
  92. package/lib/models/apis/google/google-markers.d.ts +0 -29
  93. package/lib/models/apis/google/google-markers.js +0 -291
  94. package/lib/models/apis/google/google-markers.js.map +0 -1
  95. package/lib/models/apis/google/google-overlay.d.ts +0 -11
  96. package/lib/models/apis/google/google-overlay.js +0 -97
  97. package/lib/models/apis/google/google-overlay.js.map +0 -1
  98. package/lib/models/apis/google/google-polygons.d.ts +0 -29
  99. package/lib/models/apis/google/google-polygons.js +0 -228
  100. package/lib/models/apis/google/google-polygons.js.map +0 -1
  101. package/lib/models/apis/google/google-polylines.d.ts +0 -55
  102. package/lib/models/apis/google/google-polylines.js +0 -597
  103. package/lib/models/apis/google/google-polylines.js.map +0 -1
  104. package/lib/models/apis/google/google-popup.d.ts +0 -10
  105. package/lib/models/apis/google/google-popup.js +0 -61
  106. package/lib/models/apis/google/google-popup.js.map +0 -1
  107. package/lib/models/apis/googleMaps.d.ts +0 -95
  108. package/lib/models/apis/googleMaps.js +0 -355
  109. package/lib/models/apis/googleMaps.js.map +0 -1
  110. package/lib/models/apis/leaflet/leaflet-circle.d.ts +0 -18
  111. package/lib/models/apis/leaflet/leaflet-circle.js +0 -135
  112. package/lib/models/apis/leaflet/leaflet-circle.js.map +0 -1
  113. package/lib/models/apis/leaflet/leaflet-geojson.d.ts +0 -9
  114. package/lib/models/apis/leaflet/leaflet-geojson.js +0 -69
  115. package/lib/models/apis/leaflet/leaflet-geojson.js.map +0 -1
  116. package/lib/models/apis/leaflet/leaflet-map.d.ts +0 -15
  117. package/lib/models/apis/leaflet/leaflet-map.js +0 -86
  118. package/lib/models/apis/leaflet/leaflet-map.js.map +0 -1
  119. package/lib/models/apis/leaflet/leaflet-markers.d.ts +0 -29
  120. package/lib/models/apis/leaflet/leaflet-markers.js +0 -260
  121. package/lib/models/apis/leaflet/leaflet-markers.js.map +0 -1
  122. package/lib/models/apis/leaflet/leaflet-overlay.d.ts +0 -10
  123. package/lib/models/apis/leaflet/leaflet-overlay.js +0 -37
  124. package/lib/models/apis/leaflet/leaflet-overlay.js.map +0 -1
  125. package/lib/models/apis/leaflet/leaflet-polygons.d.ts +0 -23
  126. package/lib/models/apis/leaflet/leaflet-polygons.js +0 -213
  127. package/lib/models/apis/leaflet/leaflet-polygons.js.map +0 -1
  128. package/lib/models/apis/leaflet/leaflet-polylines.d.ts +0 -54
  129. package/lib/models/apis/leaflet/leaflet-polylines.js +0 -591
  130. package/lib/models/apis/leaflet/leaflet-polylines.js.map +0 -1
  131. package/lib/models/apis/leaflet/leaflet-popup.d.ts +0 -11
  132. package/lib/models/apis/leaflet/leaflet-popup.js +0 -76
  133. package/lib/models/apis/leaflet/leaflet-popup.js.map +0 -1
  134. package/lib/models/apis/leaflet.d.ts +0 -97
  135. package/lib/models/apis/leaflet.js +0 -361
  136. package/lib/models/apis/leaflet.js.map +0 -1
  137. package/lib/models/apis/mapFunctions.d.ts +0 -84
  138. package/lib/models/apis/mapFunctions.js +0 -3
  139. package/lib/models/apis/mapFunctions.js.map +0 -1
  140. package/lib/models/dto/event-type.d.ts +0 -33
  141. package/lib/models/dto/event-type.js +0 -41
  142. package/lib/models/dto/event-type.js.map +0 -1
  143. package/lib/models/dto/map-type.d.ts +0 -4
  144. package/lib/models/dto/map-type.js +0 -8
  145. package/lib/models/dto/map-type.js.map +0 -1
  146. package/lib/models/dto/polyline-type.d.ts +0 -5
  147. package/lib/models/dto/polyline-type.js +0 -9
  148. package/lib/models/dto/polyline-type.js.map +0 -1
  149. package/lib/models/features/circle/circle-alter-options.d.ts +0 -12
  150. package/lib/models/features/circle/circle-alter-options.js +0 -16
  151. package/lib/models/features/circle/circle-alter-options.js.map +0 -1
  152. package/lib/models/features/circle/circle-options.d.ts +0 -15
  153. package/lib/models/features/circle/circle-options.js +0 -21
  154. package/lib/models/features/circle/circle-options.js.map +0 -1
  155. package/lib/models/features/events/event-return.d.ts +0 -4
  156. package/lib/models/features/events/event-return.js +0 -10
  157. package/lib/models/features/events/event-return.js.map +0 -1
  158. package/lib/models/features/geojson/geojson-options.d.ts +0 -5
  159. package/lib/models/features/geojson/geojson-options.js +0 -11
  160. package/lib/models/features/geojson/geojson-options.js.map +0 -1
  161. package/lib/models/features/marker/circle-marker-options.d.ts +0 -9
  162. package/lib/models/features/marker/circle-marker-options.js +0 -14
  163. package/lib/models/features/marker/circle-marker-options.js.map +0 -1
  164. package/lib/models/features/marker/circle-marker-style.d.ts +0 -8
  165. package/lib/models/features/marker/circle-marker-style.js +0 -14
  166. package/lib/models/features/marker/circle-marker-style.js.map +0 -1
  167. package/lib/models/features/marker/marker-alter-options.d.ts +0 -8
  168. package/lib/models/features/marker/marker-alter-options.js +0 -12
  169. package/lib/models/features/marker/marker-alter-options.js.map +0 -1
  170. package/lib/models/features/marker/marker-icon.d.ts +0 -6
  171. package/lib/models/features/marker/marker-icon.js +0 -12
  172. package/lib/models/features/marker/marker-icon.js.map +0 -1
  173. package/lib/models/features/marker/marker-options.d.ts +0 -11
  174. package/lib/models/features/marker/marker-options.js +0 -20
  175. package/lib/models/features/marker/marker-options.js.map +0 -1
  176. package/lib/models/features/marker-clusterer/marker-clusterer-config.d.ts +0 -6
  177. package/lib/models/features/marker-clusterer/marker-clusterer-config.js +0 -12
  178. package/lib/models/features/marker-clusterer/marker-clusterer-config.js.map +0 -1
  179. package/lib/models/features/overlay/overlay-options.d.ts +0 -11
  180. package/lib/models/features/overlay/overlay-options.js +0 -17
  181. package/lib/models/features/overlay/overlay-options.js.map +0 -1
  182. package/lib/models/features/polygons/polygon-alter-options.d.ts +0 -13
  183. package/lib/models/features/polygons/polygon-alter-options.js +0 -15
  184. package/lib/models/features/polygons/polygon-alter-options.js.map +0 -1
  185. package/lib/models/features/polygons/polygon-options.d.ts +0 -15
  186. package/lib/models/features/polygons/polygon-options.js +0 -20
  187. package/lib/models/features/polygons/polygon-options.js.map +0 -1
  188. package/lib/models/features/polyline/navigations-options.d.ts +0 -11
  189. package/lib/models/features/polyline/navigations-options.js +0 -16
  190. package/lib/models/features/polyline/navigations-options.js.map +0 -1
  191. package/lib/models/features/polyline/polyline-options.d.ts +0 -18
  192. package/lib/models/features/polyline/polyline-options.js +0 -22
  193. package/lib/models/features/polyline/polyline-options.js.map +0 -1
  194. package/lib/models/features/popup/popup-options.d.ts +0 -9
  195. package/lib/models/features/popup/popup-options.js +0 -15
  196. package/lib/models/features/popup/popup-options.js.map +0 -1
  197. package/lib/utils/maps-api-loader.service.d.ts +0 -9
  198. package/lib/utils/maps-api-loader.service.js +0 -78
  199. package/lib/utils/maps-api-loader.service.js.map +0 -1
  200. package/lib/utils/url-builder.d.ts +0 -11
  201. package/lib/utils/url-builder.js +0 -46
  202. package/lib/utils/url-builder.js.map +0 -1
  203. package/lib-esm/index.d.ts +0 -46
  204. package/lib-esm/map.d.ts +0 -513
  205. package/lib-esm/models/apis/google/google-circles.d.ts +0 -18
  206. package/lib-esm/models/apis/google/google-geojson.d.ts +0 -9
  207. package/lib-esm/models/apis/google/google-map.d.ts +0 -15
  208. package/lib-esm/models/apis/google/google-markers.d.ts +0 -29
  209. package/lib-esm/models/apis/google/google-overlay.d.ts +0 -11
  210. package/lib-esm/models/apis/google/google-polygons.d.ts +0 -29
  211. package/lib-esm/models/apis/google/google-polylines.d.ts +0 -55
  212. package/lib-esm/models/apis/google/google-popup.d.ts +0 -10
  213. package/lib-esm/models/apis/googleMaps.d.ts +0 -95
  214. package/lib-esm/models/apis/leaflet/leaflet-circle.d.ts +0 -18
  215. package/lib-esm/models/apis/leaflet/leaflet-geojson.d.ts +0 -9
  216. package/lib-esm/models/apis/leaflet/leaflet-map.d.ts +0 -15
  217. package/lib-esm/models/apis/leaflet/leaflet-markers.d.ts +0 -29
  218. package/lib-esm/models/apis/leaflet/leaflet-overlay.d.ts +0 -10
  219. package/lib-esm/models/apis/leaflet/leaflet-polygons.d.ts +0 -23
  220. package/lib-esm/models/apis/leaflet/leaflet-polylines.d.ts +0 -54
  221. package/lib-esm/models/apis/leaflet/leaflet-popup.d.ts +0 -11
  222. package/lib-esm/models/apis/leaflet.d.ts +0 -97
  223. package/lib-esm/models/apis/mapFunctions.d.ts +0 -84
  224. package/lib-esm/models/dto/event-type.d.ts +0 -33
  225. package/lib-esm/models/dto/map-type.d.ts +0 -4
  226. package/lib-esm/models/dto/polyline-type.d.ts +0 -5
  227. package/lib-esm/models/features/circle/circle-alter-options.d.ts +0 -12
  228. package/lib-esm/models/features/circle/circle-options.d.ts +0 -15
  229. package/lib-esm/models/features/events/event-return.d.ts +0 -4
  230. package/lib-esm/models/features/geojson/geojson-options.d.ts +0 -5
  231. package/lib-esm/models/features/marker/circle-marker-options.d.ts +0 -9
  232. package/lib-esm/models/features/marker/circle-marker-style.d.ts +0 -8
  233. package/lib-esm/models/features/marker/marker-alter-options.d.ts +0 -8
  234. package/lib-esm/models/features/marker/marker-icon.d.ts +0 -6
  235. package/lib-esm/models/features/marker/marker-options.d.ts +0 -11
  236. package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.d.ts +0 -6
  237. package/lib-esm/models/features/overlay/overlay-options.d.ts +0 -11
  238. package/lib-esm/models/features/polygons/polygon-alter-options.d.ts +0 -13
  239. package/lib-esm/models/features/polygons/polygon-options.d.ts +0 -15
  240. package/lib-esm/models/features/polyline/navigations-options.d.ts +0 -11
  241. package/lib-esm/models/features/polyline/polyline-options.d.ts +0 -18
  242. package/lib-esm/models/features/popup/popup-options.d.ts +0 -9
  243. package/lib-esm/utils/maps-api-loader.service.d.ts +0 -9
  244. package/lib-esm/utils/url-builder.d.ts +0 -11
@@ -1,359 +1,464 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- return new (P || (P = Promise))(function (resolve, reject) {
3
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
4
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
5
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
6
- step((generator = generator.apply(thisArg, _arguments || [])).next());
7
- });
8
- };
9
- var __generator = (this && this.__generator) || function (thisArg, body) {
10
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
11
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
- function verb(n) { return function (v) { return step([n, v]); }; }
13
- function step(op) {
14
- if (f) throw new TypeError("Generator is already executing.");
15
- while (_) try {
16
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
17
- if (y = 0, t) op = [op[0] & 2, t.value];
18
- switch (op[0]) {
19
- case 0: case 1: t = op; break;
20
- case 4: _.label++; return { value: op[1], done: false };
21
- case 5: _.label++; y = op[1]; op = [0]; continue;
22
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
23
- default:
24
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
25
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
26
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
27
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
28
- if (t[2]) _.ops.pop();
29
- _.trys.pop(); continue;
30
- }
31
- op = body.call(thisArg, _);
32
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
33
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
34
- }
35
- };
36
- import { MapsApiLoaderService } from '../../utils/maps-api-loader.service';
37
- import LeafletCircles from './leaflet/leaflet-circle';
38
- import LeafletGeoJson from './leaflet/leaflet-geojson';
39
- import LeafletMap from './leaflet/leaflet-map';
40
- import LeafletMarkers from './leaflet/leaflet-markers';
41
- import LeafletOverlays from './leaflet/leaflet-overlay';
42
- import LeafletPolygons from './leaflet/leaflet-polygons';
43
- import LeafletPolylines from './leaflet/leaflet-polylines';
44
- import LeafletPopups from './leaflet/leaflet-popup';
45
- var Leaflet = /** @class */ (function () {
46
- function Leaflet() {
47
- this.mapsApiLoader = new MapsApiLoaderService();
48
- }
49
- Leaflet.prototype.initialize = function (mapType, params, elementId) {
50
- return __awaiter(this, void 0, void 0, function () {
51
- var api, leaflet_1, mapOptions, osm, wikimedia, satelliteURL, satellite, map, baseLayers_1, err_1;
52
- return __generator(this, function (_a) {
53
- switch (_a.label) {
54
- case 0:
55
- _a.trys.push([0, 4, , 5]);
56
- return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];
57
- case 1:
58
- api = _a.sent();
59
- leaflet_1 = api;
60
- this.loadDependencies(params);
61
- return [4 /*yield*/, this.mapTimeout(1000)];
62
- case 2:
63
- _a.sent();
64
- mapOptions = {
65
- center: new leaflet_1.LatLng(-14, -54),
66
- editable: true,
67
- keyboard: false,
68
- maxZoom: params.wikimedia ? 18 : 19,
69
- minZoom: 4,
70
- zoom: 4,
71
- zoomControl: false
72
- };
73
- if (params.gestureHandling) {
74
- mapOptions.gestureHandling = true;
75
- }
76
- return [4 /*yield*/, this.mapTimeout(200)];
77
- case 3:
78
- _a.sent();
79
- osm = new leaflet_1.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);
80
- wikimedia = new leaflet_1.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {
81
- attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>'
82
- });
83
- satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +
84
- 'World_Imagery/MapServer/tile/{z}/{y}/{x}';
85
- satellite = L.tileLayer(satelliteURL, {
86
- attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +
87
- ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
88
- maxZoom: 18
89
- });
90
- mapOptions.layers = [params.wikimedia ? wikimedia : osm];
91
- map = new leaflet_1.Map(elementId, mapOptions);
92
- baseLayers_1 = {
93
- Map: params.wikimedia ? wikimedia : osm,
94
- Satellite: satellite
95
- };
96
- if (params.mapTiles && params.mapTiles.length) {
97
- params.mapTiles.forEach(function (tile) {
98
- var layer = new leaflet_1.tileLayer(tile.url, tile.options);
99
- baseLayers_1[tile.name] = layer;
100
- });
101
- }
102
- leaflet_1.control.layers(baseLayers_1, null, { position: 'topleft' }).addTo(map);
103
- leaflet_1.control.zoom({ position: 'bottomright' }).addTo(map);
104
- this.leafletMarkers = new LeafletMarkers(map, leaflet_1);
105
- this.leafletPolygons = new LeafletPolygons(map, leaflet_1);
106
- this.leafletCircles = new LeafletCircles(map, leaflet_1);
107
- this.leafletPopups = new LeafletPopups(map, leaflet_1);
108
- this.leafletPolylines = new LeafletPolylines(map, leaflet_1, this.leafletPopups);
109
- this.leafletMap = new LeafletMap(map, leaflet_1);
110
- this.leafletOverlays = new LeafletOverlays(map, leaflet_1, this.leafletPolygons);
111
- this.leafletGeoJson = new LeafletGeoJson(map, leaflet_1);
112
- return [2 /*return*/, this];
113
- case 4:
114
- err_1 = _a.sent();
115
- console.error(err_1);
116
- return [2 /*return*/, err_1];
117
- case 5: return [2 /*return*/];
118
- }
119
- });
120
- });
121
- };
122
- /* GEOJson */
123
- Leaflet.prototype.loadGEOJson = function (data, options, eventClick) {
124
- this.leafletGeoJson.loadGEOJson(data, options, eventClick);
125
- };
126
- /* Markers */
127
- Leaflet.prototype.drawMarker = function (options, eventClick) {
128
- return this.leafletMarkers.drawMarker(options, eventClick);
129
- };
130
- Leaflet.prototype.drawCircleMarker = function (options, eventClick) {
131
- return this.leafletMarkers.drawCircleMarker(options, eventClick);
132
- };
133
- Leaflet.prototype.toggleMarkers = function (markers, show, markerClusterer) {
134
- this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);
135
- };
136
- Leaflet.prototype.alterMarkerOptions = function (markers, options) {
137
- this.leafletMarkers.alterMarkerOptions(markers, options);
138
- };
139
- Leaflet.prototype.alterMarkerPosition = function (markers, position, addTransition) {
140
- this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);
141
- };
142
- Leaflet.prototype.fitBoundsPositions = function (markers) {
143
- this.leafletMarkers.fitBoundsPositions(markers);
144
- };
145
- Leaflet.prototype.isMarkerOnMap = function (marker) {
146
- return this.leafletMarkers.isMarkerOnMap(marker);
147
- };
148
- Leaflet.prototype.setCenterMarker = function (marker) {
149
- this.leafletMarkers.setCenterMarker(marker);
150
- };
151
- Leaflet.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {
152
- this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);
153
- };
154
- Leaflet.prototype.removeMarkerEvent = function (markers, event) {
155
- this.leafletMarkers.removeMarkerEvent(markers, event);
156
- };
157
- /* Marker Clusterer */
158
- Leaflet.prototype.addMarkerClusterer = function (config) {
159
- return this.leafletMarkers.addMarkerClusterer(config);
160
- };
161
- Leaflet.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {
162
- this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);
163
- };
164
- Leaflet.prototype.refreshClusterer = function (markerClusterer) {
165
- this.leafletMarkers.refreshClusterer(markerClusterer);
166
- };
167
- Leaflet.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {
168
- this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);
169
- };
170
- Leaflet.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {
171
- this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);
172
- };
173
- Leaflet.prototype.clearMarkersClusterer = function (markerClusterer) {
174
- this.leafletMarkers.clearMarkersClusterer(markerClusterer);
175
- };
176
- Leaflet.prototype.countMarkersOnCluster = function (markerClusterer) {
177
- return this.leafletMarkers.countMarkersOnCluster(markerClusterer);
178
- };
179
- /* Polygons */
180
- Leaflet.prototype.drawPolygon = function (options, eventClick) {
181
- return this.leafletPolygons.drawPolygon(options, eventClick);
182
- };
183
- Leaflet.prototype.togglePolygons = function (polygons, show) {
184
- this.leafletPolygons.togglePolygons(polygons, show);
185
- };
186
- Leaflet.prototype.alterPolygonOptions = function (polygons, options) {
187
- this.leafletPolygons.alterPolygonOptions(polygons, options);
188
- };
189
- Leaflet.prototype.fitBoundsPolygons = function (polygons) {
190
- this.leafletPolygons.fitBoundsPolygons(polygons);
191
- };
192
- Leaflet.prototype.setCenterPolygons = function (polygons) {
193
- this.leafletPolygons.setCenterPolygons(polygons);
194
- };
195
- Leaflet.prototype.isPolygonOnMap = function (polygon) {
196
- return this.leafletPolygons.isPolygonOnMap(polygon);
197
- };
198
- Leaflet.prototype.getPolygonPath = function (polygon) {
199
- return this.leafletPolygons.getPolygonPath(polygon);
200
- };
201
- Leaflet.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {
202
- this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);
203
- };
204
- Leaflet.prototype.removePolygonEvent = function (polygons, event) {
205
- this.leafletPolygons.removePolygonEvent(polygons, event);
206
- };
207
- /* Circles */
208
- Leaflet.prototype.drawCircle = function (options, eventClick) {
209
- return this.leafletCircles.drawCircle(options, eventClick);
210
- };
211
- Leaflet.prototype.toggleCircles = function (circles, show) {
212
- this.leafletCircles.toggleCircles(circles, show);
213
- };
214
- Leaflet.prototype.alterCircleOptions = function (circles, options) {
215
- this.leafletCircles.alterCircleOptions(circles, options);
216
- };
217
- Leaflet.prototype.fitBoundsCircles = function (circles) {
218
- this.leafletCircles.fitBoundsCircles(circles);
219
- };
220
- Leaflet.prototype.isCircleOnMap = function (circle) {
221
- return this.leafletCircles.isCircleOnMap(circle);
222
- };
223
- Leaflet.prototype.getCircleCenter = function (circle) {
224
- return this.leafletCircles.getCircleCenter(circle);
225
- };
226
- Leaflet.prototype.getCircleRadius = function (circle) {
227
- return this.leafletCircles.getCircleRadius(circle);
228
- };
229
- Leaflet.prototype.addCircleEvent = function (circles, eventType, eventFunction) {
230
- this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);
231
- };
232
- Leaflet.prototype.removeCircleEvent = function (circles, event) {
233
- this.leafletCircles.removeCircleEvent(circles, event);
234
- };
235
- /* Polylines */
236
- Leaflet.prototype.drawPolyline = function (options, eventClick) {
237
- return this.leafletPolylines.drawPolyline(options, eventClick);
238
- };
239
- Leaflet.prototype.drawPolylineWithNavigation = function (options, eventClick) {
240
- return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);
241
- };
242
- Leaflet.prototype.togglePolylines = function (polylines, show) {
243
- this.leafletPolylines.togglePolylines(polylines, show);
244
- };
245
- Leaflet.prototype.alterPolylineOptions = function (polylines, options) {
246
- this.leafletPolylines.alterPolylineOptions(polylines, options);
247
- };
248
- Leaflet.prototype.fitBoundsPolylines = function (polylines) {
249
- this.leafletPolylines.fitBoundsPolylines(polylines);
250
- };
251
- Leaflet.prototype.isPolylineOnMap = function (polyline) {
252
- return this.leafletPolylines.isPolylineOnMap(polyline);
253
- };
254
- Leaflet.prototype.addPolylinePath = function (polylines, position) {
255
- this.leafletPolylines.addPolylinePath(polylines, position);
256
- };
257
- Leaflet.prototype.getPolylinePath = function (polyline) {
258
- return this.leafletPolylines.getPolylinePath(polyline);
259
- };
260
- Leaflet.prototype.removePolylineHighlight = function () {
261
- this.leafletPolylines.removePolylineHighlight();
262
- };
263
- Leaflet.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {
264
- this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);
265
- };
266
- Leaflet.prototype.removePolylineEvent = function (polylines, event) {
267
- this.leafletPolylines.removePolylineEvent(polylines, event);
268
- };
269
- Leaflet.prototype.setIndexPolylineHighlight = function (polyline, index) {
270
- this.leafletPolylines.setIndexPolylineHighlight(polyline, index);
271
- };
272
- Leaflet.prototype.getObjectPolyline = function (polyline) {
273
- return this.leafletPolylines.getObjectPolyline(polyline);
274
- };
275
- Leaflet.prototype.getObjectPolylineHighlight = function () {
276
- return this.leafletPolylines.getObjectPolylineHighlight();
277
- };
278
- Leaflet.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {
279
- this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);
280
- };
281
- Leaflet.prototype.getPolylineHighlightIndex = function () {
282
- return this.leafletPolylines.getPolylineHighlightIndex();
283
- };
284
- /* Popups */
285
- Leaflet.prototype.drawPopup = function (options, marker) {
286
- return this.leafletPopups.drawPopup(options, marker);
287
- };
288
- Leaflet.prototype.alterPopup = function (popup, options, marker) {
289
- return this.leafletPopups.alterPopup(popup, options, marker);
290
- };
291
- Leaflet.prototype.alterPopupContent = function (popup, options, marker) {
292
- this.leafletPopups.alterPopupContent(popup, options, marker);
293
- };
294
- Leaflet.prototype.closePopup = function (popup) {
295
- this.leafletPopups.closePopup(popup);
296
- };
297
- /* Map */
298
- Leaflet.prototype.resizeMap = function () {
299
- this.leafletMap.resizeMap();
300
- };
301
- Leaflet.prototype.addEventMap = function (eventType, eventFunction) {
302
- this.leafletMap.addEventMap(eventType, eventFunction);
303
- };
304
- Leaflet.prototype.removeEventMap = function (eventType) {
305
- this.leafletMap.removeEventMap(eventType);
306
- };
307
- Leaflet.prototype.getZoom = function () {
308
- return this.leafletMap.getZoom();
309
- };
310
- Leaflet.prototype.setZoom = function (zoom) {
311
- this.leafletMap.setZoom(zoom);
312
- };
313
- Leaflet.prototype.getCenter = function () {
314
- return this.leafletMap.getCenter();
315
- };
316
- Leaflet.prototype.setCenter = function (position) {
317
- this.leafletMap.setCenter(position);
318
- };
319
- Leaflet.prototype.pixelsToLatLng = function (offsetx, offsety) {
320
- return this.leafletMap.pixelsToLatLng(offsetx, offsety);
321
- };
322
- Leaflet.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {
323
- this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);
324
- };
325
- /* Overlay */
326
- Leaflet.prototype.drawOverlay = function (options, polygons) {
327
- return this.leafletOverlays.drawOverlay(options, polygons);
328
- };
329
- Leaflet.prototype.toggleOverlay = function (overlays, show) {
330
- this.leafletOverlays.toggleOverlay(overlays, show);
331
- };
332
- /* Private Methods */
333
- Leaflet.prototype.mapTimeout = function (ms) {
334
- return new Promise(function (resolve) { return setTimeout(resolve, ms); });
335
- };
336
- Leaflet.prototype.loadDependencies = function (params) {
337
- var styles = params.cssDependencies;
338
- if (styles && styles.length > 0) {
339
- styles.forEach(function (path) {
340
- var link = document.createElement('link');
341
- link.rel = 'stylesheet';
342
- link.href = path;
343
- document.querySelector('head').appendChild(link);
344
- });
345
- }
346
- var scripts = params.scriptsDependencies;
347
- if (scripts && scripts.length > 0) {
348
- scripts.forEach(function (path) {
349
- var script = document.createElement('script');
350
- script.type = 'text/javascript';
351
- script.src = path;
352
- document.querySelector('head').appendChild(script);
353
- });
354
- }
355
- };
356
- return Leaflet;
357
- }());
358
- export default Leaflet;
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { SimpleMapScreenshoter } from "leaflet-simple-map-screenshoter";
38
+ import { MapsApiLoaderService } from "../../utils/maps-api-loader.service";
39
+ import LeafletCircles from "./leaflet/leaflet-circle";
40
+ import LeafletGeoJson from "./leaflet/leaflet-geojson";
41
+ import LeafletMap from "./leaflet/leaflet-map";
42
+ import LeafletMarkers from "./leaflet/leaflet-markers";
43
+ import LeafletOverlays from "./leaflet/leaflet-overlay";
44
+ import LeafletPolygons from "./leaflet/leaflet-polygons";
45
+ import LeafletPolylines from "./leaflet/leaflet-polylines";
46
+ import LeafletPopups from "./leaflet/leaflet-popup";
47
+ var Leaflet = /** @class */ (function () {
48
+ function Leaflet() {
49
+ this.leafletMarkers = null;
50
+ this.leafletPolygons = null;
51
+ this.leafletCircles = null;
52
+ this.leafletPolylines = null;
53
+ this.leafletPopups = null;
54
+ this.leafletMap = null;
55
+ this.leafletOverlays = null;
56
+ this.leafletGeoJson = null;
57
+ this.mapsApiLoader = new MapsApiLoaderService();
58
+ /* */
59
+ }
60
+ Leaflet.prototype.initialize = function (mapType, params, elementId) {
61
+ return __awaiter(this, void 0, void 0, function () {
62
+ var api, leaflet_1, mapOptions, osm, wikimedia, satelliteURL, satellite, map, baseLayers_1, snapshotOptions, screenshoter, err_1;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0:
66
+ _a.trys.push([0, 4, , 5]);
67
+ return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];
68
+ case 1:
69
+ api = _a.sent();
70
+ leaflet_1 = api;
71
+ this.loadDependencies(params);
72
+ return [4 /*yield*/, this.mapTimeout(1000)];
73
+ case 2:
74
+ _a.sent();
75
+ mapOptions = {
76
+ center: new leaflet_1.LatLng(-14, -54),
77
+ editable: true,
78
+ keyboard: false,
79
+ maxZoom: params.wikimedia ? 18 : 19,
80
+ minZoom: 4,
81
+ zoom: 4,
82
+ zoomControl: false,
83
+ };
84
+ if (params.gestureHandling) {
85
+ mapOptions.gestureHandling = true;
86
+ }
87
+ return [4 /*yield*/, this.mapTimeout(200)];
88
+ case 3:
89
+ _a.sent();
90
+ osm = new leaflet_1.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png", mapOptions);
91
+ wikimedia = new leaflet_1.tileLayer("https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png", {
92
+ attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>',
93
+ });
94
+ satelliteURL = "https://server.arcgisonline.com/ArcGIS/rest/services/" +
95
+ "World_Imagery/MapServer/tile/{z}/{y}/{x}";
96
+ satellite = L.tileLayer(satelliteURL, {
97
+ attribution: "Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye," +
98
+ " Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community",
99
+ maxZoom: 18,
100
+ });
101
+ mapOptions.layers = [params.wikimedia ? wikimedia : osm];
102
+ map = new leaflet_1.Map(elementId, mapOptions);
103
+ baseLayers_1 = {
104
+ Map: params.wikimedia ? wikimedia : osm,
105
+ Satellite: satellite,
106
+ };
107
+ if (params.mapTiles && params.mapTiles.length) {
108
+ params.mapTiles.forEach(function (tile) {
109
+ var layer = new leaflet_1.tileLayer(tile.url, tile.options);
110
+ baseLayers_1[tile.name] = layer;
111
+ });
112
+ }
113
+ leaflet_1.control
114
+ .layers(baseLayers_1, null, { position: "topleft" })
115
+ .addTo(map);
116
+ leaflet_1.control.zoom({ position: "bottomright" }).addTo(map);
117
+ snapshotOptions = {
118
+ hideElementsWithSelectors: [
119
+ ".leaflet-control-container",
120
+ ".leaflet-dont-include-pane",
121
+ "#snapshot-button",
122
+ ],
123
+ hidden: true,
124
+ };
125
+ screenshoter = new SimpleMapScreenshoter(snapshotOptions);
126
+ this.leafletScreenshot = screenshoter.addTo(map);
127
+ this.leafletMarkers = new LeafletMarkers(map, leaflet_1);
128
+ this.leafletPolygons = new LeafletPolygons(map, leaflet_1);
129
+ this.leafletCircles = new LeafletCircles(map, leaflet_1);
130
+ this.leafletPopups = new LeafletPopups(map, leaflet_1);
131
+ this.leafletPolylines = new LeafletPolylines(map, leaflet_1, this.leafletPopups);
132
+ this.leafletMap = new LeafletMap(map, leaflet_1);
133
+ this.leafletOverlays = new LeafletOverlays(map, leaflet_1, this.leafletPolygons);
134
+ this.leafletGeoJson = new LeafletGeoJson(map, leaflet_1);
135
+ return [2 /*return*/, this];
136
+ case 4:
137
+ err_1 = _a.sent();
138
+ console.error(err_1);
139
+ return [2 /*return*/, err_1];
140
+ case 5: return [2 /*return*/];
141
+ }
142
+ });
143
+ });
144
+ };
145
+ /* GEOJson */
146
+ Leaflet.prototype.loadGEOJson = function (data, options, eventClick) {
147
+ var _a;
148
+ (_a = this.leafletGeoJson) === null || _a === void 0 ? void 0 : _a.loadGEOJson(data, options, eventClick);
149
+ };
150
+ /* Markers */
151
+ Leaflet.prototype.drawMarker = function (options, eventClick) {
152
+ var _a;
153
+ return (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.drawMarker(options, eventClick);
154
+ };
155
+ Leaflet.prototype.drawCircleMarker = function (options, eventClick) {
156
+ var _a;
157
+ return (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.drawCircleMarker(options, eventClick);
158
+ };
159
+ Leaflet.prototype.toggleMarkers = function (markers, show, markerClusterer) {
160
+ var _a;
161
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.toggleMarkers(markers, show, markerClusterer);
162
+ };
163
+ Leaflet.prototype.alterMarkerOptions = function (markers, options) {
164
+ var _a;
165
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.alterMarkerOptions(markers, options);
166
+ };
167
+ Leaflet.prototype.alterMarkerPosition = function (markers, position, addTransition) {
168
+ var _a;
169
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.alterMarkerPosition(markers, position, addTransition);
170
+ };
171
+ Leaflet.prototype.fitBoundsPositions = function (markers) {
172
+ var _a;
173
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.fitBoundsPositions(markers);
174
+ };
175
+ Leaflet.prototype.isMarkerOnMap = function (marker) {
176
+ var _a;
177
+ return (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.isMarkerOnMap(marker);
178
+ };
179
+ Leaflet.prototype.setCenterMarker = function (marker) {
180
+ var _a;
181
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.setCenterMarker(marker);
182
+ };
183
+ Leaflet.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {
184
+ var _a;
185
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.addMarkerEvent(markers, eventType, eventFunction);
186
+ };
187
+ Leaflet.prototype.removeMarkerEvent = function (markers, event) {
188
+ var _a;
189
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.removeMarkerEvent(markers, event);
190
+ };
191
+ /* Marker Clusterer */
192
+ Leaflet.prototype.addMarkerClusterer = function (config) {
193
+ var _a;
194
+ return (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.addMarkerClusterer(config);
195
+ };
196
+ Leaflet.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {
197
+ var _a;
198
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.alterMarkerClustererConfig(markerClusterer, config);
199
+ };
200
+ Leaflet.prototype.refreshClusterer = function (markerClusterer) {
201
+ var _a;
202
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.refreshClusterer(markerClusterer);
203
+ };
204
+ Leaflet.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {
205
+ var _a;
206
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.addMarkerOnClusterer(marker, markerClusterer);
207
+ };
208
+ Leaflet.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {
209
+ var _a;
210
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.removeMarkerFromClusterer(marker, markerClusterer);
211
+ };
212
+ Leaflet.prototype.clearMarkersClusterer = function (markerClusterer) {
213
+ var _a;
214
+ (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.clearMarkersClusterer(markerClusterer);
215
+ };
216
+ Leaflet.prototype.countMarkersOnCluster = function (markerClusterer) {
217
+ var _a;
218
+ return (_a = this.leafletMarkers) === null || _a === void 0 ? void 0 : _a.countMarkersOnCluster(markerClusterer);
219
+ };
220
+ /* Polygons */
221
+ Leaflet.prototype.drawPolygon = function (options, eventClick) {
222
+ var _a;
223
+ return (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.drawPolygon(options, eventClick);
224
+ };
225
+ Leaflet.prototype.togglePolygons = function (polygons, show) {
226
+ var _a;
227
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.togglePolygons(polygons, show);
228
+ };
229
+ Leaflet.prototype.alterPolygonOptions = function (polygons, options) {
230
+ var _a;
231
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.alterPolygonOptions(polygons, options);
232
+ };
233
+ Leaflet.prototype.fitBoundsPolygons = function (polygons) {
234
+ var _a;
235
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.fitBoundsPolygons(polygons);
236
+ };
237
+ Leaflet.prototype.setCenterPolygons = function (polygons) {
238
+ var _a;
239
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.setCenterPolygons(polygons);
240
+ };
241
+ Leaflet.prototype.isPolygonOnMap = function (polygon) {
242
+ var _a;
243
+ return (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.isPolygonOnMap(polygon);
244
+ };
245
+ Leaflet.prototype.getPolygonPath = function (polygon) {
246
+ var _a;
247
+ return (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.getPolygonPath(polygon);
248
+ };
249
+ Leaflet.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {
250
+ var _a;
251
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.addPolygonEvent(polygons, eventType, eventFunction);
252
+ };
253
+ Leaflet.prototype.removePolygonEvent = function (polygons, event) {
254
+ var _a;
255
+ (_a = this.leafletPolygons) === null || _a === void 0 ? void 0 : _a.removePolygonEvent(polygons, event);
256
+ };
257
+ /* Circles */
258
+ Leaflet.prototype.drawCircle = function (options, eventClick) {
259
+ var _a;
260
+ return (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.drawCircle(options, eventClick);
261
+ };
262
+ Leaflet.prototype.toggleCircles = function (circles, show) {
263
+ var _a;
264
+ (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.toggleCircles(circles, show);
265
+ };
266
+ Leaflet.prototype.alterCircleOptions = function (circles, options) {
267
+ var _a;
268
+ (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.alterCircleOptions(circles, options);
269
+ };
270
+ Leaflet.prototype.fitBoundsCircles = function (circles) {
271
+ var _a;
272
+ (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.fitBoundsCircles(circles);
273
+ };
274
+ Leaflet.prototype.isCircleOnMap = function (circle) {
275
+ var _a;
276
+ return (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.isCircleOnMap(circle);
277
+ };
278
+ Leaflet.prototype.getCircleCenter = function (circle) {
279
+ var _a;
280
+ return (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.getCircleCenter(circle);
281
+ };
282
+ Leaflet.prototype.getCircleRadius = function (circle) {
283
+ var _a;
284
+ return (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.getCircleRadius(circle);
285
+ };
286
+ Leaflet.prototype.addCircleEvent = function (circles, eventType, eventFunction) {
287
+ var _a;
288
+ (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.addCircleEvent(circles, eventType, eventFunction);
289
+ };
290
+ Leaflet.prototype.removeCircleEvent = function (circles, event) {
291
+ var _a;
292
+ (_a = this.leafletCircles) === null || _a === void 0 ? void 0 : _a.removeCircleEvent(circles, event);
293
+ };
294
+ /* Polylines */
295
+ Leaflet.prototype.drawPolyline = function (options, eventClick) {
296
+ var _a;
297
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.drawPolyline(options, eventClick);
298
+ };
299
+ Leaflet.prototype.drawPolylineWithNavigation = function (options, eventClick) {
300
+ var _a;
301
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.drawPolylineWithNavigation(options, eventClick);
302
+ };
303
+ Leaflet.prototype.togglePolylines = function (polylines, show) {
304
+ var _a;
305
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.togglePolylines(polylines, show);
306
+ };
307
+ Leaflet.prototype.alterPolylineOptions = function (polylines, options) {
308
+ var _a;
309
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.alterPolylineOptions(polylines, options);
310
+ };
311
+ Leaflet.prototype.fitBoundsPolylines = function (polylines) {
312
+ var _a;
313
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.fitBoundsPolylines(polylines);
314
+ };
315
+ Leaflet.prototype.isPolylineOnMap = function (polyline) {
316
+ var _a;
317
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.isPolylineOnMap(polyline);
318
+ };
319
+ Leaflet.prototype.addPolylinePath = function (polylines, position) {
320
+ var _a;
321
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.addPolylinePath(polylines, position);
322
+ };
323
+ Leaflet.prototype.getPolylinePath = function (polyline) {
324
+ var _a;
325
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.getPolylinePath(polyline);
326
+ };
327
+ Leaflet.prototype.removePolylineHighlight = function () {
328
+ var _a;
329
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.removePolylineHighlight();
330
+ };
331
+ Leaflet.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {
332
+ var _a;
333
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.addPolylineEvent(polylines, eventType, eventFunction);
334
+ };
335
+ Leaflet.prototype.removePolylineEvent = function (polylines, event) {
336
+ var _a;
337
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.removePolylineEvent(polylines, event);
338
+ };
339
+ Leaflet.prototype.setIndexPolylineHighlight = function (polyline, index) {
340
+ var _a;
341
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.setIndexPolylineHighlight(polyline, index);
342
+ };
343
+ Leaflet.prototype.getObjectPolyline = function (polyline) {
344
+ var _a;
345
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.getObjectPolyline(polyline);
346
+ };
347
+ Leaflet.prototype.getObjectPolylineHighlight = function () {
348
+ var _a;
349
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.getObjectPolylineHighlight();
350
+ };
351
+ Leaflet.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {
352
+ var _a;
353
+ (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.addPolylineHighlightEvent(eventType, eventFunction);
354
+ };
355
+ Leaflet.prototype.getPolylineHighlightIndex = function () {
356
+ var _a;
357
+ return (_a = this.leafletPolylines) === null || _a === void 0 ? void 0 : _a.getPolylineHighlightIndex();
358
+ };
359
+ /* Popups */
360
+ Leaflet.prototype.drawPopup = function (options, marker) {
361
+ var _a;
362
+ return (_a = this.leafletPopups) === null || _a === void 0 ? void 0 : _a.drawPopup(options, marker);
363
+ };
364
+ Leaflet.prototype.alterPopup = function (popup, options, marker) {
365
+ var _a;
366
+ return (_a = this.leafletPopups) === null || _a === void 0 ? void 0 : _a.alterPopup(popup, options, marker);
367
+ };
368
+ Leaflet.prototype.alterPopupContent = function (popup, options, marker) {
369
+ var _a;
370
+ (_a = this.leafletPopups) === null || _a === void 0 ? void 0 : _a.alterPopupContent(popup, options, marker);
371
+ };
372
+ Leaflet.prototype.closePopup = function (popup) {
373
+ var _a;
374
+ (_a = this.leafletPopups) === null || _a === void 0 ? void 0 : _a.closePopup(popup);
375
+ };
376
+ /* Map */
377
+ Leaflet.prototype.resizeMap = function () {
378
+ var _a;
379
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.resizeMap();
380
+ };
381
+ Leaflet.prototype.addEventMap = function (eventType, eventFunction) {
382
+ var _a;
383
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.addEventMap(eventType, eventFunction);
384
+ };
385
+ Leaflet.prototype.removeEventMap = function (eventType) {
386
+ var _a;
387
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.removeEventMap(eventType);
388
+ };
389
+ Leaflet.prototype.getZoom = function () {
390
+ var _a;
391
+ return (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.getZoom();
392
+ };
393
+ Leaflet.prototype.setZoom = function (zoom) {
394
+ var _a;
395
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.setZoom(zoom);
396
+ };
397
+ Leaflet.prototype.takeMapScreenshot = function () {
398
+ return __awaiter(this, void 0, void 0, function () {
399
+ var image;
400
+ return __generator(this, function (_a) {
401
+ switch (_a.label) {
402
+ case 0: return [4 /*yield*/, this.leafletScreenshot.takeScreen("image")];
403
+ case 1:
404
+ image = _a.sent();
405
+ return [2 /*return*/, image];
406
+ }
407
+ });
408
+ });
409
+ };
410
+ Leaflet.prototype.getCenter = function () {
411
+ var _a;
412
+ return (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.getCenter();
413
+ };
414
+ Leaflet.prototype.setCenter = function (position) {
415
+ var _a;
416
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.setCenter(position);
417
+ };
418
+ Leaflet.prototype.pixelsToLatLng = function (offsetx, offsety) {
419
+ var _a;
420
+ return (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.pixelsToLatLng(offsetx, offsety);
421
+ };
422
+ Leaflet.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {
423
+ var _a;
424
+ (_a = this.leafletMap) === null || _a === void 0 ? void 0 : _a.fitBoundsElements(markers, circles, polygons, polylines);
425
+ };
426
+ /* Overlay */
427
+ Leaflet.prototype.drawOverlay = function (options, polygons) {
428
+ var _a;
429
+ return (_a = this.leafletOverlays) === null || _a === void 0 ? void 0 : _a.drawOverlay(options, polygons);
430
+ };
431
+ Leaflet.prototype.toggleOverlay = function (overlays, show) {
432
+ var _a;
433
+ (_a = this.leafletOverlays) === null || _a === void 0 ? void 0 : _a.toggleOverlay(overlays, show);
434
+ };
435
+ /* Private Methods */
436
+ Leaflet.prototype.mapTimeout = function (ms) {
437
+ return new Promise(function (resolve) { return setTimeout(resolve, ms); });
438
+ };
439
+ Leaflet.prototype.loadDependencies = function (params) {
440
+ var styles = params.cssDependencies;
441
+ if (styles && styles.length > 0) {
442
+ styles.forEach(function (path) {
443
+ var _a;
444
+ var link = document.createElement("link");
445
+ link.rel = "stylesheet";
446
+ link.href = path;
447
+ (_a = document === null || document === void 0 ? void 0 : document.querySelector("head")) === null || _a === void 0 ? void 0 : _a.appendChild(link);
448
+ });
449
+ }
450
+ var scripts = params.scriptsDependencies;
451
+ if (scripts && scripts.length > 0) {
452
+ scripts.forEach(function (path) {
453
+ var _a;
454
+ var script = document.createElement("script");
455
+ script.type = "text/javascript";
456
+ script.src = path;
457
+ (_a = document.querySelector("head")) === null || _a === void 0 ? void 0 : _a.appendChild(script);
458
+ });
459
+ }
460
+ };
461
+ return Leaflet;
462
+ }());
463
+ export default Leaflet;
359
464
  //# sourceMappingURL=leaflet.js.map