Skip to content

Commit

Permalink
Fix bug in query handling where map-meta in query response was (Maps4…
Browse files Browse the repository at this point in the history
…HTML#888)

inadvertently ignored. Rename _layer.metas to _layer.queryMetas for
clarity.
  • Loading branch information
prushforth authored Sep 27, 2023
1 parent 3aaa9d1 commit 9522027
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/map-feature.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ export class MapFeature extends HTMLElement {
let map = this._map,
geometry = this.querySelector('map-geometry'),
native = this._getNativeZoomAndCS(
this._layer._content || this._layer.metas
this._layer.queryMetas?.length
? this._layer.queryMetas
: this._layer._content
),
cs = geometry.getAttribute('cs') || native.cs,
// zoom level that the feature rendered at
Expand Down
10 changes: 7 additions & 3 deletions src/mapml/handlers/QueryHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ export var QueryHandler = L.Handler.extend({
features = Array.prototype.slice.call(
mapmldoc.querySelectorAll('map-feature')
);
// <map-meta> elements
layer.metas = Array.prototype.slice.call(
// <map-meta> elements for this query
layer.queryMetas = Array.prototype.slice.call(
mapmldoc.querySelectorAll(
'map-meta[name=cs], map-meta[name=zoom], map-meta[name=projection]'
)
Expand Down Expand Up @@ -298,7 +298,11 @@ export var QueryHandler = L.Handler.extend({
layer.on('popupclose', function () {
map.removeLayer(f);
});
f.showPaginationFeature({ i: 0, popup: layer._popup, meta: layer.metas });
f.showPaginationFeature({
i: 0,
popup: layer._popup,
meta: layer.queryMetas
});
}
}
});

0 comments on commit 9522027

Please sign in to comment.