A Chrome browser extension that automatically extracts and geocodes location mentions from web pages, displaying them on an interactive map or in a list view.
- 🔍 Automatic Location Detection - Scans web pages for geographic locations (cities, countries, regions)
- 🗺️ Interactive Map - Visualize locations on an OpenStreetMap-powered map with Leaflet.js
- 📍 Marker Clustering - Intelligent clustering for better performance with many locations
- 📋 List View - Toggle between map and detailed list views
- 📥 Country-Specific Data - Download GeoNames data for specific countries for improved accuracy
- 📤 CSV Export - Export discovered locations to CSV format
- 🆓 No API Key Required - Uses free OpenStreetMap tiles (no Google Maps API key needed)
- ⚡ Fast & Offline - Built-in database with 33,000+ major cities, expandable with country data
- Research - Quickly identify all locations mentioned in academic papers or articles
- Travel Planning - Extract destinations from travel blogs and guides
- News Analysis - Map out locations mentioned in news articles
- Content Creation - Gather geographic references from source material
- Data Analysis - Export location data for further processing
-
Clone the repository
git clone https://github.com/yourusername/geolocator.git cd geolocator -
Load the extension in Chrome
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked"
- Select the
geolocatordirectory
- Open Chrome and navigate to
-
Done! Click the GeoLocator icon in your extensions toolbar to open the sidepanel
- Navigate to any web page with location mentions (e.g., Wikipedia, news articles, travel blogs)
- Click the GeoLocator extension icon to open the sidepanel
- Click "Scan Current Page" to extract locations
- Review detected countries and select which ones to download detailed data for
- Click "Download & Scan" to get more accurate results with country-specific data
- View results in list or map view
- Export to CSV if needed
- Toggle to map view by clicking the 🗺️ Map button
- Zoom in/out to see markers cluster and uncluster automatically
- Click markers to see location details (name, country, coordinates, population)
- Pan around to explore the geographic distribution
- Shows all detected locations with details
- Country, coordinates, and population (if available)
- Export to CSV for further analysis
-
Background Service Worker (
background/background.js)- Manages IndexedDB database
- Handles GeoNames data downloads
- Performs geocoding and location matching
-
Sidepanel UI (
sidepanel/)- Main user interface
- List/Map view toggle
- Country selection and download management
-
Map Visualization (
map/)- Leaflet.js-based interactive map
- Marker clustering with leaflet.markercluster
- PostMessage communication with sidepanel
-
Geocoding Engine (
geocoder/)- Text extraction and location detection
- Fuzzy matching algorithms
- Country-specific data integration
- GeoNames - Free geographic database (cities15000.txt for major cities)
- OpenStreetMap - Free map tiles via Leaflet.js
- Country Data - Downloaded on-demand from GeoNames (http://download.geonames.org/)
- Manifest V3 - Latest Chrome extension standard
- Leaflet.js - Open-source mapping library (bundled locally)
- IndexedDB - Client-side database for location data
- OpenStreetMap - Free map tiles
- GeoNames - Geographic name database
storage- Save downloaded country data and settingssidePanel- Display UI in Chrome's sidepanelactiveTab- Access current tab content for scanningscripting- Inject content scripts to extract page texttabs- Detect active tab URL
geolocator/
├── background/ # Service worker
│ └── background.js
├── content/ # Content script
│ └── content.js
├── data/ # Bundled location data
│ └── cities15000.json
├── geocoder/ # Geocoding engine
│ ├── geocoder.js
│ └── textExtractor.js
├── lib/ # Third-party libraries (bundled)
│ ├── leaflet/ # Leaflet.js
│ └── leaflet.markercluster/
├── map/ # Map visualization
│ ├── map.html
│ ├── map.js
│ └── images/ # Marker icons
├── sidepanel/ # Main UI
│ ├── sidepanel.html
│ ├── sidepanel.css
│ └── sidepanel.js
├── utils/ # Shared utilities
│ ├── constants.js
│ ├── database.js
│ ├── downloader.js
│ └── message.js
├── assets/ # Icons
│ ├── icon16.png
│ ├── icon48.png
│ └── icon128.png
└── manifest.json # Extension manifest
- Clone the repository
- Make your changes
- Reload the extension in
chrome://extensions/ - Test thoroughly
- UI Changes:
sidepanel/sidepanel.html,sidepanel/sidepanel.css - Geocoding Logic:
geocoder/geocoder.js - Map Features:
map/map.js - Data Processing:
background/background.js
- Very large pages (100,000+ words) may be slow to process
- Some ambiguous location names may be incorrectly geocoded
- Country detection requires exact country name matches
- Support for custom location databases
- Batch processing of multiple tabs
- More export formats (GeoJSON, KML)
- Location filtering by country/region
- Improved fuzzy matching for misspellings
- Support for historical place names
- Heatmap visualization mode
MIT License
Copyright (c) 2024 GeoLocator
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- GeoNames - Free geographic database (http://www.geonames.org/)
- Leaflet.js - Open-source mapping library
- OpenStreetMap - Free map tiles and data
- leaflet.markercluster - Marker clustering plugin
Contributions are welcome! Please feel free to submit a Pull Request.
For issues, questions, or suggestions, please open an issue on GitHub.
Note: This extension uses the GeoNames database under the Creative Commons Attribution 4.0 License. Please comply with their usage terms: http://www.geonames.org/export/