=== ExpressMaps ===
Contributors: expressmaps
Tags: map, maps, openstreetmap, vector tiles, google maps alternative
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fast, privacy-friendly OpenStreetMap maps with a block or shortcode. A Google Maps alternative with 100,000 free map loads a month.

== Description ==

ExpressMaps adds a map to any page or post using the [ExpressMaps](https://www.expressmaps.com/) vector tile service, an OpenStreetMap-based alternative to Google Maps. Maps are rendered in the browser with [MapLibre GL JS](https://maplibre.org/) (open source, BSD 3-Clause).

**Features**

* `[expressmaps]` shortcode with latitude, longitude, zoom, style, size, marker and popup options.
* "ExpressMaps Map" block for the block editor with a live preview and inspector controls for the same options.
* Ten map styles: standard, basic, enhanced, darklands, greyscale, navigator, subtle, autobahn, lithium, mulberry.
* Multiple maps on one page.
* Assets are loaded only on pages that contain a map.
* Vector tiles only; MapLibre handles everything once it has the style URL. No extra token setup.

**Getting an API key**

Sign up at [expressmaps.com/signup](https://www.expressmaps.com/signup). The free plan gives 100,000 map loads a month, no card needed. Create a key in the [console](https://www.expressmaps.com/console/keys) and restrict it to your site's domain, then paste it into Settings > ExpressMaps.

**Bundled library**

MapLibre GL JS 4.7.1 (BSD 3-Clause licence, https://github.com/maplibre/maplibre-gl-js) is bundled in `assets/vendor/maplibre-gl/`. No scripts are loaded from third-party CDNs.

== External services ==

This plugin displays maps from the ExpressMaps tile service, which is required for it to work. When a visitor views a page containing a map, their browser requests the map style, vector tiles, fonts and icons from `tiles.expressmaps.com`. Those requests include your ExpressMaps API key, the visitor's IP address and the address of the page (the referrer), which the service uses to check the key's domain restriction and to count map loads. No cookies are set and the plugin sends nothing from your server.

ExpressMaps is provided by ExpressMaps: [terms of service](https://www.expressmaps.com/tos), [privacy policy](https://www.expressmaps.com/privacy).

Map data is from OpenStreetMap contributors and the attribution is shown on every map.

== Installation ==

1. Upload the `expressmaps` folder to `/wp-content/plugins/`, or install the ZIP from Plugins > Add New.
2. Activate the plugin.
3. Go to Settings > ExpressMaps, paste your API key and pick a default style.
4. Add the "ExpressMaps Map" block to a page, or use the shortcode:

`[expressmaps lat="51.5" lng="-0.12" zoom="13" style="standard" height="400px" marker="true" popup="Our office"]`

**Shortcode attributes**

* `lat` – latitude (-90 to 90). Default 51.5.
* `lng` – longitude (-180 to 180). Default -0.12.
* `zoom` – zoom level (0 to 22). Default 13.
* `style` – one of standard, basic, enhanced, darklands, greyscale, navigator, subtle, autobahn, lithium, mulberry. Defaults to the style chosen in Settings.
* `height` – CSS height, e.g. `400px` or `60vh`. Default 400px.
* `width` – CSS width, e.g. `100%` or `600px`. Default 100%.
* `marker` – `true`/`false`, show a marker at the centre. Default true.
* `popup` – plain text shown when the marker is clicked.
* `controls` – `true`/`false`, show zoom/rotate controls. Default true.
* `key` – optional API key override for this map.

== Frequently Asked Questions ==

= Do I need a credit card? =

No. The free plan includes 100,000 map loads per month with no card required.

= Where do I get an API key? =

Sign up at https://www.expressmaps.com/signup and create a key at https://www.expressmaps.com/console/keys. Restrict the key to your domain there.

= Is my API key secret? =

It is sent to visitors' browsers as part of the map style URL, as with any client-side map service. Domain restriction in the console prevents it from being used on other sites. The plugin never prints the key anywhere else and makes no server-side requests.

= Can I put several maps on one page? =

Yes. Each shortcode or block creates its own map.

= Can I change the map style per map? =

Yes, with the `style` attribute on the shortcode or the Style dropdown in the block.

= Does it work without JavaScript? =

No. MapLibre renders the map in the browser.

= Is the OpenStreetMap attribution shown? =

Yes. The plugin always adds the MapLibre attribution control, which displays the OpenStreetMap contributors credit from the style.

== Changelog ==

= 1.0.1 =
* Fix: the block preview now works in the iframed block editor in WordPress 6.3 and later.

= 1.0.0 =
* Initial release: settings page, `[expressmaps]` shortcode, "ExpressMaps Map" block with live preview, ten styles.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
