=== Viro Filter Map & Store Locator – OpenStreetMap, No API Key ===
Contributors: viroproject
Tags: store locator, dealer locator, store finder, openstreetmap, stockist
Requires at least: 5.8
Tested up to: 7.1
Stable tag: 1.2.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Store locator with OpenStreetMap: no API key, no Google cookies. Faceted filters, list and map, fast vanilla JS, ready for block themes.

== Description ==

**Viro Filter Map & Store Locator** shows your stores, dealers, stockists, offices or members on an OpenStreetMap map, with search and filters. **No API key, no Google account, no cookies from the map**: install it, add your locations and the map works.

Visitors filter by category with faceted filters (OR within a group, AND between groups), search by name or address, and see the results on the map and in a grid of cards at the same time, without reloading the page.

It is built with vanilla JavaScript and the WordPress REST API: no jQuery, no external CDN, light on mobile. It works with block themes (Full Site Editing), the block editor and page builders.

See it live: [the map of the mountain huts of Piedmont](https://rifugidelpiemonte.it/i-nostri-rifugi/), made with this plugin.

### 🌟 Free Features
* **OpenStreetMap Integration:** Free, reliable, and requires no complicated API keys to start.
* **Modern Grid Layout:** A clean UI with filters on the left, the map on top, and a responsive grid of location cards below.
* **Instant Filtering:** Users can search by name/address or filter by categories instantly without reloading the page.
* **Advanced Filter Logic:** Choose between Faceted Search (recommended), strict AND, or strict OR logic to perfectly match your category structure.
* **Custom Map Height:** Full control over your layout. Set a custom maximum map height in pixels directly from the settings to prevent layout stretching on large directories.
* **App-like Map Popups:** Beautiful map markers that open modern, edge-to-edge image popups with contact details.
* **Click-to-Call & Email:** Integrated quick links for phone numbers and email addresses.
* **Gutenberg & Page Builder Ready:** Just drop the `[virofpl_locator]` shortcode anywhere (works perfectly with Elementor, Divi, Beaver Builder, etc.).
* **Zero Bloat:** No jQuery, no heavy assets. Pure performance.

### 🚀 Need More Power? Discover the PRO Version!
If you are an agency, a franchise, or simply need advanced features, [Viro Filter Map & Store Locator PRO](https://www.viroproject.com/plugins/filter-map-store-locator/) takes your map to the next level:
* **Google Maps & Mapbox Support**
* **Automatic Coordinate Finder** (1-Click address to Lat/Lng conversion)
* **Custom Map Pins** (Upload your own icons)
* **Advanced Pagination** (Load More button or Numeric)
* **CSV Mass Importer** (Create hundreds of locations in 1 click)
* **1-Click Migration from WeLaunch Store Locator**
* **Multiple Premium Layouts**

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/viro-filter-map-store-locator` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to the new "Locations" menu in your WordPress admin panel and add your store locations.
4. (Optional) Create Categories to group your locations.
5. Go to "Locations -> Settings" to configure your default map coordinates and colors.
6. Insert the shortcode `[virofpl_locator]` into any page or post to display your map.

== Frequently Asked Questions ==

= Do I need an API Key to make the map work? =
No!
The free version uses OpenStreetMap, which is 100% free and ready to use immediately.
No registration or API keys are required.

= Can I use Google Maps instead? =
Google Maps support (along with Mapbox) is available in the [PRO version](https://www.viroproject.com/plugins/filter-map-store-locator/).

= How do I display the map on my site? =
Simply create a new Page or Post and paste the shortcode `[virofpl_locator]`.

= Can I import my locations from an Excel/CSV file? =
The CSV Mass Importer (and the automated migration tool from WeLaunch Store Locator) is a premium feature available in Viro Filter Map & Store Locator PRO.

= Can the plugin find coordinates automatically? =
Yes! Viro Filter Map & Store Locator PRO includes a magical button that automatically finds Latitude and Longitude based on your typed address.

= Can I write coordinates with a comma? =
Yes. Both 45.0703 and 45,0703 are accepted and saved in the same way.

= Can I show more than one map on the same page? =
No, use one map per page.

= Does it work with block themes (Full Site Editing)? =
Yes. Since version 1.2.0 the map, its data and its colors load correctly in block themes such as Twenty Twenty-Five.

== External Services ==

This plugin connects to a third-party service to display the map:

**OpenStreetMap map tiles**
* **Purpose:** The map background (the "tiles") is loaded from the OpenStreetMap tile servers on the pages that contain the `[virofpl_locator]` shortcode, unless the "No Map (List Only)" option is selected.
* **Data Sent:** The visitor's browser requests the map tiles directly from tile.openstreetmap.org, which receives the visitor's IP address, browser user agent and the address of the page (referrer). No cookies are set and no other data is sent.
* **Service Provider:** OpenStreetMap Foundation.
* **Tile Usage Policy:** https://operations.osmfoundation.org/policies/tiles/
* **Privacy Policy:** https://wiki.osmfoundation.org/wiki/Privacy_Policy

All the other files (Leaflet library, styles and map pins) are bundled with the plugin: nothing is loaded from external CDNs.

== Screenshots ==

1. Instant filtering: search and faceted filters update the map and the list without reloading the page.
2. Map popup with photo, contacts and a link to the location's page.
3. Responsive grid of location cards under the map.
4. Settings: map provider, default view, sorting, filter logic and colors.
5. Adding a location: address, coordinates, contacts, website and categories.

== Changelog ==

= 1.0.0 =
* Initial release.
A blazing fast, modern Store Locator for WordPress.

= 1.0.1 =
* Fix: Fixed invisible standard pointer for OpenStreetMap (Leaflet) maps.

= 1.1.0 =
* Feature: Added advanced Filter Logic options (Faceted Search, strict AND, strict OR).
* Feature: Added Map Height control (px) to prevent layout stretching on directories with many filters.
* Tweak: Minor UI improvements in the settings panel.

= 1.1.1 =
* Compatibility with Wordpress 7.1

= 1.2.0 =
* Fix: The map now works in block themes (Full Site Editing): data and colors were lost because the theme renders the page before the scripts are registered.
* Fix: A coordinate written with a comma (45,07) no longer stops the whole map; commas are now accepted and converted.
* Fix: Location names, addresses and links are escaped, so quotes or HTML in a name can no longer break the list or the popups. Website links accept only http and https.
* Fix: Emails and website URLs are saved with the proper WordPress sanitization.
* Fix: The default filter logic is now "Faceted" everywhere, as shown in the settings page.
* Fix: The script version now matches the plugin version, so browsers load the updated files.
* Tweak: The map pin is bundled with the plugin instead of being loaded from unpkg.com.
* Tweak: Map popup styles no longer affect other Leaflet maps on the site; the locator uses the theme font.
* Tweak: Empty categories are hidden from the filters; sub-categories of any depth are shown under their top-level group.
* Tweak: Accessibility: cards can be opened with the keyboard, checkboxes show the keyboard focus, the search field has a label and the number of results is announced to screen readers.
* Tweak: Search ignores accents ("citta" finds "Città") and waits for a pause in typing; clicks on phone, email and website links no longer move the map.
* Tweak: Faster API: categories and images are loaded without one query per location.
* Tweak: If the PRO version is active, the free version stays idle to avoid conflicts.

