=== ClicOnMap2Address ===
Contributors: f4awz
Tags: maps, openstreetmap, geocoding, address, shortcode
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 2.1.32
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Interactive address picker for WordPress with maps, geocoding, REST API, shortcode and form-field synchronization.

== Description ==
ClicOnMap2Address provides an interactive map based on Leaflet. Visitors can select a position by clicking the map, dragging the marker, searching for an address or using browser geolocation. The selected coordinates can be reverse-geocoded into structured address fields and synchronized with compatible form fields.

The plugin can use Nominatim or Photon as the primary geocoder, with the other provider used as a fallback.

== Installation ==

1. Install the plugin from the WordPress plugin directory or copy the `cliconmap2address` directory to `/wp-content/plugins/`.
2. Activate ClicOnMap2Address from the WordPress Plugins screen.
3. Configure the plugin under Plugins > ClicOnMap2Address.
4. Insert `[cliconmap2address]` into a page, post or other shortcode-compatible location.

== Shortcode ==

Basic usage:
`[cliconmap2address]`

Example:
`[cliconmap2address lat="48.8566" lng="2.3522" zoom="13" height="500px" width="100%"]`

Supported shortcode parameters include `lat`, `lng`, `zoom`, `height`, `width` and `search`.

== REST ==

The plugin registers two public GET endpoints used by the frontend:

`/wp-json/cliconmap2address/v1/reverse?lat=48.8566&lng=2.3522`
`/wp-json/cliconmap2address/v1/search?q=Paris`

The endpoints are public because the map is intended to work for visitors who are not logged in. Requests are rate-limited server-side.

== Privacy and external services ==

ClicOnMap2Address communicates with third-party services when a visitor loads map tiles, searches for an address or requests reverse geocoding. The exact provider used depends on the map layer and plugin settings.

* **OpenStreetMap** — the standard map layer loads tiles directly in the visitor's browser from `https://tile.openstreetmap.org/`. The browser therefore connects directly to OpenStreetMap when map tiles are displayed. See the OpenStreetMap tile usage policy: https://operations.osmfoundation.org/policies/tiles/
* **Esri** — the satellite layer loads imagery tiles directly in the visitor's browser from Esri ArcGIS services. See Esri's terms and policies: https://www.esri.com/en-us/legal/terms/full-master-agreement
* **Nominatim** — when selected as geocoder or used as fallback, search queries and latitude/longitude coordinates are sent by the WordPress server to `https://nominatim.openstreetmap.org/`. See the Nominatim usage policy: https://operations.osmfoundation.org/policies/nominatim/
* **Photon** — when selected as geocoder or used as fallback, search queries and latitude/longitude coordinates are sent by the WordPress server to `https://photon.komoot.io/`. See the Photon project documentation and service information: https://photon.komoot.io/

The plugin does not send WordPress passwords, authentication credentials or payment information to these services. Site administrators should review the applicable third-party terms and their own privacy obligations before enabling these features.

== Uninstall ==

Deactivation keeps the plugin settings. Deleting the plugin runs `uninstall.php` and removes plugin-owned settings. Temporary geocoding transients expire automatically. User content and form data are not removed.

== Frequently Asked Questions ==

= Does the plugin require Leaflet? =
Yes. Since version 2.1.18, ClicOnMap2Address uses Leaflet 1.9.4 for map rendering and user interactions. Leaflet is loaded from the unpkg CDN when a shortcode is rendered.

= Does the plugin store map views? =
If "Mémoriser la vue" is enabled, the selected map position and zoom are stored in the visitor's browser using localStorage for the current page.

= Is geocoding performed for every visitor action? =
Reverse geocoding is requested when the selected position changes. Results are cached temporarily by the WordPress server. Search and reverse-geocoding endpoints are rate-limited.


== Changelog ==

= 2.1.24 =
- Ajout/activation du choix Carte / Satellite avec Leaflet.
- Le shortcode accepte layer="map" ou layer="satellite".
- Exemple : [cliconmap2address layer="satellite"]
- Fond satellite fourni par Esri World Imagery, avec attribution affichée.


= 2.1.20 =
* Correction : le bouton « Réinitialiser » restaure désormais les paramètres Latitude, Longitude et Zoom configurés dans Général / Carte.
* La vue mémorisée est ignorée et supprimée lors d’une réinitialisation.


= 2.1.25 =
* Correction des boutons de zoom Leaflet : signes + et − toujours visibles, noirs et sans soulignement.


= 2.1.32 =
* Maintenance release: WordPress.org plugin metadata and packaging compatibility fixes.
