=== EffortLess Interactive Map Locator ===
Contributors: domclic
Tags: map, leaflet, locations, custom post type, interactive map
Requires at least: 6.2
Tested up to: 7.0
Stable tag: 2.4.8
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display an interactive map of locations with custom markers and PNG export functionality.

== Description ==

EffortLess Interactive Map Locator is a WordPress plugin that lets you manage and display any type of location on an interactive Leaflet map.

= Key Features =

* **Interactive Map**: Display a Leaflet map with OpenStreetMap or OpenTopoMap tiles
* **Location Management**: Dedicated Custom Post Type for managing locations
* **Custom Markers**: Blue markers for standard locations, red markers for highlighted ones
* **Enhanced Popups**: Display title, image, label, and link to an associated article
* **PNG Export**: Export the complete map as a PNG image (full map view only)
* **Flexible Shortcode**: Display all locations or a single one, with width, height, zoom, and center options
* **Responsive**: Automatically adapts to parent container size
* **Customizable**: Configurable height, width, zoom, map centering, tile layer, and pin visibility

= Shortcode Usage =

**Display all locations (with export button):**
`[eliml_map_locator]`

**Display a specific location:**
`[eliml_map_locator id="123"]`

**Advanced options:**
`[eliml_map_locator zoom="14" height="500px" width="800px"]`
`[eliml_map_locator center="45.8375,4.7792" zoom="13"]`
`[eliml_map_locator pins="no"]`

= Shortcode Parameters =

* `id`: Location post ID to display (optional — omit to display all locations)
* `zoom`: Initial zoom level (default: 16)
* `height`: Map height — any CSS unit, e.g. "600px", "80vh" (default: 600px or parent height)
* `width`: Map width — any CSS unit, e.g. "100%", "800px" (default: 100%)
* `center`: Map center as "latitude,longitude" (optional — auto-calculated from locations)
* `pins`: Set to "no" to hide all location markers (default: "yes")

= Admin Interface =

* **Custom Post Type**: "Locations" in the WordPress menu
* **Custom Fields**:
  - Latitude and Longitude
  - Label / Note (displayed in the map popup)
  - Associated article (filtered by configurable category slugs)
  - "Highlighted" status (displays a red marker)
* **Featured Image**: Displayed in the map popup
* **Shortcode Column**: Copy-paste shortcodes directly from the Locations list
* **Shortcode Reference**: Parameter hint table shown below the Locations list

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/effortless-interactive-map-locator/`
2. Ensure Leaflet files are present in `vendor/leaflet/`:
   - leaflet.css, leaflet.js
   - images/marker-icon.png, marker-icon-2x.png
   - images/marker-icon-red.png, marker-icon-2x-red.png
   - images/marker-shadow.png
3. Activate the plugin through the "Plugins" menu in WordPress
4. Go to "Locations" to add your map locations
5. Use the shortcode `[eliml_map_locator]` in any page or post

== Frequently Asked Questions ==

= How do I add a new location? =

1. Go to "Locations" > "Add New"
2. Enter the title
3. Add a featured image (optional)
4. Fill in the latitude and longitude fields
5. Optionally add a label/note and associate an article
6. Check "Highlighted" to display a red marker
7. Publish

= How do I get GPS coordinates? =

Use Google Maps or OpenStreetMap: right-click the location, select the displayed coordinates, copy the latitude and longitude into the plugin fields.

= The export button doesn't appear =

The PNG export button is only available when the full map is displayed with `[eliml_map_locator]` (no `id` parameter). It requires the user to be logged in, or the "Allow guests to export" setting to be enabled.

= How can I customise the map appearance? =

Add custom CSS in your theme to modify popups, markers, or map controls.

= Markers are not displaying =

Check that marker image files are present in `vendor/leaflet/images/` and that latitude/longitude coordinates are entered in numeric format (e.g. 45.8375, not 45,8375).

= How do I change the base map? =

Go to Locations > Settings and choose between OpenStreetMap (standard) and OpenTopoMap (topographic).

= Does it work with Gutenberg? =

Yes — use the Shortcode block or any text area.

== Screenshots ==

1. Interactive map with blue and red markers
2. Admin interface — adding a location
3. Locations list with shortcode column and reference hint
4. Popup with image and information
5. PNG export button on full map view

== Changelog ==
= 2.4.8 =
* Fixed: add ELIML_SHORTCODE_TAG constant to pin shortcode tag in one authoritative location
* Fixed: add Upgrade Notice for 2.4.7 breaking change
* Fixed: stale CDN claim in readme (easyPrint served locally since 2.4.3)
* Fixed: corrected changelog version ordering (2.4.6 was listed after 2.4.5)
* Fixed: clarified 2.4.7 changelog entry wording

= 2.4.7 =
* Removed: backward-compat shortcode aliases [map_locator] and [cabornes_map] — update any existing usage to [eliml_map_locator] (WordPress.org unique naming requirement)
* Removed: AI-generated docs folder from plugin package

= 2.4.6 =
* Fixed: removed load_plugin_textdomain() call (deprecated since WP 4.6; WordPress.org loads translations automatically)
* Updated: Tested up to WordPress 7.0

= 2.4.5 =
* Added: translation files for French, Spanish, German, Simplified Chinese, Traditional Chinese, English, Japanese, Korean (.po + .mo + .pot)

= 2.4.4 =
* Fixed: add rel="noopener noreferrer" to popup external link (tabnapping best practice)

= 2.4.3 =
* Fixed: add License and Text Domain to plugin header for WordPress.org compliance
* Fixed: load_plugin_textdomain() now called on plugins_loaded
* Fixed: all translatable strings wrapped in __() with correct text domain
* Fixed: leaflet-easyprint loaded from local vendor instead of CDN
* Fixed: add auth_callback and sanitize_callback to all register_post_meta() calls
* Fixed: inline <script> in shortcode replaced with external assets/js/maps.js via wp_add_inline_script()
* Fixed: related post link now uses get_permalink() instead of /?p=ID
* Fixed: "Read more" and "Export map as PNG" strings are now translatable
* Fixed: readme.txt Tested up to corrected to 6.7
* Updated: readme.txt rewritten to remove Cabornes-specific references

= 2.4.2 =
* Security: escape popup title and label to prevent stored XSS
* Security: cast zoom attribute to integer to prevent JS injection
* Fixed: add post_status=publish to location query to prevent draft leakage
* Fixed: id="0" no longer silently returns all locations
* Fixed: pins attribute comparison is now case-insensitive (no/No/NO all hide markers)
* Fixed: marker icons not instantiated when pins="no" (avoids unnecessary image requests)

= 2.4.1 =
* Added: `width` shortcode attribute — set map container width (any CSS unit, default 100%)
* Added: `pins` shortcode attribute — set to "no" to hide all location markers
* Added: Shortcode reference hint below the Locations admin list table

= 2.4.0 =
* Renamed all identifiers from elmwg_/ELMWG_CABORNES_ to eliml_/ELIML_
* Generalized from Cabornes-specific to any type of location
* Added: configurable tile layer (OpenStreetMap / OpenTopoMap) in Settings
* Added: configurable category slugs filter for associated articles
* Changed: "Renovation date" field replaced by generic "Label / Note" text field
* Changed: "Under renovation" checkbox replaced by generic "Highlighted" checkbox
* Changed: shortcode renamed to [eliml_map_locator]
* Changed: CPT renamed to eliml_location with "Location / Locations" labels

= 2.3.1 =
* Add a backup opentopo server

= 2.2.0 =
* Added: PNG map export functionality
* Added: Integration of leaflet-easyprint via CDN
* Added: Export button in the top-left corner (full map only)
* Improved: CSS styling for export button
* Improved: Hide controls in export (zoom, export button)

= 2.1.0 =
* Added: Red markers for Cabornes under renovation
* Added: "Under renovation" field in admin
* Added: Support for "chantier-en-cours" categories
* Improved: Automatic map height management
* Improved: Automatic centering based on locations
* Fixed: Responsive handling and resizing

= 2.0.0 =
* Added: Custom Post Type "Cabornes"
* Added: Meta fields for latitude, longitude, renovation date
* Added: Association with WordPress articles
* Added: Featured image support in popups
* Added: Flexible shortcode with zoom, height, center options
* Added: Shortcode column in admin list

= 1.0.0 =
* Initial release
* Basic Leaflet map with markers

== Upgrade Notice ==

= 2.4.7 =
Breaking change: the shortcode tag has changed. Replace all [map_locator] and [cabornes_map] shortcodes in your posts and pages with [eliml_map_locator] before or after upgrading.

= 2.2.0 =
New PNG export feature to save your maps as images.

= 2.1.0 =
Added red markers to visually identify Cabornes under renovation.

= 2.0.0 =
Complete redesign with Custom Post Type and dedicated admin interface.

== Credits ==

* **Leaflet**: https://leafletjs.com/
* **OpenTopoMap**: https://opentopomap.org/
* **Leaflet.easyPrint**: https://github.com/rowanwins/leaflet-easyPrint
* **OpenStreetMap**: https://www.openstreetmap.org/

== Support ==

For any questions or support requests, please contact domclic.

== Development ==

This plugin is developed and maintained by domclic. Contributions are welcome.

== License ==

This plugin is distributed under the GPLv2 license or later.

== Additional Notes ==

= Browser Compatibility =
* Chrome/Edge: Full support
* Firefox: Full support
* Safari: Full support
* Mobile browsers: Responsive design supported

= Performance =
* Lightweight: Minimal impact on page load times
* Optimized: Efficient marker rendering
* Local assets: Leaflet and easyPrint loaded from bundled vendor files — no external CDN requests

= Privacy =
* No external data collection
* Map tiles loaded from OpenTopoMap servers
* No cookies or tracking