@defra/interactive-map 0.0.23-alpha → 0.0.24-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/images/light-raster-thumb.jpg +0 -0
- package/assets/images/outdoor-raster-thumb.jpg +0 -0
- package/assets/images/road-raster-thumb.jpg +0 -0
- package/docs/plugins/search.md +70 -0
- package/package.json +16 -2
- package/plugins/beta/draw-ml/dist/css/index.css +1 -21
- package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
- package/plugins/beta/draw-ml/src/api/editFeature.js +9 -4
- package/plugins/beta/draw-ml/src/modes/createDrawMode.js +11 -3
- package/plugins/interact/src/hooks/useAttachEvents.test.js +3 -0
- package/plugins/search/dist/esm/im-search-plugin.js +1 -1
- package/plugins/search/dist/esm/index.js +1 -1
- package/plugins/search/dist/umd/im-search-plugin.js +1 -1
- package/plugins/search/dist/umd/index.js +1 -1
- package/plugins/search/src/Search.jsx +2 -1
- package/plugins/search/src/components/Form/Form.jsx +11 -7
- package/plugins/search/src/components/Form/Form.test.jsx +23 -1
- package/plugins/search/src/datasets.js +2 -2
- package/plugins/search/src/datasets.test.js +1 -1
- package/plugins/search/src/defaults.js +7 -1
- package/plugins/search/src/events/fetchSuggestions.js +13 -10
- package/plugins/search/src/events/fetchSuggestions.test.js +14 -1
- package/plugins/search/src/events/formHandlers.js +2 -4
- package/plugins/search/src/events/formHandlers.test.js +3 -3
- package/plugins/search/src/events/inputHandlers.js +1 -1
- package/plugins/search/src/events/inputHandlers.test.js +1 -1
- package/plugins/search/src/events/suggestionHandlers.js +2 -1
- package/plugins/search/src/events/suggestionHandlers.test.js +7 -1
- package/plugins/search/src/index.js +3 -7
- package/plugins/search/src/reducer.js +10 -5
- package/plugins/search/src/reducer.test.js +2 -1
- package/plugins/search/src/utils/parseOsNamesResults.js +3 -3
- package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -0
- package/providers/beta/openlayers/dist/esm/index.js +1 -0
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +2 -0
- package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js.LICENSE.txt +1 -0
- package/providers/beta/openlayers/dist/umd/index.js +2 -0
- package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +1 -0
- package/providers/beta/openlayers/src/appEvents.js +50 -0
- package/providers/beta/openlayers/src/appEvents.test.js +140 -0
- package/providers/beta/openlayers/src/defaults.js +36 -0
- package/providers/beta/openlayers/src/index.js +21 -0
- package/providers/beta/openlayers/src/mapEvents.js +132 -0
- package/providers/beta/openlayers/src/mapEvents.test.js +197 -0
- package/providers/beta/openlayers/src/openlayersProvider.js +234 -0
- package/providers/beta/openlayers/src/openlayersProvider.test.js +331 -0
- package/providers/beta/openlayers/src/utils/spatial.js +142 -0
- package/providers/beta/openlayers/src/utils/spatial.test.js +117 -0
- package/providers/beta/openlayers/src/utils/zoom.js +26 -0
- package/providers/beta/openlayers/src/utils/zoom.test.js +23 -0
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/src/utils/highlightFeatures.js +17 -7
- package/providers/maplibre/src/utils/highlightFeatures.test.js +17 -0
- package/providers/maplibre/src/utils/patternImages.js +14 -9
- package/providers/maplibre/src/utils/patternImages.test.js +2 -1
- package/rollup.esm.mjs +14 -3
- package/src/App/hooks/useFeatureItems.test.js +1 -0
- package/src/App/hooks/useLayoutMeasurements.test.js +0 -1
- package/src/App/hooks/useMarkersAPI.test.js +1 -0
- package/src/App/hooks/useModalPanelBehaviour.test.js +2 -1
- package/src/App/store/AppProvider.test.jsx +5 -0
- package/src/App/store/MapProvider.test.jsx +8 -1
- package/src/services/announcer.test.js +5 -7
- package/webpack.dev.mjs +6 -1
- package/webpack.umd.mjs +1 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/plugins/search.md
CHANGED
|
@@ -116,6 +116,20 @@ CSS width of the search input on tablet and desktop. For example `'300px'`.
|
|
|
116
116
|
|
|
117
117
|
---
|
|
118
118
|
|
|
119
|
+
### `placeholder`
|
|
120
|
+
**Type:** `string`
|
|
121
|
+
**Default:** `'Search'`
|
|
122
|
+
|
|
123
|
+
Placeholder text shown in the search input when it is empty.
|
|
124
|
+
|
|
125
|
+
```js
|
|
126
|
+
searchPlugin({
|
|
127
|
+
placeholder: 'Search for a location'
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
119
133
|
### `expanded`
|
|
120
134
|
**Type:** `boolean`
|
|
121
135
|
**Default:** `false`
|
|
@@ -127,6 +141,62 @@ Controls whether the search input is always visible or hidden behind an open but
|
|
|
127
141
|
|
|
128
142
|
---
|
|
129
143
|
|
|
144
|
+
### `minSearchLength`
|
|
145
|
+
**Type:** `number`
|
|
146
|
+
**Default:** `3`
|
|
147
|
+
|
|
148
|
+
Minimum number of characters the user must type before a search is triggered.
|
|
149
|
+
|
|
150
|
+
```js
|
|
151
|
+
searchPlugin({
|
|
152
|
+
minSearchLength: 4
|
|
153
|
+
})
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### `maxSuggestions`
|
|
159
|
+
**Type:** `number`
|
|
160
|
+
**Default:** `8`
|
|
161
|
+
|
|
162
|
+
Maximum number of suggestions shown in the autocomplete list. Applies to OS Names results; custom datasets control their own result counts via `parseResults`.
|
|
163
|
+
|
|
164
|
+
```js
|
|
165
|
+
searchPlugin({
|
|
166
|
+
maxSuggestions: 5
|
|
167
|
+
})
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### `noResultsMessage`
|
|
173
|
+
**Type:** `string`
|
|
174
|
+
**Default:** `'No results available'`
|
|
175
|
+
|
|
176
|
+
Message shown below the search input when a query returns no results.
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
searchPlugin({
|
|
180
|
+
noResultsMessage: 'No matching locations found'
|
|
181
|
+
})
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
### `searchErrorMessage`
|
|
187
|
+
**Type:** `string`
|
|
188
|
+
**Default:** `'Sorry, there was a problem with search'`
|
|
189
|
+
|
|
190
|
+
Message shown below the search input when one or more datasets returns an error response. Shown in place of `noResultsMessage` when an error occurs.
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
searchPlugin({
|
|
194
|
+
searchErrorMessage: 'Search is temporarily unavailable'
|
|
195
|
+
})
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
130
200
|
### `includeModes`
|
|
131
201
|
**Type:** `string[]`
|
|
132
202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra/interactive-map",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24-alpha",
|
|
4
4
|
"description": "An accessible map component",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
"./providers/esri": {
|
|
25
25
|
"import": "./providers/beta/esri/dist/esm/index.js"
|
|
26
26
|
},
|
|
27
|
+
"./providers/openlayers": {
|
|
28
|
+
"import": "./providers/beta/openlayers/dist/esm/index.js",
|
|
29
|
+
"require": "./providers/beta/openlayers/dist/umd/index.js"
|
|
30
|
+
},
|
|
27
31
|
"./plugins/scale-bar": {
|
|
28
32
|
"import": "./plugins/beta/scale-bar/dist/esm/index.js",
|
|
29
33
|
"require": "./plugins/beta/scale-bar/dist/umd/index.js"
|
|
@@ -116,15 +120,25 @@
|
|
|
116
120
|
]
|
|
117
121
|
},
|
|
118
122
|
"peerDependencies": {
|
|
119
|
-
"@arcgis/core": "^5.0.9"
|
|
123
|
+
"@arcgis/core": "^5.0.9",
|
|
124
|
+
"ol": "^10.9.0",
|
|
125
|
+
"proj4": "^2.20.8"
|
|
120
126
|
},
|
|
121
127
|
"peerDependenciesMeta": {
|
|
122
128
|
"@arcgis/core": {
|
|
123
129
|
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"ol": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
134
|
+
"proj4": {
|
|
135
|
+
"optional": true
|
|
124
136
|
}
|
|
125
137
|
},
|
|
126
138
|
"devDependencies": {
|
|
127
139
|
"@arcgis/core": "^5.0.9",
|
|
140
|
+
"ol": "^10.9.0",
|
|
141
|
+
"proj4": "^2.20.8",
|
|
128
142
|
"@babel/core": "^7.28.0",
|
|
129
143
|
"@babel/plugin-transform-runtime": "^7.29.0",
|
|
130
144
|
"@babel/preset-env": "^7.28.0",
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
.touch-vertex-target circle {
|
|
2
|
-
fill: var(--map-overlay-foreground-color);
|
|
3
|
-
}
|
|
4
|
-
.touch-vertex-target path {
|
|
5
|
-
fill: var(--map-overlay-halo-color);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.im-c-actions .im-c-button-wrapper--draw-done,
|
|
9
|
-
.im-c-actions .im-c-button-wrapper--draw-menu,
|
|
10
|
-
.im-c-actions .im-c-button-wrapper--draw-cancel {
|
|
11
|
-
width: 33.33%;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-done,
|
|
15
|
-
.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-menu,
|
|
16
|
-
.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-cancel,
|
|
17
|
-
.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-done,
|
|
18
|
-
.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-menu,
|
|
19
|
-
.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-cancel {
|
|
20
|
-
width: 100px;
|
|
21
|
-
}
|
|
1
|
+
.touch-vertex-target circle{fill:var(--map-overlay-foreground-color)}.touch-vertex-target path{fill:var(--map-overlay-halo-color)}.im-c-actions .im-c-button-wrapper--draw-done,.im-c-actions .im-c-button-wrapper--draw-menu,.im-c-actions .im-c-button-wrapper--draw-cancel{width:33.33%}.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-done,.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-menu,.im-o-app--tablet .im-c-actions .im-c-button-wrapper--draw-cancel,.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-done,.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-menu,.im-o-app--desktop .im-c-actions .im-c-button-wrapper--draw-cancel{width:100px}
|