Skip to content

v2.0.0

Latest

Choose a tag to compare

@cyphercodes cyphercodes released this 12 Apr 02:03

location-picker v2.0.0

Modernized release: new toolchain, new API surface, first test suite.

✨ Added

  • useAdvancedMarker option — use Google Maps AdvancedMarkerElement when available (falls back to CSS-pin overlay)
  • onLocationChange(pos) option — callback fired on map idle
  • destroy() method — removes listeners and overlay DOM
  • Named export: import { LocationPicker } from 'location-picker'
  • Exported types: LocationPickerOptions, LatLng
  • Vitest suite with Google Maps mocks (7 tests)
  • GitHub Actions CI (Node 18/20/22)
  • Modernized demo page (example/index.html) with responsive UI, presets, geolocation button

💥 Breaking changes

  • setCurrentPosition() now returns Promise<LatLng> instead of fire-and-forget
  • Dropped UMD bundle — ESM (dist/index.mjs) + CJS (dist/index.cjs) only
  • Requires Node >=18 for development

🔧 Changed

  • TypeScript 2.6 → 5.6 (strict, noUncheckedIndexedAccess, target ES2020)
  • TSLint → ESLint 9 (flat config) + Prettier
  • Rollup 0.x → Rollup 4 with modern plugins
  • @types/googlemaps@types/google.maps
  • Travis CI → GitHub Actions
  • Added package.json exports map, sideEffects, engines

🛠 Migration from v1

- lp.setCurrentPosition();
+ await lp.setCurrentPosition();

See CHANGELOG.md and README migration guide for full details.