Skip to content

Fix map rendering and add error handling#7

Open
kdsmith10000 wants to merge 1 commit intopythonagham:mainfrom
kdsmith10000:fix/map-rendering-and-error-handling
Open

Fix map rendering and add error handling#7
kdsmith10000 wants to merge 1 commit intopythonagham:mainfrom
kdsmith10000:fix/map-rendering-and-error-handling

Conversation

@kdsmith10000
Copy link

Summary

  • Fix Zoom_start to zoom_start - This case-sensitive typo was causing the map to render blank
  • Add comprehensive error handling - The app now gracefully handles invalid phone numbers, failed geocoding, and missing results instead of crashing silently
  • Improve phone number parsing - Auto-adds + prefix for numbers starting with a digit, and uses US as a fallback region
  • Fix open_map() function - Uses absolute file path so the HTML file opens correctly regardless of working directory
  • Add API key documentation - Added comment clarifying the API key must be kept in quotes

Changes

  • Fixed folium Map parameter from Zoom_start=9 to zoom_start=9
  • Added try/except blocks with user-friendly error messages
  • Added input validation and sanitization
  • Improved the open_map() function to check if file exists before opening

Test plan

  • Enter a valid phone number with country code (e.g., +14155551234)
  • Enter a phone number without + prefix (e.g., 14155551234)
  • Enter an invalid phone number to verify error handling
  • Click "Location" button to verify map opens correctly
  • Verify map is no longer blank

- Fix Zoom_start to zoom_start (case-sensitive parameter) which caused blank map
- Add error handling for invalid phone numbers and failed geocoding
- Auto-add + prefix for numbers starting with country code digit
- Add US as fallback region for phone number parsing
- Fix open_map to use absolute file path
- Add user feedback for errors instead of silent failures
- Add comment clarifying API key must be kept in quotes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant