asad231's picture
Create gps.py
3483658 verified
raw
history blame contribute delete
547 Bytes
import folium
from datetime import datetime
# Mock location (replace with real GPS later if needed)
def get_current_location():
return 24.8607, 67.0011 # Karachi coordinates (example)
# Create and save map with marker
def generate_map():
lat, lon = get_current_location()
m = folium.Map(location=[lat, lon], zoom_start=16)
folium.Marker(
[lat, lon],
tooltip="🚨 Theft Detected",
popup=f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}"
).add_to(m)
m.save("map.html")
return "map.html"