Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature outline visual issues #957

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mapml/features/geometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ export var Geometry = L.FeatureGroup.extend({
) &&
e.type === 'keyup'
) {
this.options.group.parentNode.appendChild(this.options.group);
this.options.group.focus();
this.openTooltip();
} else if (e.keyCode === 13 || e.keyCode === 32) {
this.closeTooltip();
Expand Down
12 changes: 12 additions & 0 deletions src/mapml/layers/FeatureLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,18 @@ export var FeatureLayer = L.FeatureGroup.extend({
// hide/display features based on the their zoom limits
this._validateRendering();
}
layerToAdd.options.group.addEventListener('mouseover', function () {
// Move hovered element to the end of its parent container
this.parentNode.appendChild(this);
});
//layerToAdd.options.group.addEventListener('mouseout', function () {
// // bring g element back to it's original location
// const originalPosition = Array.prototype.slice
// .call(this.parentNode.children)
// .indexOf(layerToAdd.options.group);
// let beforeElement = this.parentNode.children[originalPosition + 1];
// this.parentNode.insertBefore(this, beforeElement);
//});
return this;
},
addRendering: function (featureToAdd) {
Expand Down