nthmedia / entry-gps-coordinates
Craft CMS 3.x的Entry GPS Coordinates插件
2.3.0
2024-05-20 10:36 UTC
Requires
- php: ^8.0
- craftcms/cms: ^4.0.0 || ^5.0.0
Requires (Dev)
- craftcms/ecs: dev-main
- craftcms/rector: dev-main
- phpstan/phpstan: ^1.6
README
为条目选择GPS位置
安装
要安装插件,请按照以下说明操作。
-
打开您的终端,进入Craft项目,并告诉composer安装插件
composer require nthmedia/entry-gps-coordinates
-
通过命令行或通过设置 → 插件下的控制面板激活Craft中的插件
./craft install/plugin entry-gps-coordinates
-
在设置 → 字段下添加坐标字段,并在设置 → 章节下将该字段添加到章节中
在Twig中的使用
{{ entry.fieldName | searchQuery }} => Van Gogh Museum
{{ entry.fieldName | coordinates }} => 52.3584159,4.8810756
{{ entry.fieldName | latitude }} => 52.3584159
{{ entry.fieldName | longitude }} => 4.8810756
{{ entry.fieldName | zoomLevel }} => 13
{{ entry.fieldName | address }} => Paulus Potterstraat 7, 1071 CX Amsterdam, Netherlands