Skip to content

v4.0.0

Choose a tag to compare

@katemihalikova katemihalikova released this 19 Nov 17:32
· 8 commits to next since this release
7841968

⚠️ Breaking changes

  • Allowed dependency versions of map libraries are updated. See Upgrading from v3 to v4 in README.
    • standalone: unchanged (no particular map library needed)
    • MapLibre GL JS: v6
    • MapTiler SDK JS: v5
    • Leaflet: v2
    • OpenLayers: unchanged (v9.1 or v10)
  • MapTiler SDK control:
    • Markers now use SDK's own Marker and are added to the map with map.addMarker().
    • The marker and showResultMarkers options take SDK's marker options (MapTilerMarkerElementOptions or MapTilerMarkerSVGOptions), e.g. outerColor instead of color and scale as [x, y].
    • The control no longer extends MaplibreglGeocodingControl. Instead, both controls share a base class.
  • Removes the MapLibre GL JS UMD build maplibregl.umd.js. MapLibre GL JS 6 is published only as an ES module. Use the ES module build with a bundler, or MapTiler SDK JS, which has UMD and CDN builds.
  • require() now loads the ES module builds. To use require() with this package, your Node.js should be 20.19+ or 22.12+.
  • POI icons moved in the npm package from dist/icons to icons. This new path was always documented that way and icons being in dist was a v3 regression. The CDN location used by the default iconsBaseUrl is unchanged.
  • The MapLibre GL JS and MapTiler SDK controls no longer extend MapLibre's Evented directly, instead use mixin pattern to combine classes. Methods of Evented work as before, but control instanceof Evented is now false.

✨ Features and improvements

  • Adds maptilersdk.cdn.mjs, an ES module build of the MapTiler SDK control for the CDN, to use without a bundler. It bundles all dependencies except @maptiler/sdk, which user can map to the SDK's CDN ES module with an import map, so the page and the control share one SDK. See Without a bundler in README.
  • MapLibre GL JS and MapTiler SDK controls can be customized by subclasses with the protected methods createMarker, addMarker, setMarkerPopup and adjustRequestUrl.

🐛 Bug Fixes

  • Fixes types under TypeScript moduleResolution node16 and nodenext (#127). Relative imports in the type declarations now have .js extensions, and export * from "." is now export * from "./index.js".
  • Fixes loading the OpenLayers control in Node.js ES modules (e.g. server-side rendering or Vitest's Node environment), and its types under node16 and nodenext. ol imports now use explicit file paths such as ol/control.js instead of directory imports.

⚙️ Others

  • Adds the ./package.json subpath export.
  • Adds new dependency versions to type compatibility checks.
  • Changes TypeScript config to target ES2022 and moduleResolution: "bundler".