@openpets/maps
v1.0.15
Published
Comprehensive geocoding, places search, directions, and more
Maintainers
Readme
Maps Plugin
Comprehensive geocoding, places search, directions, and mapping services plugin for OpenCode.
Features
- Geocoding: Convert addresses to coordinates and vice versa
- Places Search: Find nearby restaurants, attractions, and businesses
- Directions: Get driving, walking, and transit directions
- Multiple Providers: Support for Google Maps, Mapbox, and OpenStreetMap
Setup
Environment Variables
Optional environment variables for enhanced functionality:
# Google Maps API key (recommended for best results)
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
# Mapbox access token (alternative provider)
MAPBOX_API_KEY=your_mapbox_access_token
# OpenStreetMap email (improves rate limits)
[email protected]Usage Examples
Basic Queries
# Find coordinates
"find the coordinates of Times Square, New York"
# Search for places
"search for restaurants near Central Park, New York"Scenarios
Geocoding Workflow
"find the coordinates of Times Square, New York"
"now get the timezone for those coordinates"
"check if street view is available there"Trip Planning
"find the coordinates of Eiffel Tower, Paris"
"search for restaurants within 500 meters of those coordinates"
"get directions from Eiffel Tower to the first restaurant"Multi-city Route
"get directions from Times Square to Central Park"
"now get walking directions for the same route"
"calculate the distance between New York and Boston"Testing
# Test basic queries
npm run test:queries
# Test scenarios
npm run test:scenarios
# Run all tests
npm run test:all
# Quick start demo
npm run quickstartAPI Providers
The plugin supports multiple mapping providers:
- Google Maps (Priority 1) - Most comprehensive features
- Mapbox (Priority 2) - Good alternative with competitive pricing
- OpenStreetMap (Priority 3) - Free and open-source option
Configure API keys in your environment to enable specific providers.
