@artstesh/maps 4.1.34 → 4.1.36

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.
@@ -2452,6 +2452,10 @@ class RasterTileLayerSettings {
2452
2452
  * @default An empty array
2453
2453
  */
2454
2454
  this.requestHeaders = null;
2455
+ /**
2456
+ * The priority of showing - layers with higher zIndex cover others in case of collisions
2457
+ */
2458
+ this.zIndex = 1;
2455
2459
  this.operation = (d) => d[0] ?? [];
2456
2460
  }
2457
2461
  /**
@@ -2464,6 +2468,7 @@ class RasterTileLayerSettings {
2464
2468
  const result = new RasterTileLayerSettings();
2465
2469
  result.maxZoom = model.maxZoom;
2466
2470
  result.minZoom = model.minZoom;
2471
+ result.zIndex = model.zIndex;
2467
2472
  result.projection = model.projection;
2468
2473
  result.opacity = model.opacity;
2469
2474
  result.url = model.url;
@@ -2507,6 +2512,15 @@ class RasterTileLayerSettings {
2507
2512
  setMaxZoom(maxZoom) {
2508
2513
  return RasterTileLayerSettings.copy({ ...this, maxZoom });
2509
2514
  }
2515
+ /**
2516
+ * Sets the z-index for the RasterTileLayerSettings.
2517
+ *
2518
+ * @param {number} zIndex - The new z-index to be assigned.
2519
+ * @return {RasterTileLayerSettings} A new RasterTileLayerSettings instance with the updated z-index.
2520
+ */
2521
+ setZIndex(zIndex) {
2522
+ return RasterTileLayerSettings.copy({ ...this, zIndex });
2523
+ }
2510
2524
  /**
2511
2525
  * Sets the minimum zoom level for the Tile Layer.
2512
2526
  *
@@ -2545,6 +2559,8 @@ class RasterTileLayerSettings {
2545
2559
  return false;
2546
2560
  if (this.minZoom !== model.minZoom)
2547
2561
  return false;
2562
+ if (this.zIndex !== model.zIndex)
2563
+ return false;
2548
2564
  if (this.url !== model.url)
2549
2565
  return false;
2550
2566
  if (this.projection !== model.projection)
@@ -2575,9 +2591,9 @@ class RasterTileLayerFactory {
2575
2591
  const raster = new RasterSource({
2576
2592
  sources: [source],
2577
2593
  operationType: 'image',
2578
- operation: (arg) => settings.operation(arg),
2594
+ operation: settings.operation,
2579
2595
  });
2580
- return new ImageLayer({ source: raster, opacity: settings.opacity });
2596
+ return new ImageLayer({ source: raster, opacity: settings.opacity, zIndex: settings.zIndex });
2581
2597
  }
2582
2598
  getTileFunc(settings) {
2583
2599
  return (tileCoord) => {