This action generates a custom-styled static map image using the Google Maps
Static API and save it to repository as .png
.
It supports:
- generating a map with best quality that the API allows
- Map style customization through
src/map-style.json
Tip
Find more styles in SNAZZY
- Apply a Google Maps Static API Key
- Set it as an Action Secret named
MAP_API_KEY
in your GitHub repository's Settings > Secrets and variables > Actions
google_static_map_api_key
address
: the detail address of the map center, check here for validationzoom
: The zoom level of the map. Typically ranges from 0 (world view) to 20+ (building level).output
: output path and filename for the generated map image
- name: Generate google static map
uses: sn-f-qr/google-map-generator@v1
with:
google_static_map_api_key: ${{ secrets.MAP_API_KEY }}
address: 'Shinjuku, Tokyo'
zoom: '8'
output: 'public/generated-map.png'
See actual usage