=== Maps by G ===
Contributors: gurbhagat
Tags: map, openstreetmap, address, location, maps
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display addresses on beautiful, interactive maps using OpenStreetMap. An open-source alternative to Google Maps that requires no API key.

== Description ==

Maps by G allows you to easily embed interactive maps on your WordPress site without needing a Google Maps API key. Simply use a shortcode with an address, and the plugin will display a beautiful map with a marker at that location.

**Features:**

* No API key required - uses OpenStreetMap tiles
* Simple shortcode embedding
* Address geocoding via Nominatim
* Custom marker titles with popups
* Multiple tile providers (OpenStreetMap, CartoDB Light, CartoDB Dark)
* Responsive design for all devices
* Configurable zoom levels
* Enable/disable scroll wheel zoom
* Gutenberg block support
* Lightweight and fast loading

== Installation ==

1. Upload the `leaflet-address-map` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Use the shortcode `[mbyg_map address="Your Address"]` in any page or post

== Usage ==

**Basic Shortcode:**

`[mbyg_map address="1600 Pennsylvania Avenue, Washington, DC"]`

**With Custom Title:**

`[mbyg_map address="Eiffel Tower, Paris" title="Eiffel Tower" zoom="15"]`

**Using Coordinates:**

`[mbyg_map lat="51.5074" lng="-0.1278" title="London" zoom="12"]`

**Available Attributes:**

* `address` - The address to display on the map
* `lat` - Latitude coordinate (use instead of address)
* `lng` - Longitude coordinate (use instead of address)
* `zoom` - Zoom level from 1-19 (default: 13)
* `height` - Map height in pixels (default: 400)
* `title` - Text shown in marker popup
* `provider` - Tile provider: openstreetmap, cartodb-light, cartodb-dark (default: openstreetmap)
* `zoomcontrol` - Show zoom buttons: true/false (default: true)
* `scrollzoom` - Enable scroll wheel zoom: true/false (default: true)

== External Services ==

This plugin relies on the following third-party services to provide map functionality:

= OpenStreetMap Tile Servers =

This plugin displays maps using tile images from OpenStreetMap's tile servers. Map tiles are loaded when a map is displayed on your website.

* **What it does:** Provides the visual map tiles (the actual map images you see)
* **When data is sent:** Every time a map is displayed on your site
* **What is sent:** The geographic coordinates (latitude/longitude) and zoom level to determine which map tiles to load
* **Service provider:** OpenStreetMap Foundation
* **Terms of Use:** https://wiki.osmfoundation.org/wiki/Terms_of_Use
* **Privacy Policy:** https://wiki.osmfoundation.org/wiki/Privacy_Policy
* **Tile Usage Policy:** https://operations.osmfoundation.org/policies/tiles/

= CartoDB/CARTO Tile Servers (Optional) =

If you choose the CartoDB Light or CartoDB Dark tile providers, map tiles are loaded from CARTO's servers instead.

* **What it does:** Provides alternative styled map tiles
* **When data is sent:** Only when CartoDB tile providers are selected
* **What is sent:** Geographic coordinates and zoom level
* **Service provider:** CARTO
* **Terms of Service:** https://carto.com/legal/
* **Privacy Policy:** https://carto.com/privacy/

= Nominatim Geocoding Service =

When you provide an address (instead of coordinates), this plugin uses the Nominatim geocoding service to convert the address to geographic coordinates.

* **What it does:** Converts street addresses to latitude/longitude coordinates
* **When data is sent:** Only when an address is provided in the shortcode (not when using lat/lng coordinates directly)
* **What is sent:** The address text you specify in the shortcode
* **Data caching:** Geocoded results are cached for 24 hours to reduce API calls
* **Service provider:** OpenStreetMap Foundation
* **Terms of Use:** https://operations.osmfoundation.org/policies/nominatim/
* **Privacy Policy:** https://wiki.osmfoundation.org/wiki/Privacy_Policy

**Note:** If you prefer not to use the geocoding service, you can always provide latitude and longitude coordinates directly using the `lat` and `lng` shortcode attributes.

== Screenshots ==

1. Map displaying an address with a marker popup
2. Map with CartoDB Dark theme
3. Gutenberg block in the editor

== Frequently Asked Questions ==

= Do I need an API key? =

No! This plugin uses OpenStreetMap tiles which are freely available. No API key is required.

= How does address geocoding work? =

The plugin uses the Nominatim service (provided by OpenStreetMap) to convert addresses to coordinates. Results are cached for 24 hours to improve performance and reduce API calls.

= Can I use coordinates instead of an address? =

Yes! Use the `lat` and `lng` attributes for precise positioning. This also avoids using the geocoding service if you prefer.

= Is the plugin mobile-friendly? =

Yes, the maps are fully responsive and work on all devices.

= What data is shared with external services? =

See the "External Services" section above for complete details. In summary:
- Map tile requests send coordinates and zoom level
- Address geocoding sends only the address text you provide
- No personal user data is collected or transmitted

== Changelog ==

= 1.0.0 =
* Initial release
* Basic shortcode support with [mbyg_map] shortcode
* Address geocoding via Nominatim
* Multiple tile providers (OpenStreetMap, CartoDB Light, CartoDB Dark)
* Gutenberg block support
* Custom marker popups
* Lazy loading with IntersectionObserver

== Upgrade Notice ==

= 1.0.0 =
Initial release of Maps by G.
