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

Create map-extent, map-input, map-link #887

Merged
merged 147 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
4cff6ea
initial map-input setup
prushforth May 24, 2023
90f1d79
implement Classes for different types of map-input types
prushforth May 26, 2023
fddb89d
Update map-input implementation + Add support for tilematrix type=loc…
AliyanH May 31, 2023
cef052b
initial map-link setup
prushforth Jun 8, 2023
dc565fc
Suspend CI for now
prushforth Sep 26, 2023
87fe027
Make map-input.connectedCallback async, await on extent.whenReady()
prushforth Sep 26, 2023
2bf9170
Update version to 0.12.0 in package.json
Sep 27, 2023
68139cd
WIP on migrating extent initialization from MapMLLayer to map-extent.js
Oct 3, 2023
bb15b34
WIP on migrating extent initialization from MapMLLayer to map-extent.js
Oct 3, 2023
dcf54a5
Initial working migration of map-extent initialization from MapMLLayer
Oct 4, 2023
77dc9b1
WIP updating and adding and removing layer control extent HTML
Oct 4, 2023
90087e1
Add comment re: current problem
Oct 4, 2023
366409a
WIP on map-extent hidden API
Oct 5, 2023
bd183af
Initial working hidden API for map-extent
prushforth Oct 5, 2023
f6373df
WIP on map-extent Get checkbox working via API map-extent.checked. Ch…
prushforth Oct 5, 2023
5ffd825
Fix TemplatedFeaturesLayer checking/unchecking behaviour.
Oct 6, 2023
baed9f1
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 7, 2023
5d3901a
Set 'Sub-layer' as default label attribute, add to options messages
prushforth Oct 10, 2023
83d64fd
Move/ refactor MapMLLayer._setLayerElExtent into layer.js layer-.extent
prushforth Oct 10, 2023
b6b43d3
Fix bug in _calculateExtent, add whenReady() to layer.zoomTo
prushforth Oct 10, 2023
df4aba6
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 11, 2023
a171a10
WIP get tests configured with new map-extent attributes.
prushforth Oct 11, 2023
ad11b9b
Fix a test done with map-extent hidden attribute implemented via CE
prushforth Oct 11, 2023
6268dae
Make opacity work the same in map-extent as it does in layer. This is
Oct 11, 2023
61e1b3b
Make layer-.extent (layer-._calculateExtent()) memoized
AliyanH Oct 11, 2023
93da663
Get map-extent label API working
AliyanH Oct 11, 2023
a9e1b5e
WIP fix/refactor query map-extents
AliyanH Oct 11, 2023
af9a1c8
avoid remote map-feature (in mapml) triggering MapFeature connectedCa…
yhy0217 Oct 12, 2023
c1b42cb
Fix remote queryable layer with hidden extent not queryable.
prushforth Oct 12, 2023
db9088b
Re-write AnnounceMovement.js totalBounds event handler to use
prushforth Oct 12, 2023
887c8df
create layer-.whenElemsReady method to check if the children elems of…
yhy0217 Oct 13, 2023
546ab5d
WIP on debugMode, totalLayerBounds, AnnounceMovement
Oct 13, 2023
e668d3a
Get debugMode.test.js working
Oct 13, 2023
68a2c62
featureIndexOverlayResults needs to be in slowMo to work reliably
prushforth Oct 16, 2023
d80ee50
WIP on multiple extents test semantics. Also, see todo file for disc…
prushforth Oct 17, 2023
666f542
Refactor layer.js._calculateExtent into
Oct 17, 2023
1a5c994
WIP on multiple extents test semantics. Also, see todo file for disc…
prushforth Oct 17, 2023
851d5be
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 18, 2023
bf189ec
get rid of layerControl._validateInput, make layer- and map-extent el…
yhy0217 Oct 19, 2023
7508e73
Upgrade playwright to 1.39.0
Oct 19, 2023
e191bd9
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
Oct 19, 2023
7b09570
WIP: refactor to get rid of _properties._mapExtents, make layer- and …
yhy0217 Oct 23, 2023
ca56c53
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 24, 2023
ad446c3
add event listener on layer- to listen to layer- checked property cha…
yhy0217 Oct 24, 2023
1534322
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 24, 2023
1b42138
remove trailing '/' from from xmlns links
AliyanH Oct 24, 2023
7821ea7
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
prushforth Oct 24, 2023
dbd5386
Init checkbox defaultChecked for map-extent, layer-
prushforth Oct 24, 2023
2ea54ea
get rid of MapMLLayer._validateExtent, add projection check in mapExt…
yhy0217 Oct 24, 2023
2fee5e2
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
yhy0217 Oct 24, 2023
bc4515b
clean up the templatedTileLayer._container when the templatedTileLaye…
yhy0217 Oct 25, 2023
317ebc7
Add rejection to map-extent, map-input in the case of the element being
Oct 25, 2023
bef10a9
Make it so that createLayerControlHTML works unconditionally, was
Oct 25, 2023
0c3f394
Enable <select> as a control in <map-extent>, which will break keyboard
Oct 25, 2023
6f185c5
get layer and extent layer control disabled properly + move over code…
AliyanH Oct 26, 2023
2d9bbd3
update Gruntfile
AliyanH Oct 26, 2023
12d677a
grouping the radio buttons of styles in layerControl based on an uniq…
yhy0217 Oct 26, 2023
85c1f2f
invoke mapExtent.handlechange when the map projection is changed to m…
yhy0217 Oct 26, 2023
25543c5
Workaround leaflet bug when changing map.options.crs #2553
prushforth Oct 26, 2023
6d9cdee
initial map-input setup
prushforth May 24, 2023
7d8acda
implement Classes for different types of map-input types
prushforth May 26, 2023
9951ddd
Update map-input implementation + Add support for tilematrix type=loc…
AliyanH May 31, 2023
68bf20f
initial map-link setup
prushforth Jun 8, 2023
d9ff457
Make map-input.connectedCallback async, await on extent.whenReady()
prushforth Sep 26, 2023
6cdc58f
Update version to 0.12.0 in package.json
Sep 27, 2023
afa0572
WIP on migrating extent initialization from MapMLLayer to map-extent.js
Oct 3, 2023
8e1085f
WIP on migrating extent initialization from MapMLLayer to map-extent.js
Oct 3, 2023
b358e1a
Initial working migration of map-extent initialization from MapMLLayer
Oct 4, 2023
3a12e9b
WIP updating and adding and removing layer control extent HTML
Oct 4, 2023
0ddf09f
Add comment re: current problem
Oct 4, 2023
d9680bf
WIP on map-extent hidden API
Oct 5, 2023
a197640
Initial working hidden API for map-extent
prushforth Oct 5, 2023
fe9335a
WIP on map-extent Get checkbox working via API map-extent.checked. Ch…
prushforth Oct 5, 2023
f56f695
Fix TemplatedFeaturesLayer checking/unchecking behaviour.
Oct 6, 2023
8b65874
Set 'Sub-layer' as default label attribute, add to options messages
prushforth Oct 10, 2023
b4bd73a
Move/ refactor MapMLLayer._setLayerElExtent into layer.js layer-.extent
prushforth Oct 10, 2023
5bf93ac
Fix bug in _calculateExtent, add whenReady() to layer.zoomTo
prushforth Oct 10, 2023
926e114
WIP get tests configured with new map-extent attributes.
prushforth Oct 11, 2023
fe58ee6
Fix a test done with map-extent hidden attribute implemented via CE
prushforth Oct 11, 2023
1917320
Make opacity work the same in map-extent as it does in layer. This is
Oct 11, 2023
278d3e8
Make layer-.extent (layer-._calculateExtent()) memoized
AliyanH Oct 11, 2023
da36f03
Get map-extent label API working
AliyanH Oct 11, 2023
2082af0
WIP fix/refactor query map-extents
AliyanH Oct 11, 2023
a0985be
avoid remote map-feature (in mapml) triggering MapFeature connectedCa…
yhy0217 Oct 12, 2023
e05ef43
Fix remote queryable layer with hidden extent not queryable.
prushforth Oct 12, 2023
ff8468e
Re-write AnnounceMovement.js totalBounds event handler to use
prushforth Oct 12, 2023
99b6dfc
create layer-.whenElemsReady method to check if the children elems of…
yhy0217 Oct 13, 2023
dc21be3
WIP on debugMode, totalLayerBounds, AnnounceMovement
Oct 13, 2023
a9e5c2a
Get debugMode.test.js working
Oct 13, 2023
011ea3d
featureIndexOverlayResults needs to be in slowMo to work reliably
prushforth Oct 16, 2023
663fb8f
Refactor layer.js._calculateExtent into
Oct 17, 2023
f63643c
WIP on multiple extents test semantics. Also, see todo file for disc…
prushforth Oct 17, 2023
862bfc4
Upgrade playwright to 1.39.0
Oct 19, 2023
ec97a8c
get rid of layerControl._validateInput, make layer- and map-extent el…
yhy0217 Oct 19, 2023
4f4c615
WIP: refactor to get rid of _properties._mapExtents, make layer- and …
yhy0217 Oct 23, 2023
95daa8c
add event listener on layer- to listen to layer- checked property cha…
yhy0217 Oct 24, 2023
fec1145
remove trailing '/' from from xmlns links
AliyanH Oct 24, 2023
53e3e16
get rid of MapMLLayer._validateExtent, add projection check in mapExt…
yhy0217 Oct 24, 2023
971afc4
Init checkbox defaultChecked for map-extent, layer-
prushforth Oct 24, 2023
f8525f4
clean up the templatedTileLayer._container when the templatedTileLaye…
yhy0217 Oct 25, 2023
56f7967
Add rejection to map-extent, map-input in the case of the element being
Oct 25, 2023
1796aab
Make it so that createLayerControlHTML works unconditionally, was
Oct 25, 2023
f719e38
Enable <select> as a control in <map-extent>, which will break keyboard
Oct 25, 2023
57ba9a8
get layer and extent layer control disabled properly + move over code…
AliyanH Oct 26, 2023
3dcad6a
update Gruntfile
AliyanH Oct 26, 2023
b8667c8
grouping the radio buttons of styles in layerControl based on an uniq…
yhy0217 Oct 26, 2023
4581cf8
invoke mapExtent.handlechange when the map projection is changed to m…
yhy0217 Oct 26, 2023
4fc7afe
Workaround leaflet bug when changing map.options.crs #2553
prushforth Oct 26, 2023
22c3564
Workaround leaflet bug when changing map.options.crs #2553 part deux
prushforth Oct 26, 2023
6499590
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
yhy0217 Oct 27, 2023
ebe1e6b
Make opacity implementation the same for both layer- and map-extent
Oct 27, 2023
d2fa174
add the setTimeout for the layer-._validateDisable back, to make sure…
yhy0217 Oct 27, 2023
5aa98ba
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
yhy0217 Oct 27, 2023
b872eb7
Fix merge error
Oct 27, 2023
31a701c
Sync mapml-viewer -> web-map.js
Oct 27, 2023
56cadcb
Enable layer-.whenReady to handle fetch errors without waiting for the
Oct 27, 2023
34943ad
Get tests working
Oct 27, 2023
1468464
Remove .only from some tests preventing full suite from running
Oct 27, 2023
5137200
sync multipleExtents tests with PR
AliyanH Oct 27, 2023
924ac86
Fix markup in mapSpan.html
prushforth Oct 30, 2023
82f2fa8
WIP: fix failing test; migrate map-meta[name] from remote mapml to th…
yhy0217 Oct 30, 2023
54af929
fix the typo from map-meta[name=projection] to map-meta[name=zoom]; d…
yhy0217 Oct 30, 2023
ff83d12
add settimeout in debugoverlay._addbounds to delay the function call …
yhy0217 Oct 30, 2023
328e36d
sync mapml-viewer test with web-map
AliyanH Oct 30, 2023
cac50b3
add constants.js to dist and import it in map-extent.js, remove unuse…
yhy0217 Oct 30, 2023
8a65876
Projection change test when following link to layer with default bounds
prushforth Oct 30, 2023
65705ed
make the minzoom and maxzoom of staticTileLayer read from map-meta in…
yhy0217 Oct 31, 2023
8ca68f1
fix CI test file formatting, enable CI
yhy0217 Oct 31, 2023
5259685
Update ci-testing with trailing space to try to get it working. Upda…
Oct 31, 2023
a3fea83
Update yaml file from known good revision
Oct 31, 2023
ec4710e
Add whenReady().then().catch() blocks to layer-.attributeChangedCallback
Oct 31, 2023
ebc04a8
Set --workers=1 for playwright testing, be kind to github actions
Oct 31, 2023
b2024f7
add slowmo to the debugmode.test
yhy0217 Oct 31, 2023
9da442b
Merge branch 'map-extent' of https://github.com/Maps4HTML/Web-Map-Cus…
yhy0217 Oct 31, 2023
1ab4466
add slowmo to the history.test
yhy0217 Oct 31, 2023
b4961c8
add slowmo to a few tests to get GitHub CI testing pass
yhy0217 Oct 31, 2023
ff77a59
change the returned format of the zoom getter of mapmlviewer from Str…
yhy0217 Nov 1, 2023
728790d
change map lat, lon, width and height getters to return a Number inst…
yhy0217 Nov 1, 2023
c892fba
add waitfortimeout for flaky tests to pass GitHub CI testing
yhy0217 Nov 1, 2023
e06eeff
Return number for layer-, map-extent.opacity,
Nov 2, 2023
fa764b5
move dist to right place for grunt web-map-doc
AliyanH Nov 2, 2023
b6991c3
Bundle everything possible into mapml.js, use M. to access global sym…
Nov 2, 2023
a4ff429
cleanup - remove comments that are now irrelevant + remove commented …
AliyanH Nov 3, 2023
4ae8f82
initialize this._opacity of layer- and map-extent with the attribute …
yhy0217 Nov 3, 2023
fd68b1a
Add tests for map-extent attribute api. Fix bug in same.
prushforth Nov 3, 2023
75b4b5b
Add test for template feature being disabled when going out of bounds
AliyanH Nov 3, 2023
faa584a
Change class on opacity details/summary for map-extent layer control
prushforth Nov 5, 2023
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
12 changes: 6 additions & 6 deletions .github/workflows/ci-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: sudo apt-get install xvfb
- run: npm install --legacy-peer-deps
- run: npx playwright install
- run: npm install -g grunt-cli
- run: grunt default
- run: xvfb-run --auto-servernum -- npm test
# - run: sudo apt-get install xvfb
# - run: npm install --legacy-peer-deps
# - run: npx playwright install
# - run: npm install -g grunt-cli
# - run: grunt default
# - run: xvfb-run --auto-servernum -- npm test
# - run: xvfb-run --auto-servernum -- npm run jest
env:
CI: true
8 changes: 8 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ module.exports = function(grunt) {
'dist/map-caption.js': ['src/map-caption.js'],
'dist/map-feature.js': ['src/map-feature.js'],
'dist/map-extent.js': ['src/map-extent.js'],
'dist/map-input.js': ['src/map-input.js'],
'dist/map-link.js': ['src/map-link.js'],
// temporary, will be bundled into mapml.js possibly
'dist/zoomInput.js': ['src/mapml/elementSupport/inputs/zoomInput.js'],
'dist/hiddenInput.js': ['src/mapml/elementSupport/inputs/hiddenInput.js'],
'dist/widthInput.js': ['src/mapml/elementSupport/inputs/widthInput.js'],
'dist/heightInput.js': ['src/mapml/elementSupport/inputs/heightInput.js'],
'dist/locationInput.js': ['src/mapml/elementSupport/inputs/locationInput.js'],
'dist/map-area.js': ['src/map-area.js'],
'dist/layer.js': ['src/layer.js'],
'dist/leaflet.js': ['dist/leaflet-src.js',
Expand Down
109 changes: 58 additions & 51 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/* Responsive map. */
max-width: 100%;

/* Full viewport. */
/* Full viewport. */
width: 100%;
height: 100%;

Expand Down Expand Up @@ -72,56 +72,63 @@
</noscript>
</head>
<body>
<mapml-viewer projection="CBMTILE" zoom="2" lat="45" lon="-90" controls controlslist="nofullscreen geolocation">
<map-caption>A pleasing map of Canada</map-caption>
<layer- label="CBMT" src="https://geogratis.gc.ca/mapml/en/cbmtile/cbmt/" checked></layer->
<layer- label="Hat Guy" checked>
<map-feature id="twohats" zoom="15" class="twohats">
<map-properties>
<table>
<tr>
<th>code</th>
<td>1200020</td>
</tr>
<tr>
<th>accuracy</th>
<td>26</td>
</tr>
<tr>
<th>valdate</th>
<td>1995</td>
</tr>
<tr>
<th>image</th>
<td><a href="https://www.veterans.gc.ca/eng/remembrance/memorials/national-inventory-canadian-memorials/details/9304">
<img src="https://www.veterans.gc.ca/images/remembrance/memorials/national-inventory-canadian-memorials/mem/35059-173a.jpg" width="60" height="60"/>
</a>
</td>
</tr>
<tr>
<th>theme</th>
<td>FO</td>
</tr>
<tr>
<th>type</th>
<td>2</td>
</tr>
<tr>
<th>elevation</th>
<td>61</td>
</tr>
<tr>
<th>altiaccu</th>
<td>5</td>
</tr>
</table>
</map-properties>
<map-geometry>
<map-point>
<map-coordinates>-75.705278 45.397778</map-coordinates>
</map-point>
</map-geometry>
</map-feature>

<mapml-viewer projection="OSMTILE" zoom="14" lat="45.406314" lon="-75.6883335" controls controlslist="geolocation">
<!-- <layer- data-testid="osm-layer" label="OpenStreetMap" checked >
<map-extent data-testid="osm-extent" units="OSMTILE" label="foo" checked="checked" >
<map-input name="z" type="zoom" value="18" min="0" max="18"></map-input>
<map-input name="x" type="location" units="tilematrix" axis="column" min="0" max="262144"></map-input>
<map-input name="y" type="location" units="tilematrix" axis="row" min="0" max="262144"></map-input>
<map-link rel="tile" tref="https://tile.openstreetmap.org/{z}/{x}/{y}.png"></map-link>
</map-extent>
</layer->-->
<layer- data-testid="rest-layer" id="restaurant" label="Mexican restaurants" src="../shared/restaurants/mexican.mapml" checked>
<!-- <map-meta name="cs" content="gcrs" ></map-meta>
<map-meta name="extent" content="top-left-easting=-8433179, top-left-northing=5689316, bottom-right-easting=-8420968, bottom-right-northing=5683139"></map-meta>
<map-feature zoom="18" id="restaurant_polygon.2" class="restaurant_polygon">
<map-featurecaption>Banditos</map-featurecaption>
<map-geometry>
<map-point>
<map-coordinates>-75.689609 45.405803</map-coordinates>
</map-point>
</map-geometry>
<map-properties>
<table>
<thead>
<tr>
<th role="columnheader" scope="col">Property name</th>
<th role="columnheader" scope="col">Property value</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">addr_house</th>
<td itemprop="addr_house">683</td>
</tr>
<tr>
<th scope="row">addr_stree</th>
<td itemprop="addr_stree">Bank Street</td>
</tr>
<tr>
<th scope="row">amenity</th>
<td itemprop="amenity">restaurant</td>
</tr>
<tr>
<th scope="row">building</th>
<td itemprop="building">commercial</td>
</tr>
<tr>
<th scope="row">name</th>
<td itemprop="name">Banditos</td>
</tr>
<tr>
<th scope="row">cuisine</th>
<td itemprop="cuisine">mexican</td>
</tr>
</tbody>
</table>
</map-properties>
</map-feature>-->
</layer->
</mapml-viewer>
</body>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@maps4html/web-map-custom-element",
"version": "0.11.0",
"version": "0.12.0",
"description": "web-map customized built-in HTML <map> or custom <mapml-viewer>",
"keywords": [
"mapml-viewer",
Expand Down
66 changes: 66 additions & 0 deletions shared/restaurants/indian.mapml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<mapml- xmlns="http://www.w3.org/1999/xhtml">
<map-head>
<map-title>Restaurants</map-title>
<map-meta charset="utf-8" ></map-meta>
<map-meta content="text/mapml" http-equiv="Content-Type" ></map-meta>
<map-link rel="license" href="http://opendatacommons.org/licenses/odbl/1-0/" title="© OpenStreetMap and contributors" />
<map-meta name="projection" content="OSMTILE"></map-meta>
<map-meta name="zoom" content="min=0,max=22,value=3" ></map-meta>
<map-meta name="cs" content="gcrs" ></map-meta>
<map-meta name="extent" content="top-left-easting=-8433179, top-left-northing=5689316, bottom-right-easting=-8420968, bottom-right-northing=5683139"></map-meta>
</map-head>
<map-body>
<map-feature zoom="18" id="restaurant_polygon.7" class="restaurant_polygon">
<map-featurecaption>India Palace</map-featurecaption>
<map-geometry>
<map-point>
<map-coordinates>-75.7019048 45.4191548</map-coordinates>
</map-point>
</map-geometry>
<map-properties>
<table>
<thead>
<tr>
<th role="columnheader" scope="col">Property name</th>
<th role="columnheader" scope="col">Property value</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">addr_house</th>
<td itemprop="addr_house">292</td>
</tr>
<tr>
<th scope="row">addr_stree</th>
<td itemprop="addr_stree">Albert Street</td>
</tr>
<tr>
<th scope="row">amenity</th>
<td itemprop="amenity">restaurant</td>
</tr>
<tr>
<th scope="row">building</th>
<td itemprop="building">yes</td>
</tr>
<tr>
<th scope="row">name</th>
<td itemprop="name">India Palace</td>
</tr>
<tr>
<th scope="row">cuisine</th>
<td itemprop="cuisine">indian</td>
</tr>
<tr>
<th scope="row">website</th>
<td itemprop="website">http://www.indiapalace.ca</td>
</tr>
<tr>
<th scope="row">phone</th>
<td itemprop="phone">+1-613-234-5433</td>
</tr>
</tbody>
</table>
</map-properties>
</map-feature>
</map-body>
</mapml->
Loading