@inlog/inlog-maps 5.0.6 → 6.1.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 (243) 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/index.js +46 -46
  9. package/lib/index.js.map +1 -1
  10. package/lib/map.js +1136 -1010
  11. package/lib/map.js.map +1 -1
  12. package/lib/models/apis/google/google-circles.js +133 -130
  13. package/lib/models/apis/google/google-circles.js.map +1 -1
  14. package/lib/models/apis/google/google-geojson.js +72 -71
  15. package/lib/models/apis/google/google-geojson.js.map +1 -1
  16. package/lib/models/apis/google/google-map.js +173 -90
  17. package/lib/models/apis/google/google-map.js.map +1 -1
  18. package/lib/models/apis/google/google-markers.js +324 -290
  19. package/lib/models/apis/google/google-markers.js.map +1 -1
  20. package/lib/models/apis/google/google-overlay.js +101 -96
  21. package/lib/models/apis/google/google-overlay.js.map +1 -1
  22. package/lib/models/apis/google/google-polygons.js +300 -227
  23. package/lib/models/apis/google/google-polygons.js.map +1 -1
  24. package/lib/models/apis/google/google-polylines.js +706 -596
  25. package/lib/models/apis/google/google-polylines.js.map +1 -1
  26. package/lib/models/apis/google/google-popup.js +58 -60
  27. package/lib/models/apis/google/google-popup.js.map +1 -1
  28. package/lib/models/apis/googleMaps.js +448 -354
  29. package/lib/models/apis/googleMaps.js.map +1 -1
  30. package/lib/models/apis/leaflet/leaflet-circle.js +162 -134
  31. package/lib/models/apis/leaflet/leaflet-circle.js.map +1 -1
  32. package/lib/models/apis/leaflet/leaflet-geojson.js +72 -68
  33. package/lib/models/apis/leaflet/leaflet-geojson.js.map +1 -1
  34. package/lib/models/apis/leaflet/leaflet-map.js +139 -85
  35. package/lib/models/apis/leaflet/leaflet-map.js.map +1 -1
  36. package/lib/models/apis/leaflet/leaflet-markers.js +293 -259
  37. package/lib/models/apis/leaflet/leaflet-markers.js.map +1 -1
  38. package/lib/models/apis/leaflet/leaflet-overlay.js +34 -36
  39. package/lib/models/apis/leaflet/leaflet-overlay.js.map +1 -1
  40. package/lib/models/apis/leaflet/leaflet-polygons.js +210 -212
  41. package/lib/models/apis/leaflet/leaflet-polygons.js.map +1 -1
  42. package/lib/models/apis/leaflet/leaflet-polylines.js +705 -590
  43. package/lib/models/apis/leaflet/leaflet-polylines.js.map +1 -1
  44. package/lib/models/apis/leaflet/leaflet-popup.js +73 -75
  45. package/lib/models/apis/leaflet/leaflet-popup.js.map +1 -1
  46. package/lib/models/apis/leaflet.js +463 -360
  47. package/lib/models/apis/leaflet.js.map +1 -1
  48. package/lib/models/apis/mapFunctions.js +1 -2
  49. package/lib/models/dto/event-type.js +38 -40
  50. package/lib/models/dto/event-type.js.map +1 -1
  51. package/lib/models/dto/map-type.js +5 -7
  52. package/lib/models/dto/map-type.js.map +1 -1
  53. package/lib/models/dto/polyline-type.js +6 -8
  54. package/lib/models/dto/polyline-type.js.map +1 -1
  55. package/lib/models/features/circle/circle-alter-options.js +13 -15
  56. package/lib/models/features/circle/circle-alter-options.js.map +1 -1
  57. package/lib/models/features/circle/circle-options.js +18 -20
  58. package/lib/models/features/circle/circle-options.js.map +1 -1
  59. package/lib/models/features/events/event-return.js +7 -9
  60. package/lib/models/features/events/event-return.js.map +1 -1
  61. package/lib/models/features/geojson/geojson-options.js +8 -10
  62. package/lib/models/features/geojson/geojson-options.js.map +1 -1
  63. package/lib/models/features/marker/circle-marker-options.js +11 -13
  64. package/lib/models/features/marker/circle-marker-options.js.map +1 -1
  65. package/lib/models/features/marker/circle-marker-style.js +11 -13
  66. package/lib/models/features/marker/circle-marker-style.js.map +1 -1
  67. package/lib/models/features/marker/marker-alter-options.js +9 -11
  68. package/lib/models/features/marker/marker-alter-options.js.map +1 -1
  69. package/lib/models/features/marker/marker-icon.js +9 -11
  70. package/lib/models/features/marker/marker-icon.js.map +1 -1
  71. package/lib/models/features/marker/marker-options.js +17 -19
  72. package/lib/models/features/marker/marker-options.js.map +1 -1
  73. package/lib/models/features/marker-clusterer/marker-clusterer-config.js +9 -11
  74. package/lib/models/features/marker-clusterer/marker-clusterer-config.js.map +1 -1
  75. package/lib/models/features/overlay/overlay-options.js +14 -16
  76. package/lib/models/features/overlay/overlay-options.js.map +1 -1
  77. package/lib/models/features/polygons/polygon-alter-options.js +13 -14
  78. package/lib/models/features/polygons/polygon-alter-options.js.map +1 -1
  79. package/lib/models/features/polygons/polygon-options.js +18 -19
  80. package/lib/models/features/polygons/polygon-options.js.map +1 -1
  81. package/lib/models/features/polyline/navigations-options.js +15 -15
  82. package/lib/models/features/polyline/navigations-options.js.map +1 -1
  83. package/lib/models/features/polyline/polyline-options.js +19 -21
  84. package/lib/models/features/polyline/polyline-options.js.map +1 -1
  85. package/lib/models/features/popup/popup-options.js +12 -14
  86. package/lib/models/features/popup/popup-options.js.map +1 -1
  87. package/lib/utils/maps-api-loader.service.js +88 -77
  88. package/lib/utils/maps-api-loader.service.js.map +1 -1
  89. package/lib/utils/url-builder.js +43 -45
  90. package/lib/utils/url-builder.js.map +1 -1
  91. package/lib-esm/index.js +46 -45
  92. package/lib-esm/index.js.map +1 -1
  93. package/lib-esm/map.js +1136 -1008
  94. package/lib-esm/map.js.map +1 -1
  95. package/lib-esm/models/apis/google/google-circles.js +133 -128
  96. package/lib-esm/models/apis/google/google-circles.js.map +1 -1
  97. package/lib-esm/models/apis/google/google-geojson.js +72 -69
  98. package/lib-esm/models/apis/google/google-geojson.js.map +1 -1
  99. package/lib-esm/models/apis/google/google-map.js +173 -88
  100. package/lib-esm/models/apis/google/google-map.js.map +1 -1
  101. package/lib-esm/models/apis/google/google-markers.js +324 -288
  102. package/lib-esm/models/apis/google/google-markers.js.map +1 -1
  103. package/lib-esm/models/apis/google/google-overlay.js +101 -94
  104. package/lib-esm/models/apis/google/google-overlay.js.map +1 -1
  105. package/lib-esm/models/apis/google/google-polygons.js +300 -225
  106. package/lib-esm/models/apis/google/google-polygons.js.map +1 -1
  107. package/lib-esm/models/apis/google/google-polylines.js +706 -594
  108. package/lib-esm/models/apis/google/google-polylines.js.map +1 -1
  109. package/lib-esm/models/apis/google/google-popup.js +58 -58
  110. package/lib-esm/models/apis/google/google-popup.js.map +1 -1
  111. package/lib-esm/models/apis/googleMaps.js +448 -352
  112. package/lib-esm/models/apis/googleMaps.js.map +1 -1
  113. package/lib-esm/models/apis/leaflet/leaflet-circle.js +162 -132
  114. package/lib-esm/models/apis/leaflet/leaflet-circle.js.map +1 -1
  115. package/lib-esm/models/apis/leaflet/leaflet-geojson.js +72 -66
  116. package/lib-esm/models/apis/leaflet/leaflet-geojson.js.map +1 -1
  117. package/lib-esm/models/apis/leaflet/leaflet-map.js +139 -83
  118. package/lib-esm/models/apis/leaflet/leaflet-map.js.map +1 -1
  119. package/lib-esm/models/apis/leaflet/leaflet-markers.js +293 -257
  120. package/lib-esm/models/apis/leaflet/leaflet-markers.js.map +1 -1
  121. package/lib-esm/models/apis/leaflet/leaflet-overlay.js +34 -34
  122. package/lib-esm/models/apis/leaflet/leaflet-overlay.js.map +1 -1
  123. package/lib-esm/models/apis/leaflet/leaflet-polygons.js +210 -210
  124. package/lib-esm/models/apis/leaflet/leaflet-polygons.js.map +1 -1
  125. package/lib-esm/models/apis/leaflet/leaflet-polylines.js +705 -588
  126. package/lib-esm/models/apis/leaflet/leaflet-polylines.js.map +1 -1
  127. package/lib-esm/models/apis/leaflet/leaflet-popup.js +73 -73
  128. package/lib-esm/models/apis/leaflet/leaflet-popup.js.map +1 -1
  129. package/lib-esm/models/apis/leaflet.js +463 -358
  130. package/lib-esm/models/apis/leaflet.js.map +1 -1
  131. package/lib-esm/models/apis/mapFunctions.js +1 -0
  132. package/lib-esm/models/dto/event-type.js +38 -38
  133. package/lib-esm/models/dto/map-type.js +5 -5
  134. package/lib-esm/models/dto/polyline-type.js +6 -6
  135. package/lib-esm/models/features/circle/circle-alter-options.js +13 -13
  136. package/lib-esm/models/features/circle/circle-options.js +18 -18
  137. package/lib-esm/models/features/events/event-return.js +7 -7
  138. package/lib-esm/models/features/geojson/geojson-options.js +8 -8
  139. package/lib-esm/models/features/marker/circle-marker-options.js +11 -11
  140. package/lib-esm/models/features/marker/circle-marker-style.js +11 -11
  141. package/lib-esm/models/features/marker/marker-alter-options.js +9 -9
  142. package/lib-esm/models/features/marker/marker-icon.js +9 -9
  143. package/lib-esm/models/features/marker/marker-options.js +17 -17
  144. package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.js +9 -9
  145. package/lib-esm/models/features/overlay/overlay-options.js +14 -14
  146. package/lib-esm/models/features/polygons/polygon-alter-options.js +13 -12
  147. package/lib-esm/models/features/polygons/polygon-alter-options.js.map +1 -1
  148. package/lib-esm/models/features/polygons/polygon-options.js +18 -17
  149. package/lib-esm/models/features/polygons/polygon-options.js.map +1 -1
  150. package/lib-esm/models/features/polyline/navigations-options.js +15 -13
  151. package/lib-esm/models/features/polyline/navigations-options.js.map +1 -1
  152. package/lib-esm/models/features/polyline/polyline-options.js +19 -19
  153. package/lib-esm/models/features/polyline/polyline-options.js.map +1 -1
  154. package/lib-esm/models/features/popup/popup-options.js +12 -12
  155. package/lib-esm/utils/maps-api-loader.service.js +88 -75
  156. package/lib-esm/utils/maps-api-loader.service.js.map +1 -1
  157. package/lib-esm/utils/url-builder.js +43 -43
  158. package/lib-esm/utils/url-builder.js.map +1 -1
  159. package/package.json +67 -63
  160. package/lib/index.d.ts +0 -46
  161. package/lib/map.d.ts +0 -513
  162. package/lib/models/apis/google/google-circles.d.ts +0 -18
  163. package/lib/models/apis/google/google-geojson.d.ts +0 -9
  164. package/lib/models/apis/google/google-map.d.ts +0 -15
  165. package/lib/models/apis/google/google-markers.d.ts +0 -29
  166. package/lib/models/apis/google/google-overlay.d.ts +0 -11
  167. package/lib/models/apis/google/google-polygons.d.ts +0 -29
  168. package/lib/models/apis/google/google-polylines.d.ts +0 -55
  169. package/lib/models/apis/google/google-popup.d.ts +0 -10
  170. package/lib/models/apis/googleMaps.d.ts +0 -95
  171. package/lib/models/apis/leaflet/leaflet-circle.d.ts +0 -18
  172. package/lib/models/apis/leaflet/leaflet-geojson.d.ts +0 -9
  173. package/lib/models/apis/leaflet/leaflet-map.d.ts +0 -15
  174. package/lib/models/apis/leaflet/leaflet-markers.d.ts +0 -29
  175. package/lib/models/apis/leaflet/leaflet-overlay.d.ts +0 -10
  176. package/lib/models/apis/leaflet/leaflet-polygons.d.ts +0 -23
  177. package/lib/models/apis/leaflet/leaflet-polylines.d.ts +0 -54
  178. package/lib/models/apis/leaflet/leaflet-popup.d.ts +0 -11
  179. package/lib/models/apis/leaflet.d.ts +0 -97
  180. package/lib/models/apis/mapFunctions.d.ts +0 -84
  181. package/lib/models/dto/event-type.d.ts +0 -33
  182. package/lib/models/dto/map-type.d.ts +0 -4
  183. package/lib/models/dto/polyline-type.d.ts +0 -5
  184. package/lib/models/features/circle/circle-alter-options.d.ts +0 -12
  185. package/lib/models/features/circle/circle-options.d.ts +0 -15
  186. package/lib/models/features/events/event-return.d.ts +0 -4
  187. package/lib/models/features/geojson/geojson-options.d.ts +0 -5
  188. package/lib/models/features/marker/circle-marker-options.d.ts +0 -9
  189. package/lib/models/features/marker/circle-marker-style.d.ts +0 -8
  190. package/lib/models/features/marker/marker-alter-options.d.ts +0 -8
  191. package/lib/models/features/marker/marker-icon.d.ts +0 -6
  192. package/lib/models/features/marker/marker-options.d.ts +0 -11
  193. package/lib/models/features/marker-clusterer/marker-clusterer-config.d.ts +0 -6
  194. package/lib/models/features/overlay/overlay-options.d.ts +0 -11
  195. package/lib/models/features/polygons/polygon-alter-options.d.ts +0 -13
  196. package/lib/models/features/polygons/polygon-options.d.ts +0 -15
  197. package/lib/models/features/polyline/navigations-options.d.ts +0 -11
  198. package/lib/models/features/polyline/polyline-options.d.ts +0 -18
  199. package/lib/models/features/popup/popup-options.d.ts +0 -9
  200. package/lib/utils/maps-api-loader.service.d.ts +0 -9
  201. package/lib/utils/url-builder.d.ts +0 -11
  202. package/lib-esm/index.d.ts +0 -46
  203. package/lib-esm/map.d.ts +0 -513
  204. package/lib-esm/models/apis/google/google-circles.d.ts +0 -18
  205. package/lib-esm/models/apis/google/google-geojson.d.ts +0 -9
  206. package/lib-esm/models/apis/google/google-map.d.ts +0 -15
  207. package/lib-esm/models/apis/google/google-markers.d.ts +0 -29
  208. package/lib-esm/models/apis/google/google-overlay.d.ts +0 -11
  209. package/lib-esm/models/apis/google/google-polygons.d.ts +0 -29
  210. package/lib-esm/models/apis/google/google-polylines.d.ts +0 -55
  211. package/lib-esm/models/apis/google/google-popup.d.ts +0 -10
  212. package/lib-esm/models/apis/googleMaps.d.ts +0 -95
  213. package/lib-esm/models/apis/leaflet/leaflet-circle.d.ts +0 -18
  214. package/lib-esm/models/apis/leaflet/leaflet-geojson.d.ts +0 -9
  215. package/lib-esm/models/apis/leaflet/leaflet-map.d.ts +0 -15
  216. package/lib-esm/models/apis/leaflet/leaflet-markers.d.ts +0 -29
  217. package/lib-esm/models/apis/leaflet/leaflet-overlay.d.ts +0 -10
  218. package/lib-esm/models/apis/leaflet/leaflet-polygons.d.ts +0 -23
  219. package/lib-esm/models/apis/leaflet/leaflet-polylines.d.ts +0 -54
  220. package/lib-esm/models/apis/leaflet/leaflet-popup.d.ts +0 -11
  221. package/lib-esm/models/apis/leaflet.d.ts +0 -97
  222. package/lib-esm/models/apis/mapFunctions.d.ts +0 -84
  223. package/lib-esm/models/dto/event-type.d.ts +0 -33
  224. package/lib-esm/models/dto/map-type.d.ts +0 -4
  225. package/lib-esm/models/dto/polyline-type.d.ts +0 -5
  226. package/lib-esm/models/features/circle/circle-alter-options.d.ts +0 -12
  227. package/lib-esm/models/features/circle/circle-options.d.ts +0 -15
  228. package/lib-esm/models/features/events/event-return.d.ts +0 -4
  229. package/lib-esm/models/features/geojson/geojson-options.d.ts +0 -5
  230. package/lib-esm/models/features/marker/circle-marker-options.d.ts +0 -9
  231. package/lib-esm/models/features/marker/circle-marker-style.d.ts +0 -8
  232. package/lib-esm/models/features/marker/marker-alter-options.d.ts +0 -8
  233. package/lib-esm/models/features/marker/marker-icon.d.ts +0 -6
  234. package/lib-esm/models/features/marker/marker-options.d.ts +0 -11
  235. package/lib-esm/models/features/marker-clusterer/marker-clusterer-config.d.ts +0 -6
  236. package/lib-esm/models/features/overlay/overlay-options.d.ts +0 -11
  237. package/lib-esm/models/features/polygons/polygon-alter-options.d.ts +0 -13
  238. package/lib-esm/models/features/polygons/polygon-options.d.ts +0 -15
  239. package/lib-esm/models/features/polyline/navigations-options.d.ts +0 -11
  240. package/lib-esm/models/features/polyline/polyline-options.d.ts +0 -18
  241. package/lib-esm/models/features/popup/popup-options.d.ts +0 -9
  242. package/lib-esm/utils/maps-api-loader.service.d.ts +0 -9
  243. package/lib-esm/utils/url-builder.d.ts +0 -11
@@ -1,361 +1,464 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
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) : new P(function (resolve) { resolve(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 (_) 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
- Object.defineProperty(exports, "__esModule", { value: true });
38
- var maps_api_loader_service_1 = require("../../utils/maps-api-loader.service");
39
- var leaflet_circle_1 = require("./leaflet/leaflet-circle");
40
- var leaflet_geojson_1 = require("./leaflet/leaflet-geojson");
41
- var leaflet_map_1 = require("./leaflet/leaflet-map");
42
- var leaflet_markers_1 = require("./leaflet/leaflet-markers");
43
- var leaflet_overlay_1 = require("./leaflet/leaflet-overlay");
44
- var leaflet_polygons_1 = require("./leaflet/leaflet-polygons");
45
- var leaflet_polylines_1 = require("./leaflet/leaflet-polylines");
46
- var leaflet_popup_1 = require("./leaflet/leaflet-popup");
47
- var Leaflet = /** @class */ (function () {
48
- function Leaflet() {
49
- this.mapsApiLoader = new maps_api_loader_service_1.MapsApiLoaderService();
50
- }
51
- Leaflet.prototype.initialize = function (mapType, params, elementId) {
52
- return __awaiter(this, void 0, void 0, function () {
53
- var api, leaflet_1, mapOptions, osm, wikimedia, satelliteURL, satellite, map, baseLayers_1, err_1;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- _a.trys.push([0, 4, , 5]);
58
- return [4 /*yield*/, this.mapsApiLoader.loadApi(mapType, params)];
59
- case 1:
60
- api = _a.sent();
61
- leaflet_1 = api;
62
- this.loadDependencies(params);
63
- return [4 /*yield*/, this.mapTimeout(1000)];
64
- case 2:
65
- _a.sent();
66
- mapOptions = {
67
- center: new leaflet_1.LatLng(-14, -54),
68
- editable: true,
69
- keyboard: false,
70
- maxZoom: params.wikimedia ? 18 : 19,
71
- minZoom: 4,
72
- zoom: 4,
73
- zoomControl: false
74
- };
75
- if (params.gestureHandling) {
76
- mapOptions.gestureHandling = true;
77
- }
78
- return [4 /*yield*/, this.mapTimeout(200)];
79
- case 3:
80
- _a.sent();
81
- osm = new leaflet_1.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', mapOptions);
82
- wikimedia = new leaflet_1.tileLayer('https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {
83
- attribution: '<a href="https://wikimediafoundation.org/wiki/Maps_Terms_of_Use">Wikimedia</a>'
84
- });
85
- satelliteURL = 'https://server.arcgisonline.com/ArcGIS/rest/services/' +
86
- 'World_Imagery/MapServer/tile/{z}/{y}/{x}';
87
- satellite = L.tileLayer(satelliteURL, {
88
- attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye,' +
89
- ' Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
90
- maxZoom: 18
91
- });
92
- mapOptions.layers = [params.wikimedia ? wikimedia : osm];
93
- map = new leaflet_1.Map(elementId, mapOptions);
94
- baseLayers_1 = {
95
- Map: params.wikimedia ? wikimedia : osm,
96
- Satellite: satellite
97
- };
98
- if (params.mapTiles && params.mapTiles.length) {
99
- params.mapTiles.forEach(function (tile) {
100
- var layer = new leaflet_1.tileLayer(tile.url, tile.options);
101
- baseLayers_1[tile.name] = layer;
102
- });
103
- }
104
- leaflet_1.control.layers(baseLayers_1, null, { position: 'topleft' }).addTo(map);
105
- leaflet_1.control.zoom({ position: 'bottomright' }).addTo(map);
106
- this.leafletMarkers = new leaflet_markers_1.default(map, leaflet_1);
107
- this.leafletPolygons = new leaflet_polygons_1.default(map, leaflet_1);
108
- this.leafletCircles = new leaflet_circle_1.default(map, leaflet_1);
109
- this.leafletPopups = new leaflet_popup_1.default(map, leaflet_1);
110
- this.leafletPolylines = new leaflet_polylines_1.default(map, leaflet_1, this.leafletPopups);
111
- this.leafletMap = new leaflet_map_1.default(map, leaflet_1);
112
- this.leafletOverlays = new leaflet_overlay_1.default(map, leaflet_1, this.leafletPolygons);
113
- this.leafletGeoJson = new leaflet_geojson_1.default(map, leaflet_1);
114
- return [2 /*return*/, this];
115
- case 4:
116
- err_1 = _a.sent();
117
- console.error(err_1);
118
- return [2 /*return*/, err_1];
119
- case 5: return [2 /*return*/];
120
- }
121
- });
122
- });
123
- };
124
- /* GEOJson */
125
- Leaflet.prototype.loadGEOJson = function (data, options, eventClick) {
126
- this.leafletGeoJson.loadGEOJson(data, options, eventClick);
127
- };
128
- /* Markers */
129
- Leaflet.prototype.drawMarker = function (options, eventClick) {
130
- return this.leafletMarkers.drawMarker(options, eventClick);
131
- };
132
- Leaflet.prototype.drawCircleMarker = function (options, eventClick) {
133
- return this.leafletMarkers.drawCircleMarker(options, eventClick);
134
- };
135
- Leaflet.prototype.toggleMarkers = function (markers, show, markerClusterer) {
136
- this.leafletMarkers.toggleMarkers(markers, show, markerClusterer);
137
- };
138
- Leaflet.prototype.alterMarkerOptions = function (markers, options) {
139
- this.leafletMarkers.alterMarkerOptions(markers, options);
140
- };
141
- Leaflet.prototype.alterMarkerPosition = function (markers, position, addTransition) {
142
- this.leafletMarkers.alterMarkerPosition(markers, position, addTransition);
143
- };
144
- Leaflet.prototype.fitBoundsPositions = function (markers) {
145
- this.leafletMarkers.fitBoundsPositions(markers);
146
- };
147
- Leaflet.prototype.isMarkerOnMap = function (marker) {
148
- return this.leafletMarkers.isMarkerOnMap(marker);
149
- };
150
- Leaflet.prototype.setCenterMarker = function (marker) {
151
- this.leafletMarkers.setCenterMarker(marker);
152
- };
153
- Leaflet.prototype.addMarkerEvent = function (markers, eventType, eventFunction) {
154
- this.leafletMarkers.addMarkerEvent(markers, eventType, eventFunction);
155
- };
156
- Leaflet.prototype.removeMarkerEvent = function (markers, event) {
157
- this.leafletMarkers.removeMarkerEvent(markers, event);
158
- };
159
- /* Marker Clusterer */
160
- Leaflet.prototype.addMarkerClusterer = function (config) {
161
- return this.leafletMarkers.addMarkerClusterer(config);
162
- };
163
- Leaflet.prototype.alterMarkerClustererConfig = function (markerClusterer, config) {
164
- this.leafletMarkers.alterMarkerClustererConfig(markerClusterer, config);
165
- };
166
- Leaflet.prototype.refreshClusterer = function (markerClusterer) {
167
- this.leafletMarkers.refreshClusterer(markerClusterer);
168
- };
169
- Leaflet.prototype.addMarkerOnClusterer = function (marker, markerClusterer) {
170
- this.leafletMarkers.addMarkerOnClusterer(marker, markerClusterer);
171
- };
172
- Leaflet.prototype.removeMarkerFromClusterer = function (marker, markerClusterer) {
173
- this.leafletMarkers.removeMarkerFromClusterer(marker, markerClusterer);
174
- };
175
- Leaflet.prototype.clearMarkersClusterer = function (markerClusterer) {
176
- this.leafletMarkers.clearMarkersClusterer(markerClusterer);
177
- };
178
- Leaflet.prototype.countMarkersOnCluster = function (markerClusterer) {
179
- return this.leafletMarkers.countMarkersOnCluster(markerClusterer);
180
- };
181
- /* Polygons */
182
- Leaflet.prototype.drawPolygon = function (options, eventClick) {
183
- return this.leafletPolygons.drawPolygon(options, eventClick);
184
- };
185
- Leaflet.prototype.togglePolygons = function (polygons, show) {
186
- this.leafletPolygons.togglePolygons(polygons, show);
187
- };
188
- Leaflet.prototype.alterPolygonOptions = function (polygons, options) {
189
- this.leafletPolygons.alterPolygonOptions(polygons, options);
190
- };
191
- Leaflet.prototype.fitBoundsPolygons = function (polygons) {
192
- this.leafletPolygons.fitBoundsPolygons(polygons);
193
- };
194
- Leaflet.prototype.setCenterPolygons = function (polygons) {
195
- this.leafletPolygons.setCenterPolygons(polygons);
196
- };
197
- Leaflet.prototype.isPolygonOnMap = function (polygon) {
198
- return this.leafletPolygons.isPolygonOnMap(polygon);
199
- };
200
- Leaflet.prototype.getPolygonPath = function (polygon) {
201
- return this.leafletPolygons.getPolygonPath(polygon);
202
- };
203
- Leaflet.prototype.addPolygonEvent = function (polygons, eventType, eventFunction) {
204
- this.leafletPolygons.addPolygonEvent(polygons, eventType, eventFunction);
205
- };
206
- Leaflet.prototype.removePolygonEvent = function (polygons, event) {
207
- this.leafletPolygons.removePolygonEvent(polygons, event);
208
- };
209
- /* Circles */
210
- Leaflet.prototype.drawCircle = function (options, eventClick) {
211
- return this.leafletCircles.drawCircle(options, eventClick);
212
- };
213
- Leaflet.prototype.toggleCircles = function (circles, show) {
214
- this.leafletCircles.toggleCircles(circles, show);
215
- };
216
- Leaflet.prototype.alterCircleOptions = function (circles, options) {
217
- this.leafletCircles.alterCircleOptions(circles, options);
218
- };
219
- Leaflet.prototype.fitBoundsCircles = function (circles) {
220
- this.leafletCircles.fitBoundsCircles(circles);
221
- };
222
- Leaflet.prototype.isCircleOnMap = function (circle) {
223
- return this.leafletCircles.isCircleOnMap(circle);
224
- };
225
- Leaflet.prototype.getCircleCenter = function (circle) {
226
- return this.leafletCircles.getCircleCenter(circle);
227
- };
228
- Leaflet.prototype.getCircleRadius = function (circle) {
229
- return this.leafletCircles.getCircleRadius(circle);
230
- };
231
- Leaflet.prototype.addCircleEvent = function (circles, eventType, eventFunction) {
232
- this.leafletCircles.addCircleEvent(circles, eventType, eventFunction);
233
- };
234
- Leaflet.prototype.removeCircleEvent = function (circles, event) {
235
- this.leafletCircles.removeCircleEvent(circles, event);
236
- };
237
- /* Polylines */
238
- Leaflet.prototype.drawPolyline = function (options, eventClick) {
239
- return this.leafletPolylines.drawPolyline(options, eventClick);
240
- };
241
- Leaflet.prototype.drawPolylineWithNavigation = function (options, eventClick) {
242
- return this.leafletPolylines.drawPolylineWithNavigation(options, eventClick);
243
- };
244
- Leaflet.prototype.togglePolylines = function (polylines, show) {
245
- this.leafletPolylines.togglePolylines(polylines, show);
246
- };
247
- Leaflet.prototype.alterPolylineOptions = function (polylines, options) {
248
- this.leafletPolylines.alterPolylineOptions(polylines, options);
249
- };
250
- Leaflet.prototype.fitBoundsPolylines = function (polylines) {
251
- this.leafletPolylines.fitBoundsPolylines(polylines);
252
- };
253
- Leaflet.prototype.isPolylineOnMap = function (polyline) {
254
- return this.leafletPolylines.isPolylineOnMap(polyline);
255
- };
256
- Leaflet.prototype.addPolylinePath = function (polylines, position) {
257
- this.leafletPolylines.addPolylinePath(polylines, position);
258
- };
259
- Leaflet.prototype.getPolylinePath = function (polyline) {
260
- return this.leafletPolylines.getPolylinePath(polyline);
261
- };
262
- Leaflet.prototype.removePolylineHighlight = function () {
263
- this.leafletPolylines.removePolylineHighlight();
264
- };
265
- Leaflet.prototype.addPolylineEvent = function (polylines, eventType, eventFunction) {
266
- this.leafletPolylines.addPolylineEvent(polylines, eventType, eventFunction);
267
- };
268
- Leaflet.prototype.removePolylineEvent = function (polylines, event) {
269
- this.leafletPolylines.removePolylineEvent(polylines, event);
270
- };
271
- Leaflet.prototype.setIndexPolylineHighlight = function (polyline, index) {
272
- this.leafletPolylines.setIndexPolylineHighlight(polyline, index);
273
- };
274
- Leaflet.prototype.getObjectPolyline = function (polyline) {
275
- return this.leafletPolylines.getObjectPolyline(polyline);
276
- };
277
- Leaflet.prototype.getObjectPolylineHighlight = function () {
278
- return this.leafletPolylines.getObjectPolylineHighlight();
279
- };
280
- Leaflet.prototype.addPolylineHighlightEvent = function (eventType, eventFunction) {
281
- this.leafletPolylines.addPolylineHighlightEvent(eventType, eventFunction);
282
- };
283
- Leaflet.prototype.getPolylineHighlightIndex = function () {
284
- return this.leafletPolylines.getPolylineHighlightIndex();
285
- };
286
- /* Popups */
287
- Leaflet.prototype.drawPopup = function (options, marker) {
288
- return this.leafletPopups.drawPopup(options, marker);
289
- };
290
- Leaflet.prototype.alterPopup = function (popup, options, marker) {
291
- return this.leafletPopups.alterPopup(popup, options, marker);
292
- };
293
- Leaflet.prototype.alterPopupContent = function (popup, options, marker) {
294
- this.leafletPopups.alterPopupContent(popup, options, marker);
295
- };
296
- Leaflet.prototype.closePopup = function (popup) {
297
- this.leafletPopups.closePopup(popup);
298
- };
299
- /* Map */
300
- Leaflet.prototype.resizeMap = function () {
301
- this.leafletMap.resizeMap();
302
- };
303
- Leaflet.prototype.addEventMap = function (eventType, eventFunction) {
304
- this.leafletMap.addEventMap(eventType, eventFunction);
305
- };
306
- Leaflet.prototype.removeEventMap = function (eventType) {
307
- this.leafletMap.removeEventMap(eventType);
308
- };
309
- Leaflet.prototype.getZoom = function () {
310
- return this.leafletMap.getZoom();
311
- };
312
- Leaflet.prototype.setZoom = function (zoom) {
313
- this.leafletMap.setZoom(zoom);
314
- };
315
- Leaflet.prototype.getCenter = function () {
316
- return this.leafletMap.getCenter();
317
- };
318
- Leaflet.prototype.setCenter = function (position) {
319
- this.leafletMap.setCenter(position);
320
- };
321
- Leaflet.prototype.pixelsToLatLng = function (offsetx, offsety) {
322
- return this.leafletMap.pixelsToLatLng(offsetx, offsety);
323
- };
324
- Leaflet.prototype.fitBoundsElements = function (markers, circles, polygons, polylines) {
325
- this.leafletMap.fitBoundsElements(markers, circles, polygons, polylines);
326
- };
327
- /* Overlay */
328
- Leaflet.prototype.drawOverlay = function (options, polygons) {
329
- return this.leafletOverlays.drawOverlay(options, polygons);
330
- };
331
- Leaflet.prototype.toggleOverlay = function (overlays, show) {
332
- this.leafletOverlays.toggleOverlay(overlays, show);
333
- };
334
- /* Private Methods */
335
- Leaflet.prototype.mapTimeout = function (ms) {
336
- return new Promise(function (resolve) { return setTimeout(resolve, ms); });
337
- };
338
- Leaflet.prototype.loadDependencies = function (params) {
339
- var styles = params.cssDependencies;
340
- if (styles && styles.length > 0) {
341
- styles.forEach(function (path) {
342
- var link = document.createElement('link');
343
- link.rel = 'stylesheet';
344
- link.href = path;
345
- document.querySelector('head').appendChild(link);
346
- });
347
- }
348
- var scripts = params.scriptsDependencies;
349
- if (scripts && scripts.length > 0) {
350
- scripts.forEach(function (path) {
351
- var script = document.createElement('script');
352
- script.type = 'text/javascript';
353
- script.src = path;
354
- document.querySelector('head').appendChild(script);
355
- });
356
- }
357
- };
358
- return Leaflet;
359
- }());
360
- exports.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;
361
464
  //# sourceMappingURL=leaflet.js.map