=== Orchestra Map ===
Contributors: swulabs
Tags: orchestra, map, leaflet, directory, shortcode
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.9.90
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Interactive orchestra map powered by Leaflet. Manage orchestra entries and display them on a map, in a list, or with a search bar.

== Description ==

**Orchestra Map** lets you build an interactive directory of orchestras (or any kind of location-based entries) and display them on a Leaflet map, in a filterable list, or with a standalone search bar.

= Core features (free) =

* **Interactive map** via [orchestra_map] shortcode – powered by Leaflet.js and MarkerCluster
* **List view** via [orchestra_list] shortcode – filterable, connected to the map
* **Search bar** via [orchestra_search] shortcode – communicates with map and list via DOM events
* **Add / edit / delete** orchestras in a clean admin UI
* **Built-in fields**: Name, Website, Email, Venue name, Address, ZIP, City, Country
* **Custom Fields** – add, reorder, and label your own data columns in the Fields settings page
* **Design settings** – customise map colors, fonts and sizes in the Design settings page
* **Geocoding** – converts addresses to coordinates automatically via OpenStreetMap Nominatim (free, no API key required)
* **Shortcode reference** – full attribute documentation for all shortcodes, right in the admin

= Pro add-on =

The **Orchestra Map Pro** add-on (sold separately at [swulabs.com](https://swulabs.com/code/orchestra-map/)) extends the free plugin with:

* Import & Export (CSV / Excel)

= Shortcode reference =

Site-wide defaults (colors, initial map view, which fields show where) are configured on the Design and Fields admin pages. The attributes below only override those defaults for a single shortcode instance – see the in-plugin "Shortcode" admin page for the full reference.

**[orchestra_map]**

| Attribute | Default | Description |
|---|---|---|
| height | 600px | Map height (any CSS value) |
| lat | 51.1657 | Initial map center latitude |
| lng | 10.4515 | Initial map center longitude |
| zoom | 6 | Initial zoom level |
| address | (none) | Initial map center as an address, auto-geocoded and cached (overrides lat/lng) |
| radius_km | (none) | Fit the initial view to this radius in kilometers (overrides zoom) |
| search | yes | Show integrated search (yes/no) |
| search_position | top | Search position (top/bottom) |

**[orchestra_list]** – displays a filterable table of all geocoded orchestras.

**[orchestra_search]** – standalone search input; communicates with the map and list via the custom DOM events `om:filter` and `om:select`.

== Installation ==

1. Upload the `orchestra-map` folder to `/wp-content/plugins/`.
2. Activate the plugin via *Plugins → Installed Plugins*.
3. Go to *Orchestra Map → + Add* and create your first entry.
4. Use the geocoding button in the orchestra list to convert addresses to coordinates.
5. Insert `[orchestra_map]` into any page or block.

== Frequently Asked Questions ==

= Does this plugin require an API key? =

No. Geocoding uses OpenStreetMap Nominatim, which is free and requires no registration.

= Does this plugin send data to external servers? =

Two kinds. Geocoding sends the address fields (street, ZIP, city, country) of an orchestra entry to the OpenStreetMap Nominatim API (nominatim.openstreetmap.org) to retrieve geographic coordinates — always initiated by an admin action, never automatically in the background. Subject to the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).

Separately, every visitor viewing the [orchestra_map] shortcode loads map tiles directly from the OpenStreetMap tile server (tile.openstreetmap.org) in their own browser — no orchestra data is sent, only standard map tile requests. Subject to the [Tile Usage Policy](https://operations.osmfoundation.org/policies/tiles/). High-traffic sites should consider a commercial tile provider per that policy.

= How many orchestras can I add? =

There is no hard limit. The plugin stores data in a custom database table.

= Can I import from Excel or CSV? =

Import and Export are available in the **Orchestra Map Pro** add-on.

= Can I customise the map colors and fonts? =

Yes. The free Design settings page lets you customise marker, search, map, info panel, popup and list colors and sizes.

= Can I add custom data fields? =

Yes. The free Fields settings page lets you add, reorder and label your own custom data fields.

= Is the plugin compatible with Full-Site Editing (FSE) themes? =

Yes. The shortcodes work in both classic and block-based themes.

== Screenshots ==

1. Interactive Leaflet map with MarkerCluster
2. Orchestra list view with search and filter
3. Admin – orchestra list with sortable, customisable columns
4. Admin – add orchestra form
5. Admin – Fields settings: add, reorder and configure custom fields
6. Admin – Design settings: customise map, popup, list and search colors

== Changelog ==

= 1.9.90 =
* Fix: One constant (`GEOCODING_FIELD_KEYS`) didn't carry the plugin's naming prefix, per WP.org review feedback - renamed to `ORCHESTRA_MAP_GEOCODING_FIELD_KEYS`.
* Change: All internal CSS classes, IDs, CSS custom properties and custom DOM events switched from the `om-` prefix to `orchestra-map-` (e.g. `om-card` → `orchestra-map-card`, event `om:filter` → `orchestra-map:filter`), to avoid the short, generic prefix colliding with other plugins/themes on the same page.

= 1.9.89 =
* Fix: Saving the Fields settings page while a venue-group field's "Field" checkbox was off (making its shared "Title" checkbox disabled) silently reset that Title flag to off, discarding the previously saved value instead of preserving it.
* Fix: Adding a custom field with a key that already existed silently added nothing while still showing "Field settings saved." - now shows a clear "already exists" error instead.
* Fix: A pasted non-breaking space, zero-width space, or byte-order-mark in a Label field could pass as "non-empty" while rendering blank; detecting a blank label now strips these too, not just plain ASCII whitespace.
* Change: The default Cluster Color is now a shade of blue matching the plugin's usual accent color, instead of Leaflet's default green, so it's consistent with the rest of the built-in color palette.
* Feature: The Design settings page's Marker section now has a "Cluster Count Text Color" field, for the number shown inside each cluster bubble - defaults to white, since it wasn't previously configurable and the darker default cluster background made the old (unstyled) text hard to read.

= 1.9.88 =
* Fix: The Orchestra List's "Alternating Row Color" (zebra striping) never actually showed - each row's hidden expanded-row sibling in the page threw off the even/odd counting the striping relied on, so it only ever matched hidden rows. Rows are now striped explicitly instead of relying on position, so this works correctly.

= 1.9.87 =
* Feature: The Orchestra List's own link color and its expanded (accordion) row background are now independently configurable on the Design settings page ("Link Color", "Expanded Row Background" under Orchestra List), instead of silently reusing the Info Panel's colors. Changing the Info Panel's background/link color on the Design page no longer affects the list view at all.

= 1.9.86 =
* Fix: The new cluster color (1.9.84) made the cluster bubbles fully solid, losing the lighter-ring-around-a-darker-circle "halo" the default green/yellow/orange clusters had - restored with the custom color, so clusters still visually read as "grouped" at a glance.

= 1.9.85 =
* Fix: Clearing a color or dimension field on the Design settings page (e.g. Border Radius) and saving crashed with a hard error page instead of a normal validation message. Clearing a field now resets it to its default instead.
* Feature: Every field on the Design settings page now shows its default value underneath, so it's clear what a field resets to (or started as).

For older versions see changelog.txt.

== Credits ==

This plugin bundles the following open-source libraries:

* [Leaflet](https://leafletjs.com/) – BSD-2-Clause License, Copyright (c) 2010–2023 Vladimir Agafonkin
* [Leaflet.markercluster](https://github.com/Leaflet/Leaflet.markercluster) – MIT License, Copyright (c) 2012 David Leaver
* Geocoding via [OpenStreetMap Nominatim](https://nominatim.openstreetmap.org/) – usage subject to the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/)
* Map tiles via [OpenStreetMap](https://www.openstreetmap.org/copyright) – © OpenStreetMap contributors, data licensed under the [Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/), tile usage subject to the [Tile Usage Policy](https://operations.osmfoundation.org/policies/tiles/)

== Upgrade Notice ==

= 1.9.22 =
Update recommended: fixes custom fields being editable without a valid Orchestra Map Pro license.

= 1.9.21 =
Geocoding is now available in the free plugin. No license required.
