You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

eleventy-plugin-googlestaticmaps

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eleventy-plugin-googlestaticmaps

An Eleventy plugin to make it easier to use Google Static Maps

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Eleventy Plugin - Google Static Maps

This simple plugin adds an Eleventy shortcode for Google Static Maps. This service lets you add simple Google Maps images to your site without needing a JavaScript client in order to render it.

The maps are static (hence the name) but perfect for adding simple maps to your site.

Installation:

First, install the plugin:

npm i eleventy-plugin-googlestaticmaps

Then add it to your .eleventy.js:

const mapPlugin = require('eleventy-plugin-googlestaticmap');

Then to use it, get your key from Google's console and pass it to the plugin:

const GOOGLE_MAPS_KEY = process.env.GOOGLE_MAPS_KEY;

module.exports = function(eleventyConfig) {

	eleventyConfig.addPlugin(mapPlugin, {
		key:GOOGLE_MAPS_KEY
	});

};

Usage

The shortcode staticmap is now available in your templates. The arguments are:

ArgumentRequiredDefault
addresstrue
widthfalse500
heightfalse500
zoomfalse13
maptypefalse"roadmap"

Examples:

<img src="{% staticmap "lafayette, la" %}">

<p>
<img src="{% staticmap "bellingham, wa" 900 900 %}" width="900" height="900">
</p>

<p>
<img src="{% staticmap "moscow" 400 400 13 "satellite" %}">
</p>

FAQs

Package last updated on 02 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts