@mapmap/maps 0.10.0 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -148,9 +148,7 @@ function applyTerrain(map, cfg) {
148
148
  }
149
149
  if (!map.getLayer(HILLSHADE_LAYER_ID)) {
150
150
  const layers = map.getStyle()?.layers ?? [];
151
- const firstLineOrSymbol = layers.find(
152
- (l) => l.type === "line" || l.type === "symbol"
153
- );
151
+ const before = layers.find((l) => l.id === "water") ?? layers.find((l) => l.type === "line" || l.type === "symbol");
154
152
  map.addLayer(
155
153
  {
156
154
  id: HILLSHADE_LAYER_ID,
@@ -158,7 +156,7 @@ function applyTerrain(map, cfg) {
158
156
  source: HILLSHADE_SOURCE_ID,
159
157
  paint: { "hillshade-exaggeration": 0.5 }
160
158
  },
161
- firstLineOrSymbol?.id
159
+ before?.id
162
160
  );
163
161
  }
164
162
  }