这是indexloc提供的服务,不要输入任何密码

geo_selector 0.0.2 copy "geo_selector: ^0.0.2" to clipboard
geo_selector: ^0.0.2 copied to clipboard

A Flutter package for picking, searching, and selecting locations using OpenStreetMap with address details.

🌍 geo_selector A Flutter widget that provides a map-based location picker with support for: Location search (forward geocoding) Reverse geocoding (get address from lat/lng) My Location button Route planning (optional) with start & end points Integration with OpenStreetMap using flutter_map ✨ Features 📍 Select any location by tapping on the map 🔎 Search for places using address or name (OpenStreetMap Nominatim) 🎯 "My Location" button to jump to device’s current location 🏠 Display the address of the selected point 🚗 Optional Route Mode to calculate routes between two points 🔗 Callbacks return LocationResult and routes (List

class LocationPickerExample extends StatelessWidget { const LocationPickerExample({super.key});

@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: const Text("Select Location")), body: GeoSelector( initialLocation: const LatLng(28.6139, 77.2090), // New Delhi enableMyLocation: true, showAddress: true, enableRoute: true, onLocationSelected: (LocationResult result) { debugPrint("Selected: Lat=${result.latitude}, " "Lng=${result.longitude}, " "Address=${result.address}"); }, onRouteCalculated: (List

LocationResult({ required this.latitude, required this.longitude, this.address, }); } 🔹 Behavior Single Search Mode (default): Tap on map → select location Search bar for address lookup Address shown at bottom Route Mode (if enableRoute = true): Start & End location input fields Buttons to set current selection as Start/End "Calculate Route" → draws polyline on map ⚡ Dependencies flutter_map → Map rendering latlong2 → LatLng model location → Device GPS http → API calls (geocoding/routing) 🔮 Roadmap ✅ Route planning (basic polyline) ✅ Forward & Reverse geocoding 🔲 Autocomplete for search 🔲 Custom map tile provider support 🔲 Offline maps

0
likes
150
points
52
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for picking, searching, and selecting locations using OpenStreetMap with address details.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_map, geocoding, http, latlong2, location

More

Packages that depend on geo_selector