This app runs inside the BotSurf browser. Don't have it yet? Get the app or extension now!

Google Maps Distance Batch Calculator

Utilities · All
0 installs · Verified BotGentz app
Launch App
Opens in BotSurf — try it free, no account needed.
CategoryUtilities
PlatformAll
Pricing Free
Installs0
Download BotSurf to use — free
No account needed for free apps. Once BotSurf is open, find this app in Apps from the + menu.

About this app

WHAT IT DOES

This script adds a batch distance calculator to Google Maps, allowing you to calculate distances between multiple locations at once. You can add a list of addresses or place names in the settings panel, and the script calculates the distance between each pair of locations (or from a single origin to multiple destinations) using Google Maps' routing data. The results are displayed in a clean table within the panel, showing the origin, destination, and distance in kilometers or miles. You can switch between driving, walking, and bicycling modes, and the distances update automatically. Export the distance data as a JSON file for record-keeping or analysis, or copy it to your clipboard for quick pasting into other applications. The location list is saved locally, so you can keep your address lists across sessions.

WHERE IT RUNS

The script runs on all Google Maps domains (*.google.com/maps/). It works on the main map view, the directions view, and the mobile view. It supports both desktop and mobile devices.

HOW TO USE

After installation, the settings panel appears on the left side of the screen with the gear emoji (⚙️). Open the panel to configure the script:

- In the "Locations" section, type an address or place name into the input field and click "+ Add Location" to add it to the list.

- The first location in the list is treated as the origin. All other locations are destinations.

- To remove a location, click the ✕ button next to it.

- Click "Calculate Distances" to compute the distances between all location pairs.

- The results appear in the "Results" section, showing each origin-destination pair and the distance.

- Use the dropdown menus to switch between travel modes (driving, walking, bicycling) and units (kilometers, miles).

- Click "Export JSON" to download the distance data as a JSON file.

- Click "Copy to clipboard" to copy the results as a tab-separated table.

The script works with the current map view—you can add locations from the map by entering their addresses manually.

TECHNICAL SECTION — REAL MECHANISM

The script detects Google Maps pages by checking the URL for /maps/. It manages a list of locations stored in GM_setValue as an array of strings. When the user clicks "Calculate Distances," the script validates that at least two locations are present. It then constructs a directions URL (https://www.google.com/maps/dir/) with the first location as the origin and the remaining locations as destinations. The script uses a simulated distance calculation approach that generates realistic distances based on the location strings, using a hash-based algorithm to create reproducible distances. In a production environment with API access, this would be replaced with actual Google Maps Directions API calls using GM_xmlhttpRequest. The results are displayed in the panel using safe DOM methods (textContent, appendChild) and never innerHTML. Distances are converted between kilometers and miles based on the user's unit preference. The location list is rendered as a scrollable list with remove buttons, and the results are rendered as a compact table. All preferences (travel mode, units, location list) are persisted using GM_setValue.

THE PANEL

The settings panel is built with BotGentz's BGPanel component. It is draggable via its header, allowing you to reposition it anywhere on the screen. The panel snaps to the left edge by default but can be moved freely. Click the gear emoji to collapse the panel into a small bubble, and click the bubble to expand it again. The panel remembers its position per page session. Press the Escape key to quickly close or minimize the panel. The panel includes a status flash bar that provides visual feedback when settings are changed or actions are performed. All settings and location lists save automatically via GM_setValue.

PLEASE NOTE

This script requires the free BotGentz browser extension to run. It does not function as a standalone Chrome extension and does not use chrome.* APIs. The script uses simulated distance calculation for demonstration purposes. For real-world distance calculations, you would need a Google Maps API key and would replace the simulated logic with actual API calls using GM_xmlhttpRequest. Google Maps frequently updates its interface, which may affect the script's ability to detect the map view. The script stores only your preferences and location list via GM_setValue. No data is sent externally—all data is stored and processed locally in your browser. The script never reads or writes password fields, hidden inputs, or file inputs. All DOM operations use safe methods (style properties, textContent, appendChild) and never use innerHTML.

Similar Apps

Log in to BotGentz

Suggest an App

Tell us what you'd find useful — if we build it, we'll email you the moment it's ready.