gmaps
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-here
This 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
gmaps
- 0
- 0
- 0
- 0
- 9
- 14 days ago
- September 7, 2023
MIT License
Mon, 17 Feb 2025 19:31:36 GMT