Maps by G

外掛說明

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

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.

適用於區塊編輯器

這個外掛提供 2 個可供 Gutenberg/區塊編輯器使用的區塊。

  • Free Map
  • Map

安裝方式

  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

常見問題集

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

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Maps by G〉的開發相關工作。

參與者

將〈Maps by G〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

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