zeba_academy_offline_map
š Offline map, routing, and geofencing toolkit for Flutter
A lightweight, easy-to-use Flutter package for offline maps, custom markers, polylines, offline routing, and geofencing. Built for developers who want a fast, no-bloat solution for map-based apps.
⨠Features
- Offline Map Rendering ā Display maps using OpenStreetMap tiles.
- Custom Markers ā Add personalized marker widgets anywhere on the map.
- Polylines ā Draw routes, paths, or any polyline on the map.
- Offline Routing ā Calculate distances and generate straight-line routes.
- Geo-Fencing ā Define areas and trigger actions on entry/exit events.
- Zero Bloat ā Minimal dependencies, fully production-ready.
š Installation
Add this to your pubspec.yaml:
dependencies:
zeba_academy_offline_map:
path: ../zeba_academy_offline_map # replace with your local path or git repo
Then run:
flutter pub get
ā” Usage Example
import 'package:flutter/material.dart';
import 'package:zeba_academy_offline_map/zeba_academy_offline_map.dart';
class MapScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: OfflineMap(
initialPosition: LatLng(13.0827, 80.2707), // Chennai, India
zoom: 13.0,
markers: [
MapMarker(
position: LatLng(13.0827, 80.2707),
icon: Icon(Icons.location_pin, color: Colors.red, size: 40),
),
],
polylines: [
MapPolyline(
points: [LatLng(13.0827, 80.2707), LatLng(13.085, 80.275)],
color: Colors.blue,
strokeWidth: 3,
),
],
),
);
}
}
šŗ Offline Routing & Distance
final routing = OfflineRouting();
double distance = routing.calculateDistance(
LatLng(13.0827, 80.2707),
LatLng(13.085, 80.275),
);
List<LatLng> route = routing.generateRoute(
LatLng(13.0827, 80.2707),
LatLng(13.085, 80.275),
);
š” Geo-Fencing
final fence = GeoFence(
center: LatLng(13.0827, 80.2707),
radius: 50, // in meters
onEnter: () => print("Entered the zone"),
onExit: () => print("Exited the zone"),
);
fence.check(LatLng(13.083, 80.271)); // returns true/false
š About Me
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects. You can learn more about me and my work at sufyanism.com or connect with me on Linkedin
Your all-in-one no-bloat hub!
š Explore cutting-edge resources in coding, tech, and development at zeba.academy and code.zeba.academy. Empower yourself with practical skills through curated directives, real-world projects, and hands-on experience. Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to coding, technology, and development.
ā” Visit our main site: zeba.academy
ā” Explore hands-on courses and resources at: code.zeba.academy
ā” Check out our YouTube for more tutorials: zeba.academy
ā” Follow us on Instagram: zeba.academy
Thank you for visiting!