@artstesh/maps 1.1.26 → 1.1.27

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 (51) hide show
  1. package/dist/bundles/maps-components-src-map.umd.js +333 -15
  2. package/dist/bundles/maps-components-src-map.umd.js.map +1 -1
  3. package/dist/bundles/maps-components.umd.js +333 -15
  4. package/dist/bundles/maps-components.umd.js.map +1 -1
  5. package/dist/esm2015/map/map-plate/layers/index.js +3 -1
  6. package/dist/esm2015/map/map-plate/layers/raster-tile/raster-tile-layer.component.js +54 -0
  7. package/dist/esm2015/map/map-plate/layers/raster-tile/raster-tile-layer.factory.js +74 -0
  8. package/dist/esm2015/map/map-plate/layers/raster-tile/raster-tile-layer.settings.js +151 -0
  9. package/dist/esm2015/map/map.module.js +8 -3
  10. package/dist/esm2015/map/messages/commands/add-raster-tile-command.js +9 -0
  11. package/dist/esm2015/map/messages/commands/remove-raster-tile.command.js +9 -0
  12. package/dist/esm2015/map/ol-proxy.js +3 -0
  13. package/dist/esm2015/map/public-api.js +2 -2
  14. package/dist/esm2015/map/services/map-management.service.js +18 -9
  15. package/dist/esm2015/map/services/message-registrator.service.js +5 -1
  16. package/dist/esm2015/src/map/map-plate/layers/index.js +3 -1
  17. package/dist/esm2015/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.js +54 -0
  18. package/dist/esm2015/src/map/map-plate/layers/raster-tile/raster-tile-layer.factory.js +74 -0
  19. package/dist/esm2015/src/map/map-plate/layers/raster-tile/raster-tile-layer.settings.js +151 -0
  20. package/dist/esm2015/src/map/map.module.js +8 -3
  21. package/dist/esm2015/src/map/messages/commands/add-raster-tile-command.js +9 -0
  22. package/dist/esm2015/src/map/messages/commands/remove-raster-tile.command.js +9 -0
  23. package/dist/esm2015/src/map/ol-proxy.js +3 -0
  24. package/dist/esm2015/src/map/public-api.js +2 -2
  25. package/dist/esm2015/src/map/services/map-management.service.js +18 -9
  26. package/dist/esm2015/src/map/services/message-registrator.service.js +5 -1
  27. package/dist/fesm2015/maps-components-src-map.js +305 -11
  28. package/dist/fesm2015/maps-components-src-map.js.map +1 -1
  29. package/dist/fesm2015/maps-components.js +305 -11
  30. package/dist/fesm2015/maps-components.js.map +1 -1
  31. package/dist/map/map-plate/layers/index.d.ts +2 -0
  32. package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +21 -0
  33. package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.factory.d.ts +12 -0
  34. package/dist/map/map-plate/layers/raster-tile/raster-tile-layer.settings.d.ts +108 -0
  35. package/dist/map/map.module.d.ts +3 -2
  36. package/dist/map/messages/commands/add-raster-tile-command.d.ts +8 -0
  37. package/dist/map/messages/commands/remove-raster-tile.command.d.ts +8 -0
  38. package/dist/map/ol-proxy.d.ts +3 -0
  39. package/dist/map/public-api.d.ts +1 -1
  40. package/dist/map/services/map-management.service.d.ts +0 -1
  41. package/dist/src/map/map-plate/layers/index.d.ts +2 -0
  42. package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.component.d.ts +21 -0
  43. package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.factory.d.ts +12 -0
  44. package/dist/src/map/map-plate/layers/raster-tile/raster-tile-layer.settings.d.ts +108 -0
  45. package/dist/src/map/map.module.d.ts +3 -2
  46. package/dist/src/map/messages/commands/add-raster-tile-command.d.ts +8 -0
  47. package/dist/src/map/messages/commands/remove-raster-tile.command.d.ts +8 -0
  48. package/dist/src/map/ol-proxy.d.ts +3 -0
  49. package/dist/src/map/public-api.d.ts +1 -1
  50. package/dist/src/map/services/map-management.service.d.ts +0 -1
  51. package/package.json +2 -2
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/geom/Polygon'), require('ol/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('rxjs'), require('rxjs/operators'), require('@artstesh/collections'), require('ol/source'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/source/Cluster'), require('ol/source/ImageStatic'), require('ol/layer/Image'), require('ol/Map'), require('ol/View'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style'), require('ol/proj/epsg4326')) :
3
- typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/geom/Polygon', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', 'rxjs', 'rxjs/operators', '@artstesh/collections', 'ol/source', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/source/Cluster', 'ol/source/ImageStatic', 'ol/layer/Image', 'ol/Map', 'ol/View', 'ol/Overlay', 'ol/style/Style', 'ol/style', 'ol/proj/epsg4326'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.Polygon, global.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.rxjs, global.rxjs.operators, global.collections, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Cluster, global.Static, global.ImageLayer, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
5
- })(this, (function (exports, i0, i6, ol, geom, format, extent, Polygon, control, proj, postboy, interaction, Draw, Sphere, rxjs, operators, collections, source, TileLayer, OSM, layer, loadingstrategy, Cluster, Static, ImageLayer, Map, View, Overlay, Style, style, epsg4326) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('ol'), require('ol/geom'), require('ol/format'), require('ol/extent'), require('ol/geom/Polygon'), require('ol/control'), require('ol/proj'), require('@artstesh/postboy'), require('ol/interaction'), require('ol/interaction/Draw'), require('ol/sphere'), require('rxjs'), require('rxjs/operators'), require('@artstesh/collections'), require('ol/source'), require('ol/layer/Tile'), require('ol/source/OSM'), require('ol/layer'), require('ol/loadingstrategy'), require('ol/source/Cluster'), require('ol/source/ImageStatic'), require('ol/layer/Image'), require('ol/source/Raster'), require('ol/Map'), require('ol/View'), require('ol/Overlay'), require('ol/style/Style'), require('ol/style'), require('ol/proj/epsg4326')) :
3
+ typeof define === 'function' && define.amd ? define('maps-components/src/map', ['exports', '@angular/core', '@angular/common', 'ol', 'ol/geom', 'ol/format', 'ol/extent', 'ol/geom/Polygon', 'ol/control', 'ol/proj', '@artstesh/postboy', 'ol/interaction', 'ol/interaction/Draw', 'ol/sphere', 'rxjs', 'rxjs/operators', '@artstesh/collections', 'ol/source', 'ol/layer/Tile', 'ol/source/OSM', 'ol/layer', 'ol/loadingstrategy', 'ol/source/Cluster', 'ol/source/ImageStatic', 'ol/layer/Image', 'ol/source/Raster', 'ol/Map', 'ol/View', 'ol/Overlay', 'ol/style/Style', 'ol/style', 'ol/proj/epsg4326'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["maps-components"] = global["maps-components"] || {}, global["maps-components"].src = global["maps-components"].src || {}, global["maps-components"].src.map = {}), global.ng.core, global.ng.common, global.ol, global.geom, global.format, global.extent, global.Polygon, global.control, global.proj, global.postboy, global.interaction, global.Draw, global.Sphere, global.rxjs, global.rxjs.operators, global.collections, global.source, global.TileLayer, global.OSM, global.layer, global.loadingstrategy, global.Cluster, global.Static, global.ImageLayer, global.RasterSource, global.Map, global.View, global.Overlay, global.Style, global.style, global.epsg4326));
5
+ })(this, (function (exports, i0, i6, ol, geom, format, extent, Polygon, control, proj, postboy, interaction, Draw, Sphere, rxjs, operators, collections, source, TileLayer, OSM, layer, loadingstrategy, Cluster, Static, ImageLayer, RasterSource, Map, View, Overlay, Style, style, epsg4326) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -33,6 +33,7 @@
33
33
  var Cluster__default = /*#__PURE__*/_interopDefaultLegacy(Cluster);
34
34
  var Static__default = /*#__PURE__*/_interopDefaultLegacy(Static);
35
35
  var ImageLayer__default = /*#__PURE__*/_interopDefaultLegacy(ImageLayer);
36
+ var RasterSource__default = /*#__PURE__*/_interopDefaultLegacy(RasterSource);
36
37
  var Map__default = /*#__PURE__*/_interopDefaultLegacy(Map);
37
38
  var View__default = /*#__PURE__*/_interopDefaultLegacy(View);
38
39
  var Overlay__default = /*#__PURE__*/_interopDefaultLegacy(Overlay);
@@ -1504,6 +1505,28 @@
1504
1505
  }(postboy.PostboyGenericMessage));
1505
1506
  RemoveImageLayerCommand.ID = 'c8e7efdb-17ff-4cf9-89be-e688b8de3b95';
1506
1507
 
1508
+ var AddRasterTileCommand = /** @class */ (function (_super) {
1509
+ __extends(AddRasterTileCommand, _super);
1510
+ function AddRasterTileCommand(layer) {
1511
+ var _this = _super.call(this) || this;
1512
+ _this.layer = layer;
1513
+ return _this;
1514
+ }
1515
+ return AddRasterTileCommand;
1516
+ }(postboy.PostboyGenericMessage));
1517
+ AddRasterTileCommand.ID = 'd33447fe-eec0-4205-9b5d-0d79ddc74ad7';
1518
+
1519
+ var RemoveRasterTileCommand = /** @class */ (function (_super) {
1520
+ __extends(RemoveRasterTileCommand, _super);
1521
+ function RemoveRasterTileCommand(layer) {
1522
+ var _this = _super.call(this) || this;
1523
+ _this.layer = layer;
1524
+ return _this;
1525
+ }
1526
+ return RemoveRasterTileCommand;
1527
+ }(postboy.PostboyGenericMessage));
1528
+ RemoveRasterTileCommand.ID = 'd1c4bf6a-e2f2-4385-a7a2-cecb525f8939';
1529
+
1507
1530
  var MapPostboyService = /** @class */ (function (_super) {
1508
1531
  __extends(MapPostboyService, _super);
1509
1532
  function MapPostboyService() {
@@ -1534,20 +1557,11 @@
1534
1557
  this.observeRemoveLayer();
1535
1558
  this.observePlaceFeatures();
1536
1559
  this.observeAddTile();
1537
- this.observeRemoveTile();
1538
1560
  this.observeLayerQuery();
1539
1561
  this.observeFeaturesInArea();
1540
1562
  this.observeFeaturesInPoint();
1541
1563
  this.observeImageLayer();
1542
1564
  };
1543
- MapManagementService.prototype.observeRemoveTile = function () {
1544
- var _this = this;
1545
- this.postboy.sub(RemoveTileCommand).subscribe(function (c) {
1546
- if (!_this.map)
1547
- return;
1548
- _this.map.removeLayer(c.layer);
1549
- });
1550
- };
1551
1565
  MapManagementService.prototype.observeLayerQuery = function () {
1552
1566
  var _this = this;
1553
1567
  this.postboy.sub(GetLayerQuery).subscribe(function (ev) { return ev.finish(_this.layers.take(ev.name)); });
@@ -1559,6 +1573,21 @@
1559
1573
  return;
1560
1574
  _this.map.addLayer(c.layer);
1561
1575
  });
1576
+ this.postboy.sub(RemoveTileCommand).subscribe(function (c) {
1577
+ if (!_this.map)
1578
+ return;
1579
+ _this.map.removeLayer(c.layer);
1580
+ });
1581
+ this.postboy.sub(AddRasterTileCommand).subscribe(function (c) {
1582
+ if (!_this.map)
1583
+ return;
1584
+ _this.map.addLayer(c.layer);
1585
+ });
1586
+ this.postboy.sub(RemoveRasterTileCommand).subscribe(function (c) {
1587
+ if (!_this.map)
1588
+ return;
1589
+ _this.map.removeLayer(c.layer);
1590
+ });
1562
1591
  };
1563
1592
  MapManagementService.prototype.observeImageLayer = function () {
1564
1593
  var _this = this;
@@ -2054,6 +2083,8 @@
2054
2083
  this.recordSubject(AddLayerCommand);
2055
2084
  this.recordSubject(RemoveLayerCommand);
2056
2085
  this.recordSubject(AddTileCommand);
2086
+ this.recordSubject(AddRasterTileCommand);
2087
+ this.recordSubject(RemoveRasterTileCommand);
2057
2088
  this.recordSubject(RemoveImageLayerCommand);
2058
2089
  this.recordSubject(AddImageLayerCommand);
2059
2090
  this.recordSubject(RemoveTileCommand);
@@ -3135,6 +3166,283 @@
3135
3166
  type: i0.Input
3136
3167
  }] } });
3137
3168
 
3169
+ var RasterTileLayerSettings = /** @class */ (function () {
3170
+ function RasterTileLayerSettings() {
3171
+ /**
3172
+ * The maximum zoom level for a map view.
3173
+ *
3174
+ * @type {number}
3175
+ * @default 19
3176
+ */
3177
+ this.maxZoom = 19;
3178
+ /**
3179
+ * The minimum zoom level allowed.
3180
+ *
3181
+ * @type {number}
3182
+ */
3183
+ this.minZoom = 0;
3184
+ /**
3185
+ * The opacity of an element.
3186
+ *
3187
+ * @type {number}
3188
+ * @default 0.6
3189
+ */
3190
+ this.opacity = 0.6;
3191
+ /**
3192
+ * Represents the tiles URL.
3193
+ * @typedef {string} url
3194
+ *
3195
+ * @example
3196
+ * 'https://example.ex/{z}/{x}/{y}.png'
3197
+ */
3198
+ this.url = '';
3199
+ /**
3200
+ * The projection of the coordinate system.
3201
+ *
3202
+ * @type {string}
3203
+ * @default 'EPSG:3857'
3204
+ */
3205
+ this.projection = 'EPSG:3857';
3206
+ /**
3207
+ * Additional headers that should be added to each tile request
3208
+ *
3209
+ * @type {Record<string, string>}
3210
+ * @default An empty array
3211
+ */
3212
+ this.requestHeaders = null;
3213
+ this.operation = function (d) { var _a; return (_a = d[0]) !== null && _a !== void 0 ? _a : []; };
3214
+ }
3215
+ /**
3216
+ * Creates a copy of the given tile layer settings.
3217
+ *
3218
+ * @param {RasterTileLayerSettings} model - The tile layer settings to be copied.
3219
+ * @return {RasterTileLayerSettings} - A new instance of RasterTileLayerSettings with the same properties as the model.
3220
+ */
3221
+ RasterTileLayerSettings.copy = function (model) {
3222
+ var result = new RasterTileLayerSettings();
3223
+ result.maxZoom = model.maxZoom;
3224
+ result.minZoom = model.minZoom;
3225
+ result.projection = model.projection;
3226
+ result.opacity = model.opacity;
3227
+ result.url = model.url;
3228
+ result.requestHeaders = model.requestHeaders;
3229
+ result.operation = model.operation;
3230
+ return result;
3231
+ };
3232
+ /**
3233
+ * Sets the URL of the RasterTileLayerSettings object.
3234
+ *
3235
+ * @param {string} url - The URL to be set.
3236
+ * @return {RasterTileLayerSettings} - The updated RasterTileLayerSettings object.
3237
+ */
3238
+ RasterTileLayerSettings.prototype.setUrl = function (url) {
3239
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { url: url }));
3240
+ };
3241
+ /**
3242
+ * Sets the operation to apply on raster tile data.
3243
+ *
3244
+ * @param {function} operation - A function that takes an input of either a two-dimensional array of numbers or an array of ImageData objects and returns either a one-dimensional array of numbers or an ImageData object.
3245
+ * @return {RasterTileLayerSettings} A new instance of RasterTileLayerSettings with the updated operation.
3246
+ */
3247
+ RasterTileLayerSettings.prototype.setOperation = function (operation) {
3248
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { operation: operation }));
3249
+ };
3250
+ /**
3251
+ * Sets the requestHeaders of the RasterTileLayerSettings object.
3252
+ *
3253
+ * @param {Record<string, string>} requestHeaders - The headers which should be provided.
3254
+ * @return {RasterTileLayerSettings} - The updated RasterTileLayerSettings object.
3255
+ */
3256
+ RasterTileLayerSettings.prototype.setRequestHeaders = function (requestHeaders) {
3257
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { requestHeaders: requestHeaders }));
3258
+ };
3259
+ /**
3260
+ * Sets the maximum zoom level for the tile layer.
3261
+ *
3262
+ * @param {number} maxZoom - The maximum zoom level.
3263
+ * @returns {RasterTileLayerSettings} - The updated tile layer settings object.
3264
+ */
3265
+ RasterTileLayerSettings.prototype.setMaxZoom = function (maxZoom) {
3266
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { maxZoom: maxZoom }));
3267
+ };
3268
+ /**
3269
+ * Sets the minimum zoom level for the Tile Layer.
3270
+ *
3271
+ * @param {number} minZoom - The minimum zoom level to be set.
3272
+ * @return {RasterTileLayerSettings} The modified RasterTileLayerSettings object with the updated minimum zoom level.
3273
+ */
3274
+ RasterTileLayerSettings.prototype.setMinZoom = function (minZoom) {
3275
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { minZoom: minZoom }));
3276
+ };
3277
+ /**
3278
+ * Sets the opacity of the RasterTileLayerSettings.
3279
+ *
3280
+ * @param {number} opacity - The opacity value to set. Must be a number between 0 and 1.
3281
+ * @return {RasterTileLayerSettings} - A new instance of RasterTileLayerSettings with the opacity set.
3282
+ */
3283
+ RasterTileLayerSettings.prototype.setOpacity = function (opacity) {
3284
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { opacity: opacity }));
3285
+ };
3286
+ /**
3287
+ * Sets the projection for the tile layer settings.
3288
+ *
3289
+ * @param {string} projection - The desired projection for the tile layer settings.
3290
+ * @return {RasterTileLayerSettings} - The updated tile layer settings with the new projection.
3291
+ */
3292
+ RasterTileLayerSettings.prototype.setProjection = function (projection) {
3293
+ return RasterTileLayerSettings.copy(Object.assign(Object.assign({}, this), { projection: projection }));
3294
+ };
3295
+ /**
3296
+ * Checks if the current instance of RasterTileLayerSettings is equal to the given model.
3297
+ * @param {RasterTileLayerSettings} model - The model to compare against.
3298
+ * @return {boolean} - True if all properties of the current instance matches the properties of the model;
3299
+ * otherwise, false.
3300
+ */
3301
+ RasterTileLayerSettings.prototype.isSame = function (model) {
3302
+ if (this.maxZoom !== model.maxZoom)
3303
+ return false;
3304
+ if (this.minZoom !== model.minZoom)
3305
+ return false;
3306
+ if (this.url !== model.url)
3307
+ return false;
3308
+ if (this.projection !== model.projection)
3309
+ return false;
3310
+ if (this.opacity !== model.opacity)
3311
+ return false;
3312
+ if (this.requestHeaders !== model.requestHeaders)
3313
+ return false;
3314
+ if (this.operation !== model.operation)
3315
+ return false;
3316
+ return true;
3317
+ };
3318
+ return RasterTileLayerSettings;
3319
+ }());
3320
+
3321
+ var RasterTileLayerFactory = /** @class */ (function () {
3322
+ function RasterTileLayerFactory() {
3323
+ }
3324
+ RasterTileLayerFactory.prototype.build = function (settings) {
3325
+ var _this = this;
3326
+ var source$1 = new source.XYZ({
3327
+ tileSize: 256,
3328
+ maxZoom: settings.maxZoom || 14,
3329
+ minZoom: settings.minZoom || 1,
3330
+ projection: proj.get(settings.projection),
3331
+ tileUrlFunction: this.getTileFunc(settings),
3332
+ crossOrigin: 'Anonymous',
3333
+ tileLoadFunction: !!settings.requestHeaders
3334
+ ? function (tile, src) { return _this.tileLoader(tile, src, settings.requestHeaders); }
3335
+ : undefined,
3336
+ });
3337
+ var raster = new RasterSource__default["default"]({
3338
+ sources: [source$1],
3339
+ operationType: 'image',
3340
+ operation: settings.operation,
3341
+ });
3342
+ return new ImageLayer__default["default"]({ source: raster, opacity: settings.opacity });
3343
+ };
3344
+ RasterTileLayerFactory.prototype.getTileFunc = function (settings) {
3345
+ var _this = this;
3346
+ return function (tileCoord) {
3347
+ var zoom = tileCoord[0];
3348
+ var x = tileCoord[1];
3349
+ var y = tileCoord[2];
3350
+ var normalizedCoord = _this.getNormalizedCoord({ x: x, y: y }, zoom);
3351
+ var bound = 1 << zoom;
3352
+ return settings.url
3353
+ .replace('{x}', String((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.x) || x))
3354
+ .replace('{z}', String(zoom))
3355
+ .replace('{y}', String(bound - ((normalizedCoord === null || normalizedCoord === void 0 ? void 0 : normalizedCoord.y) || y) - 1));
3356
+ };
3357
+ };
3358
+ RasterTileLayerFactory.prototype.tileLoader = function (tile, src, headers) {
3359
+ var client = new XMLHttpRequest();
3360
+ client.open('GET', src);
3361
+ client.responseType = 'arraybuffer';
3362
+ Object.keys(headers).forEach(function (k) { return client.setRequestHeader(k, headers[k]); });
3363
+ client.onload = function () {
3364
+ if (this.response !== undefined) {
3365
+ var arrayBufferView = new Uint8Array(this.response);
3366
+ var blob = new Blob([arrayBufferView], { type: 'image/png' });
3367
+ var urlCreator = window.URL || window.webkitURL;
3368
+ tile.getImage().src = urlCreator.createObjectURL(blob);
3369
+ }
3370
+ };
3371
+ client.send();
3372
+ };
3373
+ RasterTileLayerFactory.prototype.getNormalizedCoord = function (coord, zoom) {
3374
+ var y = coord.y;
3375
+ var x = coord.x;
3376
+ var tileRange = 1 << zoom;
3377
+ if (y < 0 || y >= tileRange)
3378
+ return null;
3379
+ if (x < 0 || x >= tileRange)
3380
+ x = ((x % tileRange) + tileRange) % tileRange;
3381
+ return { x: x, y: y };
3382
+ };
3383
+ return RasterTileLayerFactory;
3384
+ }());
3385
+ RasterTileLayerFactory.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RasterTileLayerFactory, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
3386
+ RasterTileLayerFactory.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RasterTileLayerFactory, providedIn: 'root' });
3387
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RasterTileLayerFactory, decorators: [{
3388
+ type: i0.Injectable,
3389
+ args: [{
3390
+ providedIn: 'root',
3391
+ }]
3392
+ }] });
3393
+
3394
+ var RasterTileLayerComponent = /** @class */ (function (_super) {
3395
+ __extends(RasterTileLayerComponent, _super);
3396
+ function RasterTileLayerComponent(postboy, factory) {
3397
+ var _this = _super.call(this) || this;
3398
+ _this.postboy = postboy;
3399
+ _this.factory = factory;
3400
+ _this._settings = new RasterTileLayerSettings();
3401
+ _this.onDestroy = function () { return _this.removeLayer(); };
3402
+ return _this;
3403
+ }
3404
+ Object.defineProperty(RasterTileLayerComponent.prototype, "settings", {
3405
+ set: function (value) {
3406
+ if (!value || this._settings.isSame(value))
3407
+ return;
3408
+ this._settings = value;
3409
+ this.initLayer();
3410
+ },
3411
+ enumerable: false,
3412
+ configurable: true
3413
+ });
3414
+ RasterTileLayerComponent.prototype.ngOnInit = function () {
3415
+ var _this = this;
3416
+ this.postboy
3417
+ .sub(MapRenderedEvent)
3418
+ .pipe(operators.filter(function (m) { return !!m; }), operators.first())
3419
+ .subscribe(function (m) { return _this.initLayer(); });
3420
+ };
3421
+ RasterTileLayerComponent.prototype.initLayer = function () {
3422
+ this.removeLayer();
3423
+ this.layer = this.factory.build(this._settings);
3424
+ this.postboy.fire(new AddRasterTileCommand(this.layer));
3425
+ };
3426
+ RasterTileLayerComponent.prototype.removeLayer = function () {
3427
+ if (this.layer)
3428
+ this.postboy.fire(new RemoveRasterTileCommand(this.layer));
3429
+ };
3430
+ return RasterTileLayerComponent;
3431
+ }(DestructibleComponent));
3432
+ RasterTileLayerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RasterTileLayerComponent, deps: [{ token: MapPostboyService }, { token: RasterTileLayerFactory }], target: i0__namespace.ɵɵFactoryTarget.Component });
3433
+ RasterTileLayerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: RasterTileLayerComponent, selector: "art-raster-tile-layer", inputs: { settings: "settings" }, usesInheritance: true, ngImport: i0__namespace, template: '', isInline: true, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
3434
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: RasterTileLayerComponent, decorators: [{
3435
+ type: i0.Component,
3436
+ args: [{
3437
+ selector: 'art-raster-tile-layer',
3438
+ template: '',
3439
+ styleUrls: [],
3440
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
3441
+ }]
3442
+ }], ctorParameters: function () { return [{ type: MapPostboyService }, { type: RasterTileLayerFactory }]; }, propDecorators: { settings: [{
3443
+ type: i0.Input
3444
+ }] } });
3445
+
3138
3446
  var MapPlateFactory = /** @class */ (function () {
3139
3447
  function MapPlateFactory() {
3140
3448
  }
@@ -3690,7 +3998,8 @@
3690
3998
  PolygonsComponent,
3691
3999
  ClusterLayerComponent,
3692
4000
  MapControlZoomComponent,
3693
- ImageLayerComponent], imports: [i6.CommonModule], exports: [MapPlateComponent,
4001
+ ImageLayerComponent,
4002
+ RasterTileLayerComponent], imports: [i6.CommonModule], exports: [MapPlateComponent,
3694
4003
  FeatureLayerComponent,
3695
4004
  MarkersComponent,
3696
4005
  TileLayerComponent,
@@ -3698,7 +4007,8 @@
3698
4007
  PolygonsComponent,
3699
4008
  ClusterLayerComponent,
3700
4009
  MapControlZoomComponent,
3701
- ImageLayerComponent] });
4010
+ ImageLayerComponent,
4011
+ RasterTileLayerComponent] });
3702
4012
  MapModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, imports: [[i6.CommonModule]] });
3703
4013
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapModule, decorators: [{
3704
4014
  type: i0.NgModule,
@@ -3716,6 +4026,7 @@
3716
4026
  ClusterLayerComponent,
3717
4027
  MapControlZoomComponent,
3718
4028
  ImageLayerComponent,
4029
+ RasterTileLayerComponent,
3719
4030
  ],
3720
4031
  exports: [
3721
4032
  MapPlateComponent,
@@ -3727,6 +4038,7 @@
3727
4038
  ClusterLayerComponent,
3728
4039
  MapControlZoomComponent,
3729
4040
  ImageLayerComponent,
4041
+ RasterTileLayerComponent,
3730
4042
  ],
3731
4043
  }]
3732
4044
  }] });
@@ -3940,6 +4252,10 @@
3940
4252
  * Generated bundle index. Do not edit.
3941
4253
  */
3942
4254
 
4255
+ Object.defineProperty(exports, 'Feature', {
4256
+ enumerable: true,
4257
+ get: function () { return ol.Feature; }
4258
+ });
3943
4259
  Object.defineProperty(exports, 'Style', {
3944
4260
  enumerable: true,
3945
4261
  get: function () { return style.Style; }
@@ -3986,6 +4302,8 @@
3986
4302
  exports.PolygonSelfIntersectionExecutor = PolygonSelfIntersectionExecutor;
3987
4303
  exports.PolygonStyleHelper = PolygonStyleHelper;
3988
4304
  exports.PolygonsComponent = PolygonsComponent;
4305
+ exports.RasterTileLayerComponent = RasterTileLayerComponent;
4306
+ exports.RasterTileLayerSettings = RasterTileLayerSettings;
3989
4307
  exports.RemoveControlCommand = RemoveControlCommand;
3990
4308
  exports.SetMapCenterCommand = SetMapCenterCommand;
3991
4309
  exports.StartDrawingCommand = StartDrawingCommand;