Skip to content

Commit 9c98155

Browse files
authored
Add search control to several experiments (#164)
1 parent c2ad748 commit 9c98155

27 files changed

Lines changed: 288 additions & 66 deletions

File tree

api/pwa/file-handling/src/main-app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,11 @@ mapml-viewer {
134134
<input id="loadfile" name="loadfile" type="file" accept=".geojson"/>
135135
<label for="loadfile">Load GeoJSON</label>
136136
</div>
137-
<mapml-viewer zoom="2" lat="0" lon="0" controls controlslist="geolocation">
137+
<mapml-viewer zoom="2" lat="0" lon="0" controls controlslist="geolocation search">
138138
<map-layer label="OpenStreetMap" checked >
139139
<map-link rel="license" href="https://www.openstreetmap.org/copyright" title="© OpenStreetMap contributors CC BY-SA"></map-link>
140+
<map-link rel="suggestions" tref="https://photon.komoot.io/api?q={searchTerms}"></map-link>
141+
<map-link rel="search" tref="https://photon.komoot.io/api?q={searchTerms}"></map-link>
140142
<map-extent units="OSMTILE" checked>
141143
<map-input name="z" type="zoom" value="18" min="0" max="18"></map-input>
142144
<map-input name="x" type="location" units="tilematrix" axis="column" min="0" max="262144"></map-input>
@@ -145,6 +147,7 @@ mapml-viewer {
145147
</map-extent>
146148
</map-layer>
147149
</mapml-viewer>
150+
<script src="/shared/script/photon-search-handler.js"></script>
148151
<a class="credits" href="https://www.flaticon.com/free-icons/parchment" title="parchment icons">Parchment icons created by Freepik - Flaticon</a>
149152
</div>
150153
</div>

change-projection/default-projection/index.html

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,46 @@
88
the viewer projection from OSMTILE to CBMTILE. -->
99
<script type="module" src="../../dist/mapml.js"></script>
1010
<link rel="stylesheet" href="../../global.css">
11-
<style>button {
12-
z-index: 1;
13-
position:absolute;
14-
justify-items: center;
15-
bottom: 3.5%;
11+
<style>
12+
button {
13+
z-index: 1;
14+
position:absolute;
15+
justify-items: center;
16+
bottom: 3.5%;
1617
}
1718
body {
18-
display: flex;
19-
align-items: center;
20-
justify-content: center;
19+
display: flex;
20+
align-items: center;
21+
justify-content: center;
2122
}
2223
</style>
24+
<script src="/shared/script/geogratis-search-handler.js"></script>
2325
</head>
2426
<body>
25-
<mapml-viewer zoom="5" lon="-97.288195" lat="56.555669" controls>
27+
<mapml-viewer zoom="5" lon="-97.288195" lat="56.555669" controls controlslist="search">
2628
<map-layer checked>
2729
<map-meta name="extent" content="top-left-easting=-19959237, top-left-northing=13854059, bottom-right-easting=-1174073, bottom-right-northing=4647371"></map-meta>
2830
<map-title>Topo base</map-title>
31+
<map-link rel="suggestions" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}*&num=20"></map-link>
32+
<map-link rel="search" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}&num=20"></map-link>
2933
<map-extent units="OSMTILE" label="Toprama - Mercator" checked>
30-
<map-input name="z" type="zoom" value="18" min="4" max="18"></map-input>
34+
<map-input name="z" type="zoom" value="18" min="4" max="22"></map-input>
3135
<map-input name="w" type="width"></map-input>
3236
<map-input name="h" type="height"></map-input>
3337
<map-input name="xmin" type="location" units="pcrs" position="top-left" axis="easting" ></map-input>
3438
<map-input name="ymin" type="location" units="pcrs" position="bottom-left" axis="northing" ></map-input>
3539
<map-input name="xmax" type="location" units="pcrs" position="top-right" axis="easting" ></map-input>
3640
<map-input name="ymax" type="location" units="pcrs" position="top-left" axis="northing" ></map-input>
37-
<map-link rel="image" tref="https://maps.geogratis.gc.ca/wms/toporama_en?SERVICE=WMS&amp;REQUEST=GetMap&amp;FORMAT=image/jpeg&amp;TRANSPARENT=FALSE&amp;STYLES=&amp;VERSION=1.3.0&amp;LAYERS=WMS-Toporama&amp;WIDTH={w}&amp;HEIGHT={h}&amp;CRS=EPSG:3857&amp;BBOX={xmin},{ymin},{xmax},{ymax}&amp;m4h=t"></map-link>
41+
<map-link rel="image" tref="https://maps.geogratis.gc.ca/wms/toporama_en?SERVICE=WMS&REQUEST=GetMap&FORMAT=image/jpeg&TRANSPARENT=FALSE&STYLES=&VERSION=1.3.0&LAYERS=WMS-Toporama&WIDTH={w}&HEIGHT={h}&CRS=EPSG:3857&BBOX={xmin},{ymin},{xmax},{ymax}&m4h=t"></map-link>
3842
</map-extent>
39-
<map-extent label="CBMT - Lambert" units="CBMTILE" checked >
40-
<map-input name="z" type="zoom" min="0" max="18"></map-input>
41-
<map-input name="y" type="location" units="tilematrix" axis="row"></map-input>
42-
<map-input name="x" type="location" units="tilematrix" axis="column"></map-input>
43-
<map-link rel="tile" tref="https://geoappext.nrcan.gc.ca/arcgis/rest/services/BaseMaps/CBMT3978/MapServer/tile/{z}/{y}/{x}?m4h=t" ></map-link>
44-
</map-extent> </map-layer>
45-
<map-layer label="Projection not specified" checked>
43+
<map-extent label="CBMT - Lambert" units="CBMTILE" checked >
44+
<map-input name="z" type="zoom" min="0" max="18"></map-input>
45+
<map-input name="y" type="location" units="tilematrix" axis="row"></map-input>
46+
<map-input name="x" type="location" units="tilematrix" axis="column"></map-input>
47+
<map-link rel="tile" tref="https://geoappext.nrcan.gc.ca/arcgis/rest/services/BaseMaps/CBMT3978/MapServer/tile/{z}/{y}/{x}?m4h=t" ></map-link>
48+
</map-extent>
49+
</map-layer>
50+
<map-layer label="Projection not specified" checked>
4651
<map-feature zoom="14">
4752
<map-featurecaption>Copied OSMTILE pcrs location</map-featurecaption>
4853
<map-properties>

custom-projections/Atlas-of-Canada/atlas.mapml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<map-link rel="license" title="Canadian Federal Geospatial Platform" href="https://geoappext.nrcan.gc.ca/arcgis/rest/services/FGP/NCR_RCN/MapServer/"></map-link>
77
<map-meta name="projection" content="ATLAS_POLAR_MAP"></map-meta>
88
<map-meta name="zoom" content="min=0,max=6" ></map-meta>
9+
<map-link rel="suggestions" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}*&amp;num=20"></map-link>
10+
<map-link rel="search" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}&amp;num=20"></map-link>
911
</map-head>
1012
<map-body>
1113
<!--

custom-projections/Atlas-of-Canada/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
let cProjection = map.defineCustomProjection(customProjectionDefinition);
2121
map.projection = cProjection;
2222
</script>
23+
<script src="/shared/script/geogratis-search-handler.js"></script>
2324
</head>
2425
<body>
25-
<mapml-viewer projection="ATLAS_POLAR_MAP" zoom="2" lat="83.48919" lon="-87.7687" controls>
26+
<mapml-viewer projection="ATLAS_POLAR_MAP" zoom="2" lat="83.48919" lon="-87.7687" controls controlslist="search">
2627
<map-layer label="Atlas of Canada Polar Wall Map" checked>
2728
<map-link rel="license" title="Canadian Federal Geospatial Platform" href="https://geoappext.nrcan.gc.ca/arcgis/rest/services/FGP/NCR_RCN/MapServer/"></map-link>
29+
<map-link rel="suggestions" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}*&num=20"></map-link>
30+
<map-link rel="search" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}&num=20"></map-link>
2831
<map-extent units="ATLAS_POLAR_MAP" checked hidden>
2932
<map-input type="zoom" name="z" min="0" max="6" value="6" ></map-input>
3033
<map-input type="location" name="x" axis="column" units="tilematrix" min="116" max="186"></map-input>

custom-projections/BNG/index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@
9898
}
9999
</style>
100100
</noscript>
101-
</head>
101+
<script src="/shared/script/photon-search-handler.js"></script>
102+
</head>
102103
<body>
103104
<!-- when using -->
104-
<mapml-viewer zoom="0" lat="54.41338" lon="-3.19995" controls projection="BNG">
105+
<mapml-viewer zoom="0" lat="54.41338" lon="-3.19995" controls controlslist="search" projection="BNG">
105106
<map-layer label="OS Roads tile map in BNG custom projection" checked>
106107
<map-meta name="projection" content="BNG"></map-meta>
108+
<map-link rel="suggestions" tref="https://photon.komoot.io/api?q={searchTerms}"></map-link>
109+
<map-link rel="search" tref="https://photon.komoot.io/api?q={searchTerms}"></map-link>
107110
<map-extent units="BNG" checked hidden>
108111
<map-input name="z" type="zoom" min="0" max="9"></map-input>
109112
<map-input name="y" type="location" units="tilematrix" axis="row" ></map-input>

custom-projections/bc/bc.mapml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
<map-title>British Columbia Albers base map</map-title>
66
<map-meta name="projection" content="BCTILE"></map-meta>
77
<map-meta name="cs" content="gcrs"></map-meta>
8-
<map-link rel="license" title="Government of British Columbia" href="https://maps.gov.bc.ca/arcserver/rest/services/province/albers_cache/MapServer/wmts/"/>
9-
<map-link rel="zoomout" href="/experiments/linking/features/canada.mapml" />
8+
<map-link rel="license" title="Government of British Columbia" href="https://maps.gov.bc.ca/arcserver/rest/services/province/albers_cache/MapServer/wmts/"></map-link>
9+
<map-link rel="suggestions" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}*&amp;num=20"></map-link>
10+
<map-link rel="search" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}&amp;num=20"></map-link>
1011
</map-head>
1112
<map-body>
1213
<map-extent units="BCTILE" checked="checked" hidden="hidden">
13-
<map-input type="zoom" name="z" min="0" max="11" value="3"/>
14-
<map-input type="location" name="x" axis="column" units="tilematrix" min="42" max="50"/>
15-
<map-input type="location" name="y" axis="row" units="tilematrix" min="56" max="64"/>
16-
<map-link rel="tile" tref="https://maps.gov.bc.ca/arcgis/rest/services/province/albers_cache/MapServer/WMTS/tile/1.0.0/province_albers_cache/default/default028mm/{z}/{y}/{x}.jpg"/>
14+
<map-input type="zoom" name="z" min="0" max="11" value="3"></map-input>
15+
<map-input type="location" name="x" axis="column" units="tilematrix" min="42" max="50"></map-input>
16+
<map-input type="location" name="y" axis="row" units="tilematrix" min="56" max="64"></map-input>
17+
<map-link rel="tile" tref="https://maps.gov.bc.ca/arcgis/rest/services/province/albers_cache/MapServer/WMTS/tile/1.0.0/province_albers_cache/default/default028mm/{z}/{y}/{x}.jpg"></map-link>
1718
</map-extent>
1819
<map-feature id="bcgs">
1920
<map-featurecaption>British Columbia Geological Survey</map-featurecaption>

custom-projections/bc/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@
2020
let cProjection = map.defineCustomProjection(customProjectionDefinition);
2121
map.projection = cProjection;
2222
</script>
23+
<script src="/shared/script/geogratis-search-handler.js"></script>
2324
</head>
2425
<body>
25-
<mapml-viewer zoom="3" lon="-125.667383" lat="54.60128" controls projection="BCTILE">
26+
<mapml-viewer zoom="3" lon="-125.667383" lat="54.60128" controls controlslist="search" projection="BCTILE">
2627
<map-layer label="BC basemap" checked>
2728
<map-link rel="license" title="Government of British Columbia" href="https://maps.gov.bc.ca/arcserver/rest/services/province/albers_cache/MapServer/wmts/"></map-link>
29+
<map-link rel="suggestions" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}*&num=20"></map-link>
30+
<map-link rel="search" tref="https://geogratis.gc.ca/services/geoname/en/geonames.json?q={searchTerms}&num=20"></map-link>
2831
<map-extent units="BCTILE" checked hidden>
2932
<map-input type="zoom" name="z" min="0" max="11" value="3"></map-input>
3033
<map-input type="location" name="x" axis="column" units="tilematrix" min="42" max="50"></map-input>

datacube/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
<title>Minimum Snow and Ice</title>
77
<script type="module" src="../dist/mapml.js"></script>
88
<link rel="stylesheet" href="../global.css">
9+
<script src="/shared/script/geogratis-search-handler.js"></script>
910
</head>
1011
<body>
11-
<mapml-viewer projection="CBMTILE" zoom="4" lat="60" lon="-90" controls>
12+
<mapml-viewer projection="CBMTILE" zoom="4" lat="60" lon="-90" controls controlslist="search">
1213
<map-layer label="CBMT" src="../refactoring-temporary/cbmtile-cbmt.mapml" checked hidden></map-layer>
13-
<map-layer label="Minimum Snow and Ice" src="msi.mapml" checked></map-layer>
14+
<map-layer label="Minimum Snow and Ice" src="msi.mapml" checked opacity="0.7"></map-layer>
1415
<map-layer label="Permanent snow and ice (prob. 94% or more) WMS GetMap" src="msi-94-plus.mapml" checked></map-layer>
1516
</mapml-viewer>
1617
</body>

0 commit comments

Comments
 (0)