rubium / yamapswidgets-plugin
Yandex Maps Widgets 后端组件,适用于 OctoberCMS。
1.1.2
2021-05-05 16:32 UTC
This package is auto-updated.
Last update: 2024-09-05 23:49:13 UTC
README
轻松快速地将 Yandex Maps 字段集成到您的后端表单中。
此插件提供了一种表单小部件,可以简单快速地将 Yandex Maps 地图集成到后端表单中。此外,还有一个组件可以在网站的前端显示地图。
功能
- 将 Yandex Maps 地图集成到后端表单中。
- 在网站的前端显示地图。
文档
安装
要安装此插件,您需要点击“添加到项目”或需要在后端 系统 > 更新 > 安装插件 中输入 rubium.yamapswidgets。
配置
要配置此插件,请转到后端 系统,然后在左侧栏中找到 MISC,然后点击 Widget YaMaps,您将获得配置选项,并使用组件 YaMapsDemo 在前端显示地图。
用法
在后端表单上
在您希望存储 Yandex Maps 位置纬度和经度的模型字段.yaml 文件中创建一个类型为 yamaps 的字段。
示例
map: label: 'Yandex Maps' type: yamaps fieldPosition: latitude: '55.75417429118003' longitude: '37.62009153512286' height: "380px" editable: false zoom: 15 markers: locations #The name of the column in which the markers are stored
address_map: label: Address type: yaddress target: User[location] #Field with type YaMaps. This field find with jQuery and target event 'change-cords'
在前端
[YaMapDemo] width = "100%" height = "500px" mapTypeId = "yandex#map" zoom = 9 showMarker = 1 == {% component 'YaMapDemo' %}