carbon/geomapeditor

Neos CMS 的 Geo Protomaps 检查编辑器

安装: 795

依赖: 1

建议者: 0

安全: 0

星标: 2

关注者: 1

分支: 0

开放问题: 0

语言:JavaScript

类型:neos-carbon

0.1.5 2024-04-11 21:16 UTC

This package is auto-updated.

Last update: 2024-09-11 22:28:17 UTC


README

Latest stable version Total downloads License GitHub forks GitHub stars GitHub watchers

Neos CMS 的 Geo 检查编辑器

GeoMapEditor.mp4

安装

大多数情况下,您需要对该包进行一些小的调整(例如,Settings.yaml 中的配置)。因此,将相应的包添加到您的主题 composer.json 中非常重要。

composer require carbon/geomapeditor --no-update

使用 --no-update 命令可以阻止自动更新依赖项。将包添加到您的主题 composer.json 后,返回 Neos 安装根目录并运行 composer update。搞定!现在您的包已正确安装。

如何使用它

'Foo.Bar:Map':
  properties:
    geo:
      type: array
      ui:
        label: Geo Location
        reloadIfChanged: true
        inspector:
          editor: 'Carbon.GeoMapEditor/Editor'
          editorOptions:
            zoom: 4

使用 editorOptions,您可以修改地图的每个设置。

使用 Protomaps

如果您想使用 Protomaps,您需要设置 protomaps.url。您需要在 Protomaps 上配置您的 API 密钥 或在自己的服务器上安装 Protomaps。

之后,您需要在设置中设置正确的 URL

Neos:
  Neos:
    Ui:
      frontendConfiguration:
        'Carbon.GeoMapEditor':
          protomaps:
            url: 'https://api.protomaps.com/tiles/v3/{z}/{x}/{y}.mvt?key=YOUR_API_KEY'

更改全局设置

要更改初始缩放或地图的位置,请更改 zoom 和/或 center。使用 mapOptions 设置 地图 的设置。

Neos:
  Neos:
    Ui:
      frontendConfiguration:
        'Carbon.GeoMapEditor':
          protomaps:
            url: null
          defaultTileLayer:
            url: https://tile.openstreetmap.org/{z}/{x}/{y}.png
            attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
          mapOptions:
            scrollWheelZoom: false
            minZoom: 3
            maxZoom: 18
            attributionControl: true
          zoom: 13
          center:
            lat: 46.948
            lng: 7.459