[wordpress插件] Advanced Custom Fields: Multiple Coordinates高级自定义字段:多个坐标

wordpress 插件 文章 2020-02-07 07:20 515 0 全屏看文

AI助手支持GPT4.0

评分

46

46

描述

The plugin is a modified extended version of the Advanced Custom Fields: Coordinates made by Stupid Studio and is found here:

该插件是“高级自定义字段:Stupid Studio创建的坐标”的修改后的扩展版本,位于以下位置:

https://wordpress.org/plugins/advanced-custom-fields-coordinates/

https://wordpress.org/plugins/advanced-custom-fields-coordinates/

This software is licensed under the GNU General Public License version 3. See

该软件已获得GNU通用公共许可证版本3的许可。请参阅

gpl.txt included with this software for more detail.

该软件随附的gpl.txt可获得更多详细信息。

The plugin relies on the Google Maps API.

该插件依赖于Google Maps API。

It does not use an API-key and is

它不使用API​​密钥,并且是

therefore operating under the restrictions of the free Google Maps API,

因此,必须遵守免费Google Maps API的限制

which should be plenty for most backend usage.

对于大多数后端使用来说应该足够了。

Usage

用法

When you create a new custom field with ACF, set the field type to

使用ACF创建新的自定义字段时,请将字段类型设置为

Multiple Coordinates map.

多个坐标图

Now the coordinates chooser should show up when you edit

现在,当您进行编辑时,坐标选择器应该会显示

a post with your custom fields.

包含您自定义字段的帖子。

The tool add a point on each click on the map.

该工具会在地图上的每次点击时添加一个点。

To remove the point you select the “Remove Coordinate” button and click a point.

要删除点,请选择“删除坐标”按钮,然后单击一个点。

You can also show the points as a Polygon on the map with the “Show area on map” button and show the actual coordinates in a semi-colon

您还可以使用“在地图上显示区域”按钮在地图上将点显示为多边形,并以分号显示实际坐标

separated list with the “Show coordinates” button.

使用“显示坐标”按钮分隔列表。

The search field is only there to quickly take you to different places on the map.

搜索字段仅在此处可快速将您带到地图上的其他地方。

Not

不是

to add the actual points.

添加实际点。

To get the coordinates data in your frontend, simply request the field value

要在前端获取坐标数据,只需请求字段值

and in return you get the coordinates in a latitude, longitude array and the zoom as in the sample below.

作为回报,您可以在纬度,经度数组和缩放中获得坐标,如下例所示。

  <?php

$values = get_field('*****FIELD_NAME*****');

$ values = get_field('***** FIELD_NAME *****');

print_r($values);

print_r($ values);

/* which will give you an array like the following sample    

/ *将为您提供一个类似于以下示例的数组    

Array    

数组    

(        

(        

[coords] => Array            

[coords] =>数组            

(                

(                

[0] => Array                    

[0] =>数组                    

(                        

(                        

[lat] => 57.156363766336                        

[lat] => 57.156363766336                        

[lng] => 16.364327427978                    

[lng] => 16.364327427978                    

)                

)                

[1] => Array                    

[1] =>数组                    

(                        

(                        

[lat] => 57.159612809986                        

[lat] => 57.159612809986                        

[lng] => 16.370315551758                    

[lng] => 16.370315551758                    

)            

)            

)        

)        

[zoom] => 13    

[缩放] => 13    

)

*/

* /

?>

?>

安装步骤

Install this plugin by downloading the source

通过下载源代码来安装此插件

and unzipping it into the plugin folder in your WordPress installation.

并将其解压缩到WordPress安装中的plugin文件夹中。

Make

制作

sure to also have ACF installed.

确保还安装了ACF。

下载地址

https://downloads.wordpress.org/plugin/advanced-custom-fields-multiple-coordinates.zip

https://downloads.wordpress.org/plugin/advanced-custom-fields-multiple-coordinates.zip

-EOF-

AI助手支持GPT4.0