Create beautiful, interactive maps with markers, popups, circles, and custom styling using Folium. Perfect for visualizing locations, routes, and geographic data.
- Interactive web-based maps
- Custom markers with icons
- Popup information
- Circle overlays
- Multiple map styles
- Zoom and pan controls
- Export to HTML
- Auto-open in browser
- Pre-built templates
- Custom map creation
- Language: Python
- Libraries:
folium==0.14.0(mapping) - Complexity: Intermediate
pip install -r requirements.txt
python main.py- 12 major capital cities
- Color-coded markers
- Global view
- Educational
- Famous European landmarks
- Circle radius indicators
- Detailed popups
- Travel planning
- User-defined center
- Custom markers
- Flexible zoom
- Personalized maps
- Pan: Click and drag
- Zoom: Scroll or use +/- buttons
- Markers: Click for popup info
- Layers: Toggle different views
- Colors: red, blue, green, purple, orange
- Icons: star, info-sign, home, etc.
- Popups: Custom text and HTML
- Tooltips: Hover information
- OpenStreetMap (default)
- Stamen Terrain
- Stamen Toner
- CartoDB Positron
from main import InteractiveMapsGenerator
# Create generator
generator = InteractiveMapsGenerator()
# Create map
generator.create_basic_map([40.7128, -74.0060], zoom=12)
# Add marker
generator.add_marker(
[40.7589, -73.9851],
"Times Square",
icon_color='red'
)
# Save
generator.save_map('my_map.html')generator.add_circle(
[40.7128, -74.0060],
radius=1000, # meters
popup_text="1km radius",
color='blue'
)- Travel Planning: Mark destinations
- Real Estate: Property locations
- Business: Store locations
- Education: Geography lessons
- Events: Venue mapping
- Delivery: Route planning
- Tourism: Attraction guides
- Research: Data visualization
- Folium library usage
- Geographic coordinates
- Web map creation
- HTML generation
- Interactive visualizations
- Geospatial data
- Map customization
- Latitude: -90 to 90 (N/S)
- Longitude: -180 to 180 (E/W)
- Format: [lat, lon]
New York: [40.7128, -74.0060]
London: [51.5074, -0.1278]
Tokyo: [35.6762, 139.6503]
Sydney: [-33.8688, 151.2093]
data = [[lat1, lon1], [lat2, lon2], ...]
generator.add_heatmap(data)folium.PolyLine(
locations=[[lat1, lon1], [lat2, lon2]],
color='red',
weight=5
).add_to(generator.map)folium.GeoJson(geojson_data).add_to(generator.map)folium.Map(
location=[lat, lon],
tiles='Stamen Terrain' # or 'CartoDB positron'
)folium.Marker(
location=[lat, lon],
icon=folium.Icon(
color='red',
icon='home',
prefix='fa' # Font Awesome icons
)
).add_to(map)popup_html = """
<h3>Location Name</h3>
<p>Description here</p>
<img src="image.jpg" width="200">
"""
folium.Marker(
location=[lat, lon],
popup=folium.Popup(popup_html, max_width=300)
).add_to(map)- Mark all store locations
- Add store details in popups
- Color-code by type
- Show service radius
- Mark destinations
- Connect with routes
- Add notes and photos
- Share with others
- Show event locations
- Add schedule info
- Highlight main venue
- Parking locations
- Use appropriate zoom levels
- Group nearby markers
- Keep popups concise
- Use contrasting colors
- Test on mobile devices
- Optimize for performance
- Add legends when needed
- Marker clustering
- Route optimization
- Distance calculations
- Area measurements
- Custom tile layers
- Offline maps
- GPS integration
- Real-time updates
- Database integration
- API endpoints
- Mobile app version
- Check HTML file location
- Verify coordinates format
- Ensure internet connection
- Check browser console
- Verify coordinate order [lat, lon]
- Check zoom level
- Ensure marker added to map
- Limit number of markers
- Use marker clustering
- Optimize data loading
- Google Maps: Right-click → "What's here?"
- OpenStreetMap: Click location
- GPS devices
- Geocoding APIs
- OpenStreetMap
- Mapbox
- Stamen
- CartoDB
- Google Maps (requires API key)
Open source for educational purposes.