gmaps
Version, currently main branch1 version
- main branchlatestFeb 4, 2025
github.com/dsisnero/gmaps
A library to call the google maps app and get directions and a cli that finds nearest hospital
Installation
# Add this to your shard.yml
dependencies:
gmaps:
github: dsisnero/gmaps
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
1.8.2- License
- MIT
- Author
- dsisnero
- Target
gmapsfrom src/gmaps.cr
Dependencies
Runtime Dependencies
- totem*github: icyleaf/totem
- dotenv*github: drum445/dotenv
- poncho*github: icyleaf/poncho
- secrets*gitlab: HCLarsen/secrets
- win32cr*github: mjblack/win32cr
- haversine*github: geocrystal/haversine
- athena-spec*github: athena-framework/spec
- athena-console*github: athena-framework/console
Development Dependencies
- vcr*github: spoved/vcr.crdev
README
gmaps
Google Maps and Nearest Hospital Finder CLI
This repository contains a command-line tool for finding the nearest hospitals using Google Maps APIs and displaying the driving directions. It also provides functionality to generate a static map image of the directions.
Prerequisites
Before using this tool, make sure you have the following prerequisites installed:
- Crystal
- A Google Cloud Platform (GCP) project with enabled APIs and API key
Getting Started
Installation
-
Add the dependency to your
shard.yml:dependencies: gmaps: github: dsisnero/gmaps -
Run
shards install
Usage
Setting Up Google Cloud APIs
To use Google Cloud APIs, you'll need to:
-
Get an API Key:
- Access the Google Cloud Console
- Create or select a project
- Enable the required APIs:
- Google Maps JavaScript API
- Google Places API
- Directions API
- Geocoding API
- Create credentials (API Key) in "APIs & Services" > "Credentials"
- Optionally restrict your API key for security
-
Configure Your API Key:
You have two options to configure your API key:
a. Environment Variable:
export GOOGLE_MAPS_API_KEY="your-api-key-here"b. Permanent Configuration:
gmaps edit_api_key your-api-key-hereThis will securely store your API key in an encrypted configuration file.
-
Using the Commands:
Find nearest hospitals:
gmaps nearest_hospital --lat <latitude> --lng <longitude>Get a satellite image:
gmaps get_satellite_image --lat <latitude> --lng <longitude> --output_file <path>
Contributing
- Fork it (https://github.com/dsisnero/gmaps/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- dsisnero - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Feb 4, 2025
- Crystal
1.8.2- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dsisnero/gmaps
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1