Skip to content

Update google-maps-search extension #17775

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ca29748
Update google-maps-search extension
chrismessina Mar 12, 2025
f3ef14e
Slight tweak to location dropdown.
chrismessina Mar 12, 2025
71479f6
Update google-maps-search extension
chrismessina Mar 12, 2025
54dd7df
refactor: rename files from kebab-case to camelCase
chrismessina Mar 13, 2025
cc4d266
Update google-maps-search extension
chrismessina Mar 14, 2025
1fd7c6a
Added info about getting an API key
chrismessina Mar 16, 2025
30d10f9
Remove API Key
chrismessina Mar 16, 2025
708e6b3
Use proper icon image sourcing
chrismessina Mar 16, 2025
3515d20
Update google-maps-search extension
chrismessina Apr 29, 2025
329f5ce
Update google-maps-search extension
chrismessina Apr 29, 2025
ff9df2a
remove kebab files
andreaselia Apr 29, 2025
17ed24f
Update README.md
chrismessina May 3, 2025
6da435d
Update Git Ignore.
chrismessina May 5, 2025
adf34d8
refactor: improve error handling, caching, and type safety based on g…
chrismessina May 6, 2025
0541b58
Add task to TODO
chrismessina May 6, 2025
83642ea
Merge remote-tracking branch 'upstream/main' into ext/google-maps-search
chrismessina May 6, 2025
c8795b5
Merge remote-tracking branch 'upstream/main' into ext/google-maps-search
chrismessina May 6, 2025
238cb19
chore: upgrade @raycast/utils from 1.17.0 to 1.19.1
chrismessina May 6, 2025
1779d36
chore: update dependencies and add react-devtools package
chrismessina May 6, 2025
3f4e11a
refactor: move AI configuration from package.json to ai.yaml and upda…
chrismessina May 7, 2025
53879c3
docs: mark completion of moving AI evaluations to ai.yaml file
chrismessina May 7, 2025
6c07a9b
Add @location command task.
chrismessina May 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions extensions/google-maps-search/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules

# misc
.DS_Store
.DS_Store
.windsurf/rules
2 changes: 2 additions & 0 deletions extensions/google-maps-search/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
audit=false
fund=false
40 changes: 39 additions & 1 deletion extensions/google-maps-search/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
# Google Maps Search Changelog
## [2.0] - {PR_MERGE_DATE}

## [Chore: Fixed throttle issue] - 2025-03-10
### Added
- Added integration of Google Places API (which requires an API key)
- Added "Copy Coordinates URL" feature that makes it easy to get coordinates for a location ([#16136](https://github.com/raycast/extensions/issues/16136))
- Added improved sorting options for nearby places (by proximity, rating, and price)
- Added preference for unit system (imperial or metric)
- Added persistent search settings via LocalStorage for better user experience
- Added support for saving and removing recent searches
- Added AI Tools to search places, get addresses and place details, and to show results on a map (works with @location)
- Added dedicated utility files for better code organization:
- `use-geocoding.ts` hook for centralized geocoding logic
- `validation.ts` for form input validation
- `api-helpers.ts` for standardized API request handling
- `storage-helpers.ts` for robust LocalStorage operations
- `location-helpers.ts` for location data handling
- `formatting.ts` with comprehensive formatting utilities

### Changed
- Improved toast messages with clearer instructions and error handling
- Consolidated place type management by creating `./src/types`
- Enhanced UI with better accessibility and more consistent icons
- Improved distance calculation and formatting with proper unit system support
- Optimized performance for place search results rendering
- Improved autofill support and UI text ([#5511](https://github.com/raycast/extensions/issues/5511)) ([#5690](https://github.com/raycast/extensions/issues/5690))
- Improved type safety throughout the codebase:
- Replaced `any` types with proper type definitions
- Enhanced `StorageValue` type with recursive JSON-serializable definition
- Added type predicates for runtime validation
- Standardized error handling across all API requests and storage operations
- Improved code formatting and organization with consistent style

### Fixed
- Fixed empty callback functions in navigation flow
- Fixed issue with place details not loading correctly in some cases
- Resolved inconsistent behavior when switching between search types

## [Chore: Fixed throttle issue] - 2025-03-10

- Fixed [#15062](https://github.com/raycast/extensions/issues/15062)

## [Added preferred starting location] - 2024-11-20

Expand Down
58 changes: 53 additions & 5 deletions extensions/google-maps-search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,65 @@

## Setup

1. Enter your home address in the Raycast preferences. It will be used to quickly pull up directions to your home.
2. Select your preferred mode of travel. This will be the default for all searches.
3. For full functionality, you should allow [Google Maps](https://www.google.com/maps) to access your location in your preferred browser. This way, `Get Me Home` and `Get Me Somewhere` will immediately pull up directions starting from your current location.
1. You'll need a Google Places API key to use the full functionality of this extension. To obtain one:
- Go to the [Google Cloud Console](https://console.cloud.google.com/)
- Create a new project or select an existing one
- Navigate to APIs & Services > [Library](https://console.cloud.google.com/apis/library)
- Enable the [**Places API**](https://console.cloud.google.com/apis/library/places-backend.googleapis.com), [**Maps JavaScript API**](https://console.cloud.google.com/apis/library/maps-backend.googleapis.com), [**Maps Static API**](https://console.cloud.google.com/apis/library/static-maps-backend.googleapis.com), [**Geocoding API**](https://console.cloud.google.com/apis/library/geocoding-backend.googleapis.com)
- Navigate to APIs & Services > [Credentials](https://console.cloud.google.com/apis/credentials)
- Create an API key under APIs & Services > Credentials
- Enter this API key in the Raycast extension preferences
2. Enter your home address in the Raycast preferences. It will be used to quickly pull up directions to your home.
3. Select your preferred mode of travel. This will be the default for all searches.
4. For full functionality, you should allow [Google Maps](https://www.google.com/maps) to access your location in your preferred browser. This way, `Get Me Home` and `Get Me Somewhere` will immediately pull up directions starting from your current location.

## Searching

Use the extension's search fields as you would use the ones on Google Maps. They can take regular addresses, as well as building names.

## Autofill
## AI Tools

This extension provides the option to autofill the destination field of the `Search Google Maps` and `Get Me Somewhere` commands. The field will be filled using highlighted text or the last copied text if enabled. Enable it in the extension's settings.
This extension provides several AI tools that can be used with Raycast AI to enhance your Google Maps experience:

### Find Places

Find places by name or description. Simply ask Raycast AI to find places matching your query.

**Example prompts:**

- "Find coffee shops in San Francisco"
- "Show me pizza restaurants near downtown"
- "What are some parks in Seattle?"

### Get Directions

Get directions between locations with your preferred mode of transportation.

**Example prompts:**

- "How do I get to the Empire State Building?"
- "Get directions from Central Park to Times Square"
- "Show me walking directions to the nearest grocery store"

### Get Place Details

Get detailed information about a specific place, including address, phone number, website, opening hours, and reviews.

**Example prompts:**

- "Tell me about Golden Gate Park"
- "What are the details for Statue of Liberty?"
- "Show me information about Eiffel Tower"

### Search Nearby Places

Find places of a specific type near a location.

**Example prompts:**

- "Find restaurants near my home"
- "What are some open cafes near Central Park?"
- "Show me gas stations within 5 miles of my current location"

## Privacy

Expand Down
6 changes: 6 additions & 0 deletions extensions/google-maps-search/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# TODO

- [ ] Handle case with expired or invalid API key
- [ ] Improve performance when executing Search Places
- [ ] Make the @location tool explicitly mentioned to be used from commands
- [X] Move AI evals to ai.yaml file
110 changes: 110 additions & 0 deletions extensions/google-maps-search/ai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
instructions: |
When asked about a place's details, first search for the place using searchPlaces and then get detailed information using getPlaceDetails. When asked about distance to a place, first search for the place using searchPlaces and then calculate the distance using getDistance.

evals:
- input: "@google-maps-search find restaurants in San Francisco"
mocks:
searchPlaces: |
Here are some places matching "restaurants in San Francisco":

- **Lazy Bear**
Address: 3416 19th St, San Francisco, CA 94110, USA
Rating: 4.5/5
Status: Open Now
[View on Google Maps](https://www.google.com/maps/search/Lazy+Bear+3416+19th+St%2C+San+Francisco%2C+CA+94110%2C+USA)

- **Nopa**
Address: 560 Divisadero St, San Francisco, CA 94117, USA
Rating: 4.6/5
Status: Closed
[View on Google Maps](https://www.google.com/maps/search/Nopa+560+Divisadero+St%2C+San+Francisco%2C+CA+94117%2C+USA)

- **State Bird Provisions**
Address: 1529 Fillmore St, San Francisco, CA 94115, USA
Rating: 4.5/5
Status: Open Now
[View on Google Maps](https://www.google.com/maps/search/State+Bird+Provisions+1529+Fillmore+St%2C+San+Francisco%2C+CA+94115%2C+USA)
expected:
- callsTool:
name: "searchPlaces"

- input: "@google-maps-search show me a nearby coffee shop on a map"
mocks:
searchPlaces: |
Here is a place matching "coffee shop":

- **Damask Rose**
Address: 6606 Shattuck Ave., Oakland, CA 94609, United States
Rating: 4.9/5
Status: Open Now
[View on Google Maps](https://www.google.com/maps/search/?api=1&query=Damask%2520Rose%25206606%2520Shattuck%2520Ave.%252C%2520Oakland%252C%2520CA%252094609%252C%2520United%2520States)
showPlacesOnMap: |
# Place on Map

[![Map of place](https://maps.googleapis.com/maps/api/staticmap?size=600x400&format=png32&scale=2&maptype=roadmap&markers=color:red%7Clabel:A%7C37.811722,-122.267222&visible=37.811722,-122.267222&key=)](https://www.google.com/maps?q=37.8117223,-122.2672224)

## Place Shown

1. Damask Rose
expected:
- callsTool:
name: "searchPlaces"
- callsTool:
name: "showPlacesOnMap"

- input: "@google-maps-search tell me about the Ferry Building in San Francisco"
mocks:
searchPlaces: |
Here is a place matching "Ferry Building in San Francisco":

- **Ferry Building**
Address: Ferry Building, San Francisco, CA 94111, USA
Rating: 4.7/5
Status: Open Now
[View on Google Maps](https://www.google.com/maps/search/?api=1&query=Ferry%2520Building%2520Ferry%2520Building%252C%2520San%2520Francisco%252C%2520CA%252094111%252C%2520USA)
getPlaceDetails: |
# Ferry Building

**Address**: Ferry Building, San Francisco, CA 94111, USA
**Phone**: +1 415-983-8000
**Website**: [https://www.ferrybuildingmarketplace.com/](https://www.ferrybuildingmarketplace.com/)
**Rating**: ★★★★★ (4.7) based on 25,413 reviews
**Price Level**: $$

**Status**: Open Now

**Opening Hours**:
- Monday: 7:00 AM – 10:00 PM
- Tuesday: 7:00 AM – 10:00 PM
- Wednesday: 7:00 AM – 10:00 PM
- Thursday: 7:00 AM – 10:00 PM
- Friday: 7:00 AM – 10:00 PM
- Saturday: 8:00 AM – 10:00 PM
- Sunday: 8:00 AM – 10:00 PM

**Categories**: tourist_attraction, food, point_of_interest, establishment

**Links**:
- [View on Google Maps](https://www.google.com/maps/search/Ferry+Building+Ferry+Building%2C+San+Francisco%2C+CA+94111%2C+USA)
- [Get Directions](https://www.google.com/maps/dir/?api=1&destination=Ferry+Building%2C+San+Francisco%2C+CA+94111%2C+USA&travelmode=driving)
expected:
- callsTool:
name: "searchPlaces"
- callsTool:
name: "getPlaceDetails"

- input: "@google-maps-search how do I get from Fisherman's Wharf to Alcatraz Island?"
mocks:
getDirections: |
## Directions to Alcatraz Island

From: Fisherman's Wharf
To: Alcatraz Island
Mode: Driving

[Open Directions in Google Maps](https://www.google.com/maps/dir/?api=1&origin=Fisherman%27s+Wharf&destination=Alcatraz+Island&travelmode=driving)

You can view turn-by-turn directions, traffic information, and estimated travel time by opening the link in Google Maps.
expected:
- callsTool:
name: "getDirections"
Binary file added extensions/google-maps-search/assets/no-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading