location-picker v2.0.0
Modernized release: new toolchain, new API surface, first test suite.
✨ Added
useAdvancedMarkeroption — use Google MapsAdvancedMarkerElementwhen available (falls back to CSS-pin overlay)onLocationChange(pos)option — callback fired on map idledestroy()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 returnsPromise<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.jsonexportsmap,sideEffects,engines
🛠 Migration from v1
- lp.setCurrentPosition();
+ await lp.setCurrentPosition();See CHANGELOG.md and README migration guide for full details.