Title: Advanced Custom Fields: Leaflet Map Field
Author: Unscuzzy
Published: <strong>2018 年 7 月 4 日</strong>
Last modified: 2018 年 7 月 4 日

---

搜索插件

![](https://ps.w.org/acf-leaflet-map-field/assets/banner-772x250.jpg?rev=1904210)

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://ps.w.org/acf-leaflet-map-field/assets/icon-256x256.jpg?rev=1904210)

# Advanced Custom Fields: Leaflet Map Field

 作者：[Unscuzzy](https://profiles.wordpress.org/unscuzzy/)

[下载](https://downloads.wordpress.org/plugin/acf-leaflet-map-field.zip)

 * [详情](https://cn.wordpress.org/plugins/acf-leaflet-map-field/#description)
 * [评价](https://cn.wordpress.org/plugins/acf-leaflet-map-field/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/acf-leaflet-map-field/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/acf-leaflet-map-field/#developers)

 [支持](https://wordpress.org/support/plugin/acf-leaflet-map-field/)

## 描述

This plugin adds a Leaflet map field to the Advanced Custom Fields plugin.

#### Create the backend field

You can add a leaflet map field using ACF like the Google Map field.

#### Diplay the map in front-end

Uses the classic ACF `get_field('field_name')` function to get field data (lat, 
lng, address & zoom).

Warning, the `get_field()` function does not display the map itself, for this, use
the [leaflet js map](https://leafletjs.com/examples/quick-start/) documentation 
directly

#### Compatibility

This ACF field type is compatible with:
 * ACF 5 only (Pro & Free)

NB: If you’re using the ACF 4 Free version, you can upgrade to version 5 step by
step [on this page](https://www.advancedcustomfields.com/resources/upgrade-guide-version-5/)

## 屏幕截图

 * [[
 * Backend field settings
 * [[
 * Backend field example
 * [[
 * Front-end output

## 安装

From your WordPress dashboard
 1. Visit Plugins > Add New 2. Search for “Advanced
Custom Fields: Leaflet Field” 3. Activate “Advanced Custom Fields: Leaflet Field”
from your Plugins page 4. Create ACF new leaflet map field from “Custom Fields” 
menu item

## 常见问题

  Installation Instructions

From your WordPress dashboard
 1. Visit Plugins > Add New 2. Search for “Advanced
Custom Fields: Leaflet Field” 3. Activate “Advanced Custom Fields: Leaflet Field”
from your Plugins page 4. Create ACF new leaflet map field from “Custom Fields” 
menu item

  How to display the map in front-end ?

 1. Make sure you have created a “Leaflet Map” field
 2. In the template file, use the ACF classic “get_field()” function, (you can add 
    this following code in your template page for debug)
 3.  * `<?php var_dump( get_field('my-field-name') ); ?>`
 4. Go to [leaflet map documentation](https://leafletjs.com/examples/quick-start/) 
    and draw your 1st map!

## 评价

![](https://secure.gravatar.com/avatar/b382bcf0dcb8789f25830744642416830ada9527ee26aaee04a00333703250e1?
s=60&d=retro&r=g)

### 󠀁[Not very precise search](https://wordpress.org/support/topic/not-very-precise-search/)󠁿

 [Mladen Gradev](https://profiles.wordpress.org/joe8104/) 2018 年 9 月 3 日 1 回复

The search function of this plugin is not precise at all. I was unable to mark specific
address, only the whole town. If anyone can mark this address let me know how and
I will change my rating. This is in Bulgaria: Айтос, ул. Васил Левски №1 or Aytos,
1 Vasil Levski str.

![](https://secure.gravatar.com/avatar/7dd2c22814194e9de39e7a272e7c898d7b179b349432cf33d16b67dab670e877?
s=60&d=retro&r=g)

### 󠀁[Works perfectly!](https://wordpress.org/support/topic/works-perfectly-1462/)󠁿

 [hugo423403](https://profiles.wordpress.org/hugo423403/) 2018 年 7 月 5 日

I love this plugin that allow me to easily bypass the use of Google Map for my clients
websites. Thanks a lot!

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/)

## 贡献者及开发者

「Advanced Custom Fields: Leaflet Map Field」是开源软件。 以下人员对此插件做出了
贡献。

贡献者

 *   [ Unscuzzy ](https://profiles.wordpress.org/unscuzzy/)

[帮助将「Advanced Custom Fields: Leaflet Map Field」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/acf-leaflet-map-field)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/acf-leaflet-map-field/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/acf-leaflet-map-field/)，或通过[RSS](https://plugins.trac.wordpress.org/log/acf-leaflet-map-field/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/acf-leaflet-map-field/)。

## 更新日志

#### 1.0.0

 * Initial Release.

## 额外信息

 *  版本 **1.0.0**
 *  最后更新：**8 年前**
 *  活跃安装数量 **300+**
 *  WordPress 版本 ** 4.9.6 或更高版本 **
 *  已测试的最高版本为 **4.5.33**
 *  PHP 版本 ** 5.6 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/acf-leaflet-map-field/)
 * 标签
 * [acf](https://cn.wordpress.org/plugins/tags/acf/)[leaflet](https://cn.wordpress.org/plugins/tags/leaflet/)
 *  [高级视图](https://cn.wordpress.org/plugins/acf-leaflet-map-field/advanced/)

## 评级

 3.5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/?filter=3)
 *  [  1 条 2 星评价     ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/acf-leaflet-map-field/reviews/)

## 贡献者

 *   [ Unscuzzy ](https://profiles.wordpress.org/unscuzzy/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/acf-leaflet-map-field/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://unscuzzy.com)