Skip to content

Commit 8d7459c

Browse files
Peter Rushforthprushforth
authored andcommitted
Specify search and suggestions link rel values
Specify controlslist search token value Add default (GeoJSON) search to example
1 parent ae7e087 commit 8d7459c

6 files changed

Lines changed: 151 additions & 9 deletions

File tree

schema/mapml-viewer.rnc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,18 @@ mapml-viewer = element mapml-viewer { map-layer*,
77
attribute zoom {text},
88
attribute projection { "OSMTILE" | "CBMTILE" | "APSTILE" | "WGS84" },
99
attribute controls {text}?,
10-
attribute controlslist { text }?,
10+
attribute controlslist {
11+
list {
12+
(
13+
"nofullscreen" |
14+
"nolayer" |
15+
"nozoom" |
16+
"nolocate" |
17+
"geolocation" |
18+
"search"
19+
)*
20+
}
21+
}?,
1122
attribute height {text}?,
1223
attribute width {text}?,
1324
attribute static {text}?,
@@ -28,7 +39,19 @@ map-link = element map-link {
2839
# can have a tref (when in extent) or an href (but not both)
2940
attribute tref { text }?,
3041
# @rel=alternate + @projection=tcrs-name is proposed as a way of negotiating the tcrs of the service: https://github.com/Maps4HTML/MapML/issues/11
31-
attribute rel { text },
42+
attribute rel {
43+
"alternate" |
44+
"self" |
45+
"style" |
46+
"tile" |
47+
"image" |
48+
"features" |
49+
"query" |
50+
"search" |
51+
"suggestions" |
52+
"self style" |
53+
"style self"
54+
},
3255
attribute projection { "OSMTILE" | "CBMTILE" | "APSTILE" | "WGS84" }?,
3356
attribute title { text }?,
3457
attribute type { text }?,

schema/mapml-viewer.xhtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- validate with mapml-viewer.rnc, then mapml-viewer.sch. <mapml-viewer> is a
22
custom element that goes in the <body> element of an HTML document -->
3-
<mapml-viewer lat="45" lon="180" projection="CBMTILE" zoom="11" controls="controls" height="240" controlslist="nofullscreen geolocation noscale" xmlns="http://www.w3.org/1999/xhtml">
3+
<mapml-viewer lat="45" lon="180" projection="CBMTILE" zoom="11" controls="controls" height="240" controlslist="search nofullscreen geolocation noscale" xmlns="http://www.w3.org/1999/xhtml">
44
<map-caption>A pleasing map of Canada</map-caption>
55
<map-layer src=""></map-layer>
66
<map-layer label="CBMT" src="https://geogratis.gc.ca/mapml/en/cbmtile/cbmt/" checked="foo"></map-layer>

schema/mapml.rnc

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,19 @@ map-link = element map-link {
88
# can have a tref (when in extent) or an href (but not both)
99
attribute tref { text }?,
1010
# @rel=alternate + @projection=tcrs-name is proposed as a way of negotiating the tcrs of the service: https://github.com/Maps4HTML/MapML/issues/11
11-
attribute rel { text },
11+
attribute rel {
12+
"alternate" |
13+
"self" |
14+
"style" |
15+
"tile" |
16+
"image" |
17+
"features" |
18+
"query" |
19+
"search" |
20+
"suggestions" |
21+
"self style" |
22+
"style self"
23+
},
1224
attribute projection { "OSMTILE" | "CBMTILE" | "APSTILE" | "WGS84" }?,
1325
attribute title { text }?,
1426
attribute type { text }?,

spec/examples/cbmt.mapml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<map-meta charset="utf-8" ></map-meta>
55
<map-meta content="text/mapml" http-equiv="Content-Type" ></map-meta>
66
<map-link rel="license" href="https://www.nrcan.gc.ca/earth-sciences/geography/topographic-information/free-data-geogratis/licence/17285" title="Canada Base Map © Natural Resources Canada"></map-link>
7+
<map-link rel="search" tref="https://photon.komoot.io/api/?q={searchTerms}"></map-link>
8+
<map-link rel="suggestions" tref="https://photon.komoot.io/api/?q={searchTerms}"></map-link>
79
</map-head>
810
<map-body>
911
<map-extent units="CBMTILE" checked="">

spec/examples/map-2.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
</noscript>
4444
</head>
4545
<body>
46-
<mapml-viewer projection="CBMTILE" zoom="15" lat="45.4215" lon="-75.6972" controls controlslist="geolocation">
46+
<mapml-viewer projection="CBMTILE" zoom="15" lat="45.4215" lon="-75.6972" controls controlslist="geolocation search">
4747
<map-layer label="Canada Base Map - Transportation (CBMT)" src="cbmt.mapml" checked></map-layer>
4848
</mapml-viewer>
4949
</body>

0 commit comments

Comments
 (0)