Maplace.js

Changelog

Every change to the Maplace.js library that a reader would notice, newest first, with the issue it closed if any. Written in CHANGELOG.md with each change.

Markdown

1.2.0 (2026-11-19)

  • Added dashed and dotted lines: strokeDash ("solid", "dashed", "dotted") in a polyline’s style and the route’s, scaled by the line’s width and kept in every state, on Google and MapLibre.
  • Added a line’s travelled part: progress (0 to 1) and travelledStyle on a polyline and on the route, drawing the part travelled at 40% of the line’s opacity and the rest as the line, without computing a route again; on Google, the route is then drawn by Maplace.js in Google’s look.
  • Added pointAlong(line, fraction), the point a fraction of the way along a polyline as drawn or a route result’s path, for a marker of your own moving along a line.
  • Added active and activeStyle on shapes (the active and active-style attributes of <maplace-location>) and the store’s activeStyle option: a shape the page marks as its current one is drawn in the hovered look, under hovered and selected.
  • Changed ShapeStyle to no longer extend LineStyle whole (it leaves out strokeDash, as a closed shape’s outline is solid) and the drawable an adapter draws to carry strokeDash, active, activeStyle, progress and travelledStyle; the conformance suite’s new line-looks group checks them, so an adapter running every group draws them.
  • Added routes on MapLibre through your own routing: createMapLibreAdapter({ computeRoute }), createMapLibreMap’s computeRoute and <maplace-map>’s computeRoute property, a function given each stop where it is drawn (RouteRequest) and answering the route’s legs and path (RouteAnswer), so setRoute, via, travelMode, avoid, routeChange and route-failed work on MapLibre as on Google; the route draws under every location and takes no click
  • Added group paths: a location’s group can be a path of up to 3 names, outermost first (group: ["Europe", "Italy"]; on <maplace-location>, group='["Europe","Italy"]', and a GeoJSON feature’s group property as a list): the list nests a subgroup’s section in its parent’s, each a group, a native select naming it by its path (“Europe › Italy”); a group in setFilter or a heatmap’s groups takes its subgroups, matched from the top; and with groupCounts a heading counts everything under it
  • Added groupFilter and groupFilterLabel to the list view (group-filter and group-filter-label on <maplace-map>, props of <LocationList>): a “Groups” button above the list, saying how many are ticked, that opens a checkbox for each group, subgroups nested and a group partly ticked when some of its subgroups are, setting the filter’s groups and keeping its query and tags
  • Changed the types of Location.group, LocationFilter.groups and HeatmapOptions.groups to take a path (string | readonly string[]), so TypeScript code reading them as a string narrows them first; and <maplace-location group> starting with [ is read as a JSON path, so a name such as “[Draft] Rome” is misuse there (it still works as a string in locations)
  • Added a heatmap of a store’s markers on Google and MapLibre (heatmap: { groups, maxZoom }, a marker’s weight, and heatmap and heatmap-max-zoom on <maplace-map>, weight on <maplace-location>): the markers in its groups drawn as heat weighted against the heaviest when zoomed out, fading into a dot per marker, sized by its weight, over the 2 zooms before maxZoom; the list, search and filter narrow the heat, other groups stay pins, and the selected or hovered one is drawn as a pin over it. A marker in the heat can’t have an icon or be editable; with the heatmap capability an adapter declares, and not with cluster
  • Changed a hovered or selected shape’s outline to draw over the shapes stacked in front of it on Google and MapLibre, the hovered one’s on top, then the selected one’s, so a smaller neighbour no longer hides half of it; the shape itself keeps its place, so what the pointer reaches is unchanged, and on Google an editable shape’s outline stays where it is
  • Changed a popup opened by hover (openOn: "hover") to let the pointer through to the map while it shows the hovered location rather than the selected one, on Google and MapLibre: what it covers answers hover and click as if it were not there, so moving between neighbouring shapes no longer sticks to the last one or, on MapLibre, flickers over its own shape; the selected location’s popup still takes the pointer, for its close button and links
  • Added type: "multipolygon" locations (polygons, each a polygon’s path and holes): several polygons drawn, hovered, selected and listed as one location on Google and MapLibre, shown at their largest polygon, never editable, with the multipolygon capability an adapter declares to draw them; code with an exhaustive switch or Record over a location’s or a Geometry’s type, an adapter’s among them, gains a case
  • Changed locationsFromGeoJSON to read a MultiPolygon feature as one multipolygon location instead of refusing it
  • Added popup-open-on on <maplace-map>: hover opens a location’s popup under the pointer, as the store’s popup.openOn does
  • Fixed a pressed button of the list’s area switch, or of the “My location” box, losing its tint under the pointer on a MapLibre map: the tints are background images now, so a page’s own colour for the pressed button needs background or background-image to replace them
  • Fixed a tap on a touch screen leaving the list’s area switch, or the “My location” box, tinted as if hovered
  • Fixed a MapLibre map under 256px tall, zoomed all the way out, reporting a zoom below 0, which the store refused with an uncaught invalid-input: it reports 0
  • Added globe on MapLibre maps (createMapLibreAdapter, createMapLibreMap, and globe, globe-position and globe-label on <maplace-map>): the map opens as a globe, with a toggle on the map that flattens it and turns it back

1.1.0 (2026-11-13)

  • Fixed a Google popup’s content sitting 12px from the bubble’s left edge but 30px from its right and bottom in Chromium and Safari: its sides and bottom now match the room Google keeps for its scrollbars, 18px there, 12px where it keeps none, and its title lines up with it
  • Added geodesic on a polyline: each segment drawn along its great circle, the shortest way, the same on Google and MapLibre
  • Added curve on a polyline: each segment bowed, for the look, the same on Google and MapLibre

1.0.2 (2026-11-09)

  • Fixed whenReady() and loadState ready on MapLibre (and its adapter’s apply) resolving before the locations were drawn when MapLibre was slow to load them (its workers starting, a busy machine): they now wait for the load, up to 10 s, and give only the drawing its 1 s cap, so a click or a hover right after finds what was added

1.0.1 (2026-11-08)

  • Changed the MapLibre CDN script to bundle maplibre-gl 6.16.0, and Maplace.maplibre with it
  • Fixed MapLibre maps on maplibre-gl 6.16 and later saying nothing when its worker can’t start (a page opened as a file, a content security policy without worker-src): the map fails with provider-load-failed again
  • Fixed tools that read only package.json’s top-level types field, such as npm’s types badge, finding no TypeScript types: the field now names the core entry’s declarations

1.0.0 (2026-11-07)

  • Changed everything: Maplace.js 1.0 is a rewrite with no jQuery. A list of locations becomes a map with a list kept in sync beside it, on Google Maps or MapLibre, from HTML, a page’s own script, a bundler or React; see the README, MIGRATION.md for moving a 0.2 page, and the 1.0 RFC
  • Changed the npm package’s name to @maplacejs/maplace (0.2 was maplace-js)
  • Changed the licence from MIT to Apache-2.0
  • Changed what Maplace.js needs: evergreen browsers (ES2022) and ES modules only, with no CommonJS build; React 19 for @maplacejs/maplace/react, and maplibre-gl installed beside @maplacejs/maplace/maplibre, both optional peers
  • Removed 0.2’s API: new Maplace(options).Load(), its options and its callbacks each have a 1.0 replacement, named in MIGRATION.md
  • Added a headless store, createMaplace, holding the locations, the selection, hover, a filter, a route and the view, with an event for each change, drawn on a map by a provider’s adapter
  • Added <maplace-map> and <maplace-location> (@maplacejs/maplace/element): a map, its list and its locations written in HTML, with maplace-* DOM events, and template types for Vue and Svelte
  • Added three CDN scripts and no build step: Google’s, Google’s with clustering, and MapLibre’s with maplibre-gl bundled, each pinnable with an integrity hash and setting a Maplace global for a page’s own script
  • Added @maplacejs/maplace/google: Google Maps through its current libraries (advanced markers, map IDs, Routes), createGoogleMap as 0.2’s one call, and Maps JS added to the page by Maplace.js itself given apiKey
  • Added @maplacejs/maplace/maplibre: MapLibre GL JS on OpenFreeMap’s tiles or any style, with no key, drawing everything Google does but routes
  • Added @maplacejs/maplace/react: <MaplaceProvider>, <MaplaceMap>, <LocationList>, <MapControl>, <MyLocation> and useMaplace(), popups and markers as React content, ready for Server Components
  • Added HTML popups made safe: content as text or a node of yours, and html passed through your sanitizer (sanitize), never written to the page as it came
  • Added support for a strict Content Security Policy: no inline styles (default styles are adopted stylesheets), a nonce for the Maps JS script Maplace.js adds, and the MapLibre script’s worker started from a blob: URL
  • Added the map’s look per provider: on Google a map ID, a light, dark or system colour scheme and Google’s map options (color-scheme, map-options); on MapLibre any style URL or style object (map-style)
  • Added drawing on a map of your own: hand Maplace.js an existing Google or MapLibre map and it adds its markers, shapes and list without moving or removing your map
  • Added markers (the provider’s pin, an image or your own HTML), circles, polylines and polygons, each selectable and hoverable with styles of its own for both, and editable by dragging, the edit reported as it happens
  • Added clustering on both providers (cluster), keeping thousands of points fast
  • Added routes on Google: a drive through your locations, passing through via points, avoiding tolls, highways or ferries, with turn-by-turn steps for each leg
  • Added the list view, in sync with the map either way: grouped, as a list or a native select, with a “fit all” entry, a heading and group counts, or a list view of your own through defineListView
  • Added mapClick, a click on the map itself with its position, for a page adding a place where the visitor clicks, as 0.2’s listeners allowed; and listed: false, a location on the map but in no list, as 0.2’s on_menu: false
  • Added search and filters: a search box over the list, setFilter({ query, groups, tags }), and a location’s tags and searchText
  • Added a list that follows the map: “This area” lists only what is in view, following the map as it moves
  • Added “My location”: the visitor’s position asked for only on a press, and the list sorted by distance from it or from any point
  • Added an Open in Maps link and a directions link at the end of a popup
  • Added accessibility throughout: the list and the markers usable by keyboard, a link to skip the map, each selection announced and focus kept where it was; the site’s accessibility statement says what was tested
  • Added default styles that any rule of your page wins over, classes and custom properties to style by, and data-maplace-unstyled to turn the defaults off
  • Added consent-friendly loading: hold, with a ready-made “Load map” panel naming the provider, and loading="lazy", so nothing reaches the provider until the visitor allows it or scrolls to the map
  • Added url-state: the selection kept in the page’s address, a link to share, back and forward stepping through it
  • Added the map’s first view from HTML: center and zoom, selected-id, or a location’s own zoom
  • Added locationsFromGeoJSON, turning a GeoJSON FeatureCollection’s points, lines and polygons into locations #188
  • Added a recipe for addresses: a short Node script that geocodes a file of places once, before the page ships #174
  • Added maps that cope with real pages: a map in a closed tab or a hidden panel, or resized, shows its view again when it comes back, and a page with many maps doesn’t run out of WebGL contexts
  • Added TypeScript types for the whole API, and errors with a code and the field at fault for every misuse
  • Added @maplacejs/maplace/testing: the conformance suite Maplace.js’s own adapters pass, for proving an adapter of your own
  • Added a new site at maplacejs.com: 25 examples, each run live as HTML, Script, Bundler and React on both providers; a reference page for each part of the API; a snippet builder taking CSV, JSON, GeoJSON or a 0.2 config; and the docs in Markdown with an agent skill for AI tools
  • Added contributing rules, a security policy, a code of conduct and forms for bug reports and feature requests

0.2.10 (2017-04-02)

  • Fixed afterRoute not passing the status or location of a dragged route #147 #139
  • Added a listener for insert_at polygon events #164

0.2.9 (2017-03-26)

  • Fixed afterCloseInfowindow not firing after a close #137
  • Changed every event function to run with the current Maplace instance as this

0.2.8 (2017-03-26)

  • Fixed controls duplicated by SetLocations #161
  • Fixed setting the info windows’ maxWidth #160

0.2.7 (2016-03-12)

  • Fixed 0.2.6 not loading maps #132
  • Fixed the documented listener example #127

0.2.0 (2015-12-21)

  • Changed to jQuery ~2.1
  • Changed the build’s output directory from src to dist, built with Grunt
  • Changed the in-map menu’s default border colour to match Google Maps’ new UI

0.1.3 (2014-07-12)

  • Added circles, mixed with markers
  • Removed the hide_marker option, for consistency with visible
  • Added the map’s initial centre and zoom
  • Fixed editable polylines and polygons with visible markers
  • Added drag events for markers, circles, polylines and polygons
  • Changed public functions to return this, for chaining
  • Changed the commons option to shared, which each location’s own options override
  • Changed the debug output

0.1.2 (2014-01-07)

  • Fixed several bugs

0.1.0 (2013-02-22)

  • Added Maplace.js: Google Maps locations with a menu, from a list