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: Improved sorting of
address-autocompleteoptions to better highlight flat/parent shell property relationships (#599)
- feat: Improved style override options for new
geocode-autocompletecomponent (#577)
- feat: Added
showGeojsonDataLabelsprop which can be applied when rendering staticgeojsonData. Styles match those used whendrawModeplusdrawManyare used (#574)
- chore: Updated to new OS license number throughout examples and documentation (#572)
- fix:
geocode-autocompleteoutputs coordinates in EPSG:4326 in addition to BNG (#570)
- feat: New
geocode-autocompletecomponent free-text address lookup (#562)
- deps: a number of other package updates via Dependabot
- chore: Remove polyfill.io links (#539)
- deps: now on accessible-autocomplete v3 ! (#554)
- deps: a number of other package updates via Dependabot
- chore: ensured Vite environment variables are not bundled in build files (#533)
- deps: now on OpenLayers v10 ! (#535)
- deps: a number of other package updates via Dependabot
- docs: deployment instructions now added for releases & pre-releases (#511)
- feat: new boolean prop
hideDrawLabelsallows default labels to be hidden whendrawManyis 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
resetViewOnlyto prevent reset control from clearing drawing data and only reset viewport (#496)
- fix: maintain existing drawing labels when modifying features (#493)
- fix:
drawGeojsonDataaccepts individual "Feature" or "FeatureCollection" to work correctly withdrawMany(#491)
- feat:
drawGeojsonDatawill read from GeoJSON property "color" if set, or else fallback to thedrawColorprop which allows individual features to use different styles whendrawMany(#492)
- fix: ensure
showCentreMarkerandgeojsonDatalayers are correctly ordered on top of basemap when using "MapboxSatellite" (#481) - fix: ensure point features displayed via
geojsonDatahave an associated style (#482) - fix: increased
drawManylabel font size and default point size fordrawType="Point"(#483)
- feat: adds prop
dataTestIdto set adata-testidon 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,osFeaturesApiKeyandosPlacesApiKeyare deprecated in favor of a singleosApiKeyprop (#476)disableVectorTilesis deprecated in favor of a newbasemapprop 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,drawFillColorandfeatureBorderNoneprops are deprecated and rolled into existing style props (#473)- The
areaChangeevent dispatched indrawModehas been deprecated and rolled into existinggeojsonChangeevent. If yourdrawType="Polygon", you'll now simply find anareaproperty on the dispatched geojson feature (#466-discussion) - Similarly, the
featuresAreaChangeevent dispatched byclickFeatureshas been deprecated and rolled intofeaturesGeojsonChangeevent (#479) areaUnitprop has been deprecated and you'll find the calculated area in bothsquareMetresandhectaresby default now ingeojsonChangeevent 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:
osCopyrightprop no longer has a default license number, please add your own! (#476) - deps: various dependency updates via Dependabot
- feat: new
basemapoption"MapboxSatellite"displays aerial imagery; see README "Bring your own API keys" for configuring a Mapbox access token (#475) - feat:
drawManyprop 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 thepropertiesof each feature dispatched via thegeojsonChangeevent (#466) - feat:
drawTypeprop adds supported value"Circle"for drawing & modifying circles; please note this type is still quite experimental and does not yet dispatch ageojsonChangeevent ("circles" are not a natively supported type in geojson and we'll need to transform to polygons first) (#465)
- fix(a11y): adds a
roleto the map container div of eitherapplicationif interactive orpresentationif implemented in static mode (#454)
- deps: various dependency updates via Dependabot
- feat(a11y): adds optional prop
ariaLabelOlFixedOverlaywhich sets anaria-labelon the outermostcanvaselement rendered in the shadow root (#445) - fix(a11y): sets
aria-controlson the OL Attribution control button rendered whencollapseAttributionsis true, and a correspondingidon 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
showGeojsonDataMarkersto display point features passed via thegeojsonDataprop; renames existingshowMarkerboolean prop toshowCentreMarkerfor clarity (#429)
- feat: new props
drawGeojsonDataCopyright,geojsonDataCopyright, andcollapseAttributesallow 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
drawGeojsonDataprop (#417)
- feat: ability to set a custom border color per feature when passing a
FeatureCollectionintogeojsonDataby reading from the feature'sproperties.colorattribute. Ifproperties.coloris not defined,geojsonColorwill be used to style each feature. (#381)
- feat: add
drawColor&drawFillColorprops to customise the drawing color. It still defaults to red for the canonical example of location plans. (#379)
- feat: add
clipGeojsonDataprop 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/domandvitestdependencies 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
drawGeojsonDataexamples in Pitsy Component Docs (#249)
- feat: add
osProxyEndpointprop 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
drawingTypeprop 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
resetControlImageicons (#233) - build: update vite and vitest-related dependencies
- feat:
resetControlImageprop 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:
showNorthArrowboolean 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
loadendevent (#193) - test: Added basic suite of OL tests for snap loading, exposing an
olMapinstance on the global window for testing
- feat: Added map property
projectionto 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:
markerImageproperty added to specify a circle (default) or pin icon (#165)
- build: Upgrade development dependency Vite to v3 (#167)
- feat:
showMarkerproperty 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
featureBorderNonewhen inshowFeaturesAtPointmode (#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
labelStyleproperty (#133)
- feat:
labelStyleproperty added to autocomplete (#130)
- fix: Accessibility fixes flagged by auditors (#131)
- feat:
arrowStyleproperty 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
initialAddressproperty (#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 theosPlacesApiKeyproperty to start using this component.
- fix: make snap points visible on the first render before any interactions if other conditions are met (
drawModeis enabled,zoomis greater than or equal to 20). Previosly, we'd only render snaps after a map move (#112)
- feat: string property
idnow allows users to set a custom id on the custom element<my-map />. it still defaults toid="map"as before (#110)
- fix:
featureSourceanddrawingSourceare 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
osCopyrightnow 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
ariaLabelproperty based on accessibility audit recommendation, as aria-label attributes shouldn't be used on div elements (#86)
- feat: string property
drawPointerto 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:
drawModenow 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 propertydrawGeojsonDataand number propertydrawGeojsonBuffer(#70) - feat: dispatch events
featuresAreaChange,featuresGeojsonChangeandgeojsonDataArea, so that show/click features mode and loading static data has parity with existing event dispatching used in draw mode (#69)
- feat: boolean property
featureFillto 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
geojsonFillto 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
ariaLabelto 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
showScaleanduseScaleBarStyleto 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
areaUnitto specify "m2" for metres squared (default) or "ha" for hectares when returning the total area of a feature (#51) - feat: boolean property
clickFeaturesto extend theshowFeaturesAtPointmode, by allowing a user to click to select or de-select features (#48)
- BREAKING:
renderVectorTilesis renamed todisableVectorTilesand disabled by default, a convention we'll follow for all boolean property types going forward (#40) - fix: reset control erases drawing when
geojsonDatais also displayed (#42) - fix: total area doesn't return html tags if units are configured to square metres (#43)
- feat: boolean properties
hideResetControlandstaticModeto 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:
geojsonDatanow handles{ "type": "Feature" }in addition to "FeatureCollection" (#34)
- BREAKING:
drawModeis 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)