Layers Google Maps Embed
Layers-compatible Google Maps Embed API widget for WordPress
by StoreSeen · github.com/storeseen/layers-google-maps-embed · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/storeseen/layers-google-maps-embed/archive/refs/heads/main.zipA small, reusable WordPress plugin that adds a Layers-compatible Google Maps Embed API widget.
It reuses the API key already stored by Layers at Customizer > Site Settings > Additional Scripts > Google Maps API Key. It does not load the Maps JavaScript API or call the Geocoding API.
Features
- Google Maps Embed API
placemode - Address, place name, place ID, or optional coordinate input
- Zoom, height, roadmap/satellite, and accessible-title controls
- Lazy-loaded responsive iframe
- Layers Customizer selective refresh
- PHP 5.6+ compatibility for older Layers installations
- No JavaScript dependency
Installation
- Download
layers-google-maps-embed.zipfrom the latest GitHub release. - In WordPress, open Plugins > Add New > Upload Plugin.
- Upload and activate the ZIP.
- Ensure the site's existing Google browser key has Maps Embed API enabled.
- Add Google Maps Embed to a widget area in the Customizer.
API key rollout
During migration, the existing per-site key can allow Maps Embed API alongside the APIs required by the old widget. Once the old widget has been removed and the public site has been verified, restrict that key to:
- The site's own HTTP referrers
- Maps Embed API only
Never commit an API key to this repository. The browser key is read at runtime from the Layers theme setting.
Development
Run the dependency-free PHP smoke tests:
php tests/run.php
Create the installable ZIP on Windows:
./scripts/build.ps1