-
Notifications
You must be signed in to change notification settings - Fork 16
map-feature bug fixes #841
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f71c229
remove map-feature bug
AliyanH c425770
Merge branch 'main' of https://github.com/Maps4HTML/Web-Map-Custom-El…
AliyanH 3956180
fix/update Event implementation
AliyanH 65bfe1e
stopPropagation attempt
AliyanH 97cd6ce
Finalize map-feature Event handling
AliyanH 468e81d
revert index.html
AliyanH a1e7cc3
Add test for stopPropagation
AliyanH 9ff535a
update observed attributes + add test for click method
AliyanH c804bbe
remove non-standard event parameter for click,focus,blur methods
AliyanH c8ac48e
add support/link for keyup+keydown event
AliyanH 8ae334b
close popup on zoom to here link, closes #855
AliyanH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<title>map-feature Event tests</title> | ||
<meta charset="UTF-8"> | ||
<script type="module" src="mapml-viewer.js"></script> | ||
</head> | ||
|
||
<body> | ||
<mapml-viewer width="500" height="500" projection="OSMTILE" zoom="10" lon="-75.7" lat="45.4" controls> | ||
<layer- label="Features" checked> | ||
<map-meta name="projection" content="OSMTILE"></map-meta> | ||
<map-feature> | ||
<map-featurecaption>Polygon</map-featurecaption> | ||
<map-geometry cs="gcrs"> | ||
<map-polygon class="polygon"> | ||
<map-coordinates>-75.5859375 45.4656690 -75.6813812 45.4533876 -75.6961441 45.4239978 | ||
-75.7249832 45.4083331 -75.7792282 45.3772317 -75.7534790 45.3294614 -75.5831909 45.3815724 | ||
-75.6024170 45.4273712 -75.5673981 45.4639834 -75.5859375 45.4656690</map-coordinates> | ||
</map-polygon> | ||
</map-geometry> | ||
<map-properties> | ||
<h2>This is a Polygon</h2> | ||
</map-properties> | ||
</map-feature> | ||
|
||
<map-feature id="line"> | ||
<map-featurecaption>Line</map-featurecaption> | ||
<map-geometry cs="gcrs"> | ||
<map-linestring class="line"> | ||
<map-coordinates>-75.6168365 45.471929 -75.6855011 45.458445 -75.7016373 45.4391764 -75.7030106 | ||
45.4259255 -75.7236099 45.4208652 -75.7565689 45.4117074 -75.7833481 45.384225 -75.8197403 | ||
45.3714435 -75.8516693 45.377714</map-coordinates> | ||
</map-linestring> | ||
</map-geometry> | ||
<map-properties> | ||
<h2>This is a Line</h2> | ||
</map-properties> | ||
</map-feature> | ||
|
||
<map-feature> | ||
<map-featurecaption>Point</map-featurecaption> | ||
<map-geometry cs="gcrs"> | ||
<map-point class="point"> | ||
<map-coordinates>-75.6916809 45.4186964</map-coordinates> | ||
</map-point> | ||
</map-geometry> | ||
<map-properties> | ||
<h2>This is a Point</h2> | ||
</map-properties> | ||
</map-feature> | ||
</layer-> | ||
</mapml-viewer> | ||
|
||
<div id="property"></div> | ||
|
||
<script> | ||
function preventDefaultFunc(e) { | ||
e.originalEvent.stopPropagation(); | ||
let out = document.getElementById('property'); | ||
out.innerHTML = e.srcElement.querySelector("map-properties").innerHTML; | ||
} | ||
// Replace map-feature click handling | ||
document.querySelectorAll('map-feature').forEach((f) => { | ||
f.onclick = preventDefaultFunc; | ||
}); | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.