Skip to content

Commit 422b159

Browse files
author
Peter Rushforth
committed
Delete MapFeatureLayerGroup.js - only need FeatureLayer.js I hope
Keep similar code between map-feature.js and map-tile.js in sync
1 parent 0887c84 commit 422b159

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/map-feature.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,9 @@ export class HTMLFeatureElement extends HTMLElement {
284284
return this.nodeName !== prevSibling.nodeName;
285285
}
286286
getPrevious() {
287-
// Check if this is the first tile
287+
// Check if this is the first element of a sequence
288288
if (this.isFirst()) {
289-
return null; // No previous tile available
289+
return null; // No previous element available
290290
}
291291

292292
// Since we know it's not the first, we can safely return the previous element sibling

src/map-tile.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class HTMLTileElement extends HTMLElement {
9393
}
9494
}
9595
}
96-
isFirstTile() {
96+
isFirst() {
9797
// Get the previous element sibling
9898
const prevSibling = this.previousElementSibling;
9999

@@ -105,13 +105,13 @@ export class HTMLTileElement extends HTMLElement {
105105
// Compare the node names (tag names) - return true if they're different
106106
return this.nodeName !== prevSibling.nodeName;
107107
}
108-
getPreviousTile() {
109-
// Check if this is the first tile
110-
if (this.isFirstTile()) {
111-
return null; // No previous tile available
108+
getPrevious() {
109+
// Check if this is the first element of a sequence
110+
if (this.isFirst()) {
111+
return null; // No previous element available
112112
}
113113

114-
// Since we know it's not the first tile, we can safely return the previous element sibling
114+
// Since we know it's not the first, we can safely return the previous element sibling
115115
return this.previousElementSibling;
116116
}
117117
zoomTo() {
@@ -160,7 +160,7 @@ export class HTMLTileElement extends HTMLElement {
160160
}
161161
}
162162
_createOrGetTileLayer() {
163-
if (this.isFirstTile()) {
163+
if (this.isFirst()) {
164164
const parentElement = this._parentElement;
165165

166166
// Create a new MapTileLayer

0 commit comments

Comments
 (0)