All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Note: Version 0 of Semantic Versioning is handled differently from version 1 and above. The minor version will be incremented upon a breaking change and the patch version will be incremented for features.
- feat: new boolean prop
hideDrawLabels
allows default labels to be hidden whendrawMany
is enabled (#508)
- style: increased visual constrast of drawing points by applying colored stroke rather fill and bumping overall size (#507, #509)
- fix: ensure labels are incremental when drawing many features (#495)
- style: switch direction of reset icon (#498)
- feat: add boolean prop
resetViewOnly
to prevent reset control from clearing drawing data and only reset viewport (#496)
- fix: maintain existing drawing labels when modifying features (#493)
- fix:
drawGeojsonData
accepts individual "Feature" or "FeatureCollection" to work correctly withdrawMany
(#491)
- feat:
drawGeojsonData
will read from GeoJSON property "color" if set, or else fallback to thedrawColor
prop which allows individual features to use different styles whendrawMany
(#492)
- fix: ensure
showCentreMarker
andgeojsonData
layers are correctly ordered on top of basemap when using "MapboxSatellite" (#481) - fix: ensure point features displayed via
geojsonData
have an associated style (#482) - fix: increased
drawMany
label font size and default point size fordrawType="Point"
(#483)
- feat: adds prop
dataTestId
to set adata-testid
on the map's shadow root (#484)
We're starting to work towards a v1.0.0 stable release!
A number of props and dispatched events have been deprecated and condensed:
osVectorTilesApiKey
,osFeaturesApiKey
andosPlacesApiKey
are deprecated in favor of a singleosApiKey
prop (#476)disableVectorTiles
is deprecated in favor of a newbasemap
prop with enum values"OSVectorTile" | "OSRaster" | "MapboxSatellite" | "OSM"
. The default is still"OSVectorTile"
and we'll still fallback to OpenStreetMap if any of the API-dependent basemaps can't be initialised (#476)drawPointColor
,drawFillColor
andfeatureBorderNone
props are deprecated and rolled into existing style props (#473)- The
areaChange
event dispatched indrawMode
has been deprecated and rolled into existinggeojsonChange
event. If yourdrawType="Polygon"
, you'll now simply find anarea
property on the dispatched geojson feature (#466-discussion) - Similarly, the
featuresAreaChange
event dispatched byclickFeatures
has been deprecated and rolled intofeaturesGeojsonChange
event (#479) areaUnit
prop has been deprecated and you'll find the calculated area in bothsquareMetres
andhectares
by default now ingeojsonChange
event data above (#479)
We think the above deprecations will mean simpler, more flexible configurations and subscriptions for end-users, but if you were relying on any of the deprecated props, cannot achieve feature parity with the alternatives, or find a regression we've overlooked, please open an Issue!
- fix:
osCopyright
prop no longer has a default license number, please add your own! (#476) - deps: various dependency updates via Dependabot
- feat: new
basemap
option"MapboxSatellite"
displays aerial imagery; see README "Bring your own API keys" for configuring a Mapbox access token (#475) - feat:
drawMany
prop allows more than one feature to be drawn and will display labels (simple incremental index for now, not customisable). The label and area (ifdrawType="Polygon"
) will be included in theproperties
of each feature dispatched via thegeojsonChange
event (#466) - feat:
drawType
prop adds supported value"Circle"
for drawing & modifying circles; please note this type is still quite experimental and does not yet dispatch ageojsonChange
event ("circles" are not a natively supported type in geojson and we'll need to transform to polygons first) (#465)
- fix(a11y): adds a
role
to the map container div of eitherapplication
if interactive orpresentation
if implemented in static mode (#454)
- deps: various dependency updates via Dependabot
- feat(a11y): adds optional prop
ariaLabelOlFixedOverlay
which sets anaria-label
on the outermostcanvas
element rendered in the shadow root (#445) - fix(a11y): sets
aria-controls
on the OL Attribution control button rendered whencollapseAttributions
is true, and a correspondingid
on the attribution list (#446)
- fix: usability improvements such as stronger focus color contrast and improved keyboard navigation based on recent accessibility audit (#442)
- deps: upgraded to Vite v5, in addition to a number of other Dependabot updates (#441)
- feat: adds new boolean prop
showGeojsonDataMarkers
to display point features passed via thegeojsonData
prop; renames existingshowMarker
boolean prop toshowCentreMarker
for clarity (#429)
- feat: new props
drawGeojsonDataCopyright
,geojsonDataCopyright
, andcollapseAttributes
allow multiple attributions to be set and styled on the map (#424)
- deps: various dependency updates via Dependabot
- fix: now displays vertices for polygons as well as multipolygons that are passed into
drawGeojsonData
prop (#417)
- feat: ability to set a custom border color per feature when passing a
FeatureCollection
intogeojsonData
by reading from the feature'sproperties.color
attribute. Ifproperties.color
is not defined,geojsonColor
will be used to style each feature. (#381)
- feat: add
drawColor
&drawFillColor
props to customise the drawing color. It still defaults to red for the canonical example of location plans. (#379)
- feat: add
clipGeojsonData
prop to disable panning/zooming/navigating the map's viewport beyond a given geojson extent. (#363)
- deps: various dependency updates via Dependabot
- fix: ensure autocomplete selected address formatting always matches option, completing #275 below. (#277)
- fix: split single line addresses on last occurance of council name, not first, in address-autocomplete dropdown options. Our previous string formatting method failed on postcode ME7 1NH (#275)
- feat: Printing (#263)
- chore: Update
@testing-library/dom
andvitest
dependencies to latests (#265)
- fix: correctly project coordinates to EPSG:27700 on GeoJSON change events (coordinates in EPSG:3857 are and were ok!) (#261)
- BREAKING: GeoJSON change events are now dispatched in two projections: EPSG:3857 (prior default) and EPSG:27700. If you are subscribed to these events, please update your code to reflect the new data format (#255)
- fix: display scale bar correctly (#252)
- fix: debug
drawGeojsonData
examples in Pitsy Component Docs (#249)
- feat: add
osProxyEndpoint
prop to support optionally calling the Ordnance Survey APIs via a proxy in public applications to avoid exposing your API keys (#241)
- build: update vitest dependencies
- feat: add
drawingType
prop to specify "Polygon" (default) or "Point" to enable drawing a single point (#232)
- chore: update styling of default scale line (#230)
- chore: swap out north arrow icon and remove unused
resetControlImage
icons (#233) - build: update vite and vitest-related dependencies
- feat:
resetControlImage
prop can be used to specify a custom icon for the reset control button. This is likely a temporary prop while user research testing is conducted, then we will refactor to use a single standard icon (#209)
- feat:
showNorthArrow
boolean prop will show a static North arrow icon in the upper right of the map for official reference ([#198]#198)
- fix: Ensure snap points load on the map's
loadend
event (#193) - test: Added basic suite of OL tests for snap loading, exposing an
olMap
instance on the global window for testing
- feat: Added map property
projection
to specify which system you are supplying coordinates in. Supported values areEPSG:4326
(default),EPSG:27700
, andEPSG:3857
(#168) - feat: Added Vitest framework for unit testing our web components and a Github Action workflow to run tests on all pull requests (#139, #191)
- feat: Added Pitsby interactive documentation for our web components, available at oslmap.netlify.app (#61)
- docs: Updated README to reflect scope of all components and new local dev instructions (#181)
- build: Upgraded multiple project dependencies
- feat:
markerImage
property added to specify a circle (default) or pin icon (#165)
- build: Upgrade development dependency Vite to v3 (#167)
- feat:
showMarker
property added to display a point on the map (defaults to latitude & longitude used to center the map, custom coordinates can be provided usingmarkerLatitude
,markerLongitude
) (#159)
- fix: Ability to remove border style using boolean property
featureBorderNone
when inshowFeaturesAtPoint
mode (#159)
- fix: Update map focus to Gov.UK yellow, adding a black border on map element for sufficient contrast (#147)
- fix: Ensure error container is always in DOM (autocomplete) (#136)
- fix: Re-enable
labelStyle
property (#133)
- feat:
labelStyle
property added to autocomplete (#130)
- fix: Accessibility fixes flagged by auditors (#131)
- feat:
arrowStyle
property added to autocomplete (#128)
- fix: Improve style of autocomplete (#128)
- fix: autocomplete shouldn't have a tabindex on its' container, only the input (#126)
- feat: allow autocomplete to be styled from the parent (#124)
- fix: autocomplete & search should set
tabindex="0"
to ensure they're keyboard accessible (#122)
- feat: address-autocomplete supports a default value using the
initialAddress
property (#120)
- feat: two new components (#93)! file structure & build config are adjusted to reflect a library of components, but no breaking changes to the original map. New components:
<postcode-search />
is a GOV.UK-styled input that validates UK postcodes using these utility methods. When a postcode is validated, an event is dispatched containing the sanitized string.<address-autocomplete />
fetches addresses in a given UK postcode using the OS Places API and displays them using GOV.UK's accessible-autocomplete component. When you select an address, an event is dispatched with the full OS record for that address. Set theosPlacesApiKey
property to start using this component.
- fix: make snap points visible on the first render before any interactions if other conditions are met (
drawMode
is enabled,zoom
is greater than or equal to 20). Previosly, we'd only render snaps after a map move (#112)
- feat: string property
id
now allows users to set a custom id on the custom element<my-map />
. it still defaults toid="map"
as before (#110)
- fix:
featureSource
anddrawingSource
are now cleared upfront when their respective interaction modes (egshowFeaturesAtPoint
,drawMode
) are enabled. This doesn't change anything on the first map render, but should help clear up scenarios where the map has been redrawn with new props but the layer still holds prior data features (#110)
- fix: when in
drawMode
, "reset" control button now dispatches two events to reset area to 0 and empty geojson. Previously, the area and geojson continued to reflect the last drawn polygon (#102) - bump rambda and @types/node dependencies (#107 & #108)
- fix: control buttons are an accessible size (#95)
- fix: add Lit lifecycle method to unmount map (#97)
- upgrade openlayers (#89)
- feat: string property
osCopyright
now allows users to set the map attribution for OS layers based on their own API keys. The default copyright text is updated to reflect our new data agreement with DHLUC (#88)
- BREAKING: removed
ariaLabel
property based on accessibility audit recommendation, as aria-label attributes shouldn't be used on div elements (#86)
- feat: string property
drawPointer
to set the drawing cursor style, defaults to "crosshair" or can be set to "dot" (#84)
- fix: keep snapping behavior while modifying drawn polygon (#83)
- feat:
drawMode
now derives snap-able points from the OS Vector Tiles basemap and displays them by default when the zoom level > 20. The drawing pointer also changed from a red dot to a simple crosshair. (#75)
- fix: updated control button color for more accessible level of contrast (#77)
- fix: ensure prettier is run on precommit hook (#78)
- fix: typo in Readme (#73)
- feat: ability to display a geojson polygon in the initial drawing layer when in
drawMode
, using new object propertydrawGeojsonData
and number propertydrawGeojsonBuffer
(#70) - feat: dispatch events
featuresAreaChange
,featuresGeojsonChange
andgeojsonDataArea
, so that show/click features mode and loading static data has parity with existing event dispatching used in draw mode (#69)
- feat: boolean property
featureFill
to style the fill color of OS Features polygon as the specified stroke color with 20% opacity, disabled/false by default. Same idea as below, my oversight for not combining them into the same release! (#66)
- feat: boolean property
geojsonFill
to style the fill color of a static geojson polygon as the specified stroke color with 20% opacity, disabled/false by default (#64)
- feat: show vertices of the drawn polygon, similar in design to MapInfo Professional which will hopefully help guide users in modifying existing vertices or adding new ones when drawing a site boundary (#57)
- feat: accessibilty improvements, including string property
ariaLabel
to add custom text to describe the component and the ability to access the main map div and control buttons by tabbing (#58) - feat: boolean properties
showScale
anduseScaleBarStyle
to display a scale bar on the map (#60)
- fix: any prior drawings are cleared upon enabling
drawMode
, resolving an edge case that could occur in PlanX 'back' button behavior (#50)
- feat: string property
areaUnit
to specify "m2" for metres squared (default) or "ha" for hectares when returning the total area of a feature (#51) - feat: boolean property
clickFeatures
to extend theshowFeaturesAtPoint
mode, by allowing a user to click to select or de-select features (#48)
- BREAKING:
renderVectorTiles
is renamed todisableVectorTiles
and disabled by default, a convention we'll follow for all boolean property types going forward (#40) - fix: reset control erases drawing when
geojsonData
is also displayed (#42) - fix: total area doesn't return html tags if units are configured to square metres (#43)
- feat: boolean properties
hideResetControl
andstaticMode
to configure visibility of control buttons and allowed user interactions like zooming/dragging (#41)
- BREAKING: Ordnance Survey API keys are now provided client-side as optional properties
osVectorTilesApiKey
,osFeaturesApiKey
(#29) - fix:
geojsonData
now handles{ "type": "Feature" }
in addition to "FeatureCollection" (#34)
- BREAKING:
drawMode
is now disabled by default - upgrade from lit-element > lit (#27)
- feat: query & display features that intersect with lon,lat (#24)
- feat: display a static polygon if geojson provided (#19)
- docs: (update npm badge link)