=== Mapfolk ===
Contributors: cidix
Tags: directory, store locator, map, openstreetmap, member directory
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Filterable directory map for members, companies, dealers and locations. Map, list and filters with OpenStreetMap, no API key needed.

== Description ==

Mapfolk shows a directory as a map with a list and filters: the members of an association, the companies of a region, a manufacturer's dealers or your own locations. Visitors pick a category and the map and the list show only what fits, without a page reload.

= What the free plugin includes =

* A map and a list that work together
* One filter group with a count for each term
* OpenStreetMap out of the box, with no API key, no account and no cookies
* Search by name and a shareable URL for every filtered view
* A setup wizard with four templates: member directory, business directory, store locator and locations
* Phone, email, opening hours and a directions link for each entry
* An optional page for each entry
* Your own entries or an existing post type as the source
* A block and a shortcode, and as many maps as you need
* Import from GEO my WP with the stored coordinates, and CSV export
* English, German and French

= Mapfolk Pro =

Mapfolk Pro is a separate add-on from getmapfolk.com. It adds up to 50 filter groups (the free plugin has one), radius search by place or postcode, Google Maps with your own key, import from Excel and CSV, three layouts, five map styles and clustering. When a file is imported again, an empty cell leaves the stored value as it is. Pro is a one-time purchase with twelve months of updates and support, and it keeps working after that.

== External services ==

Mapfolk uses the following services. It sends no data to getmapfolk.com or to any other server of its own.

= OpenFreeMap (map tiles) =

The map loads its style, vector tiles and fonts from OpenFreeMap (tiles.openfreemap.org). This happens in the visitor's browser each time a page with a map is shown, and in the admin when a map preview is shown. The browser sends the usual request data, such as the IP address, the requested tile and the browser's user agent. With the feature "Load map only after consent", nothing is loaded from OpenFreeMap until the visitor agrees.
Terms of service: https://openfreemap.org/tos/
Privacy policy: https://openfreemap.org/privacy/

= geo.admin.ch (geocoding in Switzerland and Liechtenstein) =

When the geocoding service is geo.admin.ch (the default), your WordPress server sends the address of an entry to the search service of the Swiss Federal Spatial Data Infrastructure (api3.geo.admin.ch) to find its coordinates. This happens when an entry is saved or located again and when you type an address in the entry form (suggestions). The request contains the address and a user agent with the plugin version and the address of your site. Visitors' browsers never contact this service.
Terms of use: https://www.geo.admin.ch/en/general-terms-of-use-fsdi
Privacy policy: https://www.admin.ch/gov/en/start/terms-and-conditions.html

= Nominatim (geocoding worldwide) =

When you choose Nominatim as the geocoding service, your WordPress server sends the address of an entry to nominatim.openstreetmap.org to find its coordinates. This happens only when an entry is saved or located again, one address per second, never while typing and never for visitors. The request contains the address and a user agent with the plugin version and the address of your site.
Usage policy: https://operations.osmfoundation.org/policies/nominatim/
Privacy policy: https://osmfoundation.org/wiki/Privacy_Policy

= Google Maps (directions link only) =

With the feature "Directions link", each entry with a location shows a link to the route in Google Maps (https://www.google.com/maps/dir/ with the coordinates of the entry). It is a plain link: nothing is loaded from Google and no data is sent to Google until a visitor clicks it. The click opens Google Maps in a new tab.
Terms of service: https://www.google.com/intl/en/help/terms_maps/
Privacy policy: https://policies.google.com/privacy

== Source code ==

All PHP, JavaScript and CSS of Mapfolk ship unminified and are the source code. The only bundled third-party code is MapLibre GL JS, which is shipped as built by its authors:

* Library: MapLibre GL JS 6.4.1
* Files: assets/vendor/maplibre-gl/6.4.1/maplibre-gl.js, assets/vendor/maplibre-gl/6.4.1/maplibre-gl-shared.js, assets/vendor/maplibre-gl/6.4.1/maplibre-gl-worker.js, assets/vendor/maplibre-gl/6.4.1/maplibre-gl.css (the files dist/maplibre-gl.mjs, dist/maplibre-gl-shared.mjs, dist/maplibre-gl-worker.mjs and dist/maplibre-gl.css of the npm package, renamed to .js with the import path adjusted and the source map comment removed)
* License: BSD-3-Clause, the license text is in assets/vendor/maplibre-gl/6.4.1/LICENSE.txt
* Source code: https://github.com/maplibre/maplibre-gl-js/tree/v6.4.1
* npm package: https://registry.npmjs.org/maplibre-gl/6.4.1

== Installation ==

1. Install the plugin from the WordPress plugin directory and activate it.
2. Pick a template. Tell the setup wizard whether you show members, companies, dealers or locations. It creates matching labels, fields and filters.
3. Add the map. Put the block or the shortcode on the page. Set the accent and marker colors in the settings.

== Frequently Asked Questions ==

= Does the map work without a Google key? =

Yes. Out of the box Mapfolk shows OpenStreetMap with map data from OpenFreeMap, with no key and no account. Google Maps comes with Pro.

= Which languages does Mapfolk speak? =

English, German and French. German comes with informal (du) or formal (Sie) address, in Swiss, German and Austrian spelling.

= What do I need? =

WordPress 6.5 or later and PHP 8.2 or later.

= Can I switch from GEO my WP? =

Yes. The import from GEO my WP is included in the free version and takes over the stored coordinates.

== Changelog ==

= 1.2.2 =
* Mapfolk Pro can be updated through WordPress, even when the free version is already newer.

= 1.2.1 =
* Mapfolk Pro is fully separate from the free plugin: layouts, map styles, radius search, clustering, full screen and several filter groups come entirely from Mapfolk Pro. The free plugin shows one filter group; further saved groups are kept and work with Pro.
* When the versions of Mapfolk and Mapfolk Pro do not match, the admin shows which plugin to update, and the map keeps working without errors.
* Entries with a password, private entries, drafts and scheduled entries never appear on the map, in the list or on the single page.
* Shared links with filters are unambiguous, even when a filter group is called name, ort or page; older links keep working.
* The import preview shows for each row which fields change; an empty cell never changes a stored value, and rows with the same ID that contradict each other are reported with their row numbers.
* If a step fails during an import, an existing entry stays as it was and a newly created one is removed again.
* In the tab Filters, a form that arrived incompletely saves nothing and reports the server limit.
* The display preview shows the colour of markers without a term at once, and the default radius locks and unlocks together with the radius search.
* Radius 50 and other numbers save without an error message.

= 1.2.0 =
* The settings are arranged in the tabs Services, Display, Filters and Features; the display preview stays in place while scrolling.
* With Mapfolk Pro you choose cards per row, the map style from a drawn preview, the info window Standard or Detailed, map height, corners, card style, colour of the groups, full screen button, default radius and All per page.
* The colour dot of the marker colour can be switched off for list and info window, the label of the link is free to choose.
* Until consent is given, the placeholder shows a preview with the markers instead of an empty area.
* If an entry has no short text, the beginning of the description appears.
* With Complianz and without the WP Consent API, the map loads after consent.

= 1.1.3 =
* Add a new term for each filter group right in the entry.
* Addresses in Liechtenstein are found and count as one area with Switzerland.
* Picking an address suggestion also takes over its country.
* An import that renames entries hits the same entries on every repeat, and the preview shows the same result as the import.
* If geocoding fails when locating again, the existing point stays on the map.

= 1.1.2 =
* The settings list Switzerland and Liechtenstein for geo.admin.ch.

= 1.1.1 =
* The settings describe exactly what the free version does and what Mapfolk Pro adds.
* With the radius choice switched off, the map searches within the set radius and shows no selection.

= 1.1.0 =
* Each entry can carry opening hours, shown in the list and the info window when switched on.
* A directions link on each entry opens the route to the location in Google Maps.
* The settings show in the right places what Mapfolk Pro adds.

= 1.0.1 =
* Phone, email, description and a custom text field can appear in the list and the info window, with phone and email as links.
* Every entry has a country field, and a new entry starts with the country of the site language.
* Geocoding passes street, postcode, city and country to the service separately and finds addresses outside Switzerland more reliably.
* Export and import keep filter groups with the same name apart, and an unchanged export file imports again without changes.
* Importing the same file again updates the existing entries, also without a country column.
* Filtering keeps other parameters in the page address, also with several maps on one page.
* Changes to settings, link and logo show on the map right after saving.
* With fast input and several windows, the result of the latest search, geocoding or license activation applies.
* The import accepts coordinates with sign and exponent, skips rows with invalid values or error cells with a note and leaves a saved point unchanged.
* Invalid coordinates in an entry or from GEO my WP leave a saved point unchanged.
* The info window closes as soon as a filter removes its entry.
* Filter groups work with any taxonomy name.
* The Google key test shows the right result, even after several clicks.

= 1.0.0 =
* Map and list work together, and clicking an entry shows it on the map.
* Filters work without a reload and show the number of results for each option.
* The filter selection is kept in the URL and can be shared.
* OpenStreetMap runs with no key and no account.
* A setup assistant creates a member directory, company directory, dealer locator or locations map with matching fields and filters.
* Entries from GEO my WP can be imported.
* With Pro: radius search by place or postcode, Google Maps that loads only after consent, import from Excel and CSV and up to 50 filter groups.
* Mapfolk speaks English, German and French.
