Linux 软件免费装
Banner图

Advanced Custom Fields: Multiple Coordinates

开发者 jonashjalmarsson
web111se
更新时间 2026年8月15日 16:07
PHP版本: 7.0 及以上
WordPress版本: 7.1
版权: GPLv3 or later
版权网址: 版权信息

标签

acf google maps map points coordinates

下载

1.0.4 1.1.0 1.1.1 1.4.0

详情介绍:

A multi-point Google Maps field for Advanced Custom Fields. Click the map to drop a point and drag it to move it. "Edit points" opens the list of points, where a point can be dragged to a new position or removed. Every point is numbered so the stored order is visible — it is the order the value is stored in and the order the line or area is drawn in — and the last change can always be undone. The plugin reads your existing Google Maps API key from ACF's global setting (google_api_key), so no extra configuration is needed if you already use ACF Map fields. If you don't have one set, you can also provide a key via the acfmc_gmaps_key filter. Originally inspired by the single-point ACF: Coordinates field by Stupid Studio; this plugin extends the idea to multiple points per field. Licensed under the GNU General Public License v3. See license.txt for details.

安装:

Install this plugin by downloading the source and unzipping it into the plugin folder in your WordPress installation. Make sure to also have ACF (Advanced Custom Fields) installed and active.

屏幕截图:

  • "Edit points" opens the list: every point in stored order with its latitude and longitude, the name of any point added through the search field, a drag handle for moving it up or down, and a Remove button per row.
  • Adding the field: pick "Coordinates map" under Content in the ACF field type browser.

升级注意事项:

1.4.0 The editor is rebuilt: points are edited and reordered in a drag-and-drop list, the removal mode is gone, a line or an area can be drawn through the points in a colour you pick, and clicking a marker shows what it is. Your saved values are untouched — the format is unchanged and old values still draw only their markers.

常见问题:

I am upgrading from 1.1.x. Do I have to change anything?

No. The field type name, the postmeta key and the JSON format are the same, so your field groups, your saved values and whatever your theme already does with get_field() all keep working. What changed is the editing screen, not the data.

Will the new shapes change how my existing values look?

No — and that is on purpose. Lines and areas are only drawn when the value actually says so, and a value saved before 1.3.0 says nothing at all: it has no shape, no style, no color and no markers. Those fall back to no shape, sharp, #999999 and markers on, which adds up to exactly what you had before — the numbered points, and nothing drawn between them. It would have been possible to default old values to an area instead, since the old versions had a "Show area on map" button. That button was only ever an editor preview: pressing it drew a polygon on the edit screen but saved nothing, so there was no way to tell an old value that had it pressed from one that never did. Defaulting to an area would therefore have drawn polygons on sites that never asked for one. If you do want a shape on an older value, open the post, pick Line or Area from the shape menu and update — from then on it is stored with the value.

How do I get the plugin to show a map on the website?

By implementing a map on your own. We do not provide a frontend implementation — that is up to you. The Description section has a complete, paste-ready example for both a map and a plain text list.

更新日志:

1.4.0 The editor has been rebuilt. If you are coming from 1.1.1 this is the release where the field stops being a row of buttons over a map and becomes something you can actually work in: points are edited in a list you can drag to reorder, the removal mode is gone, a shape can be drawn through the points in a colour you pick, and clicking a marker tells you what it is. Versions 1.2.0 and 1.3.0 were never released on WordPress.org, so their changes are in this release too and are listed under their own headings below. Nothing you have saved changes. The stored value format is the same JSON in the same postmeta key, get_field() returns the same structure, and existing field groups keep working. A value saved before 1.3.0 has no shape keys, so it draws exactly what it drew before: the markers, and nothing else. See "Will the new shapes change how my existing values look?" under Frequently Asked Questions. 1.3.0 Never released on WordPress.org on its own — it ships as part of 1.4.0. Listed separately so the jump from 1.1.1 is readable. 1.2.0 Never released on WordPress.org on its own — it ships as part of 1.4.0. 1.1.1 1.1.0 1.0.4 1.0.3 1.0.2 Copy feature added to copy points from one Multiple Coordinates value to another.
  1. Press the Copy button, right click on the selection and select Copy.
  2. Go to the destination Multiple Coordinates value and press the Copy button, then right click and select Paste.
  3. Publish or update the page or post to apply the new points.
1.0.1 1.0.0