Overview
This guide covers how to customize the appearance and behavior of your Folium maps, including markers, popups, base maps, and interactive features.Customizing Markers
Default Markers
The current implementation uses default blue markers:mapita5.py:55-58
Custom Marker Icons
Change marker color, icon, and style:Custom Icon Images
Use custom images as markers:Dynamic Marker Colors
Color-code markers by category or data:Circle Markers
Use circles instead of pins for a cleaner look:Customizing Popups
Current Popup Implementation
mapita5.py:48-58
Enhanced Popup with Styling
Add CSS for better formatting:Popup with Multiple Images
Popup with Video Embed
IFrame Popups
For complex content, use IFrame:Customizing the Base Map
Current Configuration
mapita5.py:40
Different Tile Providers
Change the base map appearance:Available Tile Providers
| Provider | Style | Best For |
|---|---|---|
OpenStreetMap | Default streets | General purpose |
CartoDB positron | Light theme | Clean, minimal |
CartoDB dark_matter | Dark theme | Modern look |
Stamen Terrain | Topographic | Geographic features |
Stamen Watercolor | Artistic | Creative projects |
Esri World Imagery | Satellite | Aerial views |
Map Controls
Customize zoom, scroll, and other controls:Fullscreen Control
Add fullscreen button:Advanced Features
Marker Clustering
Group nearby markers for better performance:Heat Maps
Visualize density of locations:Drawing Tools
Allow users to draw on the map:Minimap
Add overview minimap:Search Control
Add location search:Styling the HTML Output
Custom CSS
Inject custom styles into the generated HTML:Custom JavaScript
Add interactivity:Best Practices
Image Optimization
- Resize before upload: Keep images under 200-300px width for popups
- Compress images: Use JPEG with 70-80% quality
- Use WebP format: Better compression than JPEG (if browser support allows)
Performance
- Limit markers: For 100+ markers, use marker clustering
- Lazy load popups: Don’t embed large content directly
- Cache images locally: As done in
mapita5.py:23-37 - Optimize tile loading: Use appropriate zoom levels
Accessibility
- Alt text: Always include alt attributes on images
- Keyboard navigation: Ensure popups are keyboard accessible
- Color contrast: Use high-contrast colors for text
- Screen reader support: Add ARIA labels where appropriate
Mobile Optimization
Example: Complete Custom Map
Here’s a fully customized version ofmapita5.py:
Next Steps
- Map Overview - Return to overview
- Generation Process - Learn about the map generation workflow