【问题标题】:Is it possible to set default geopoint in the sanity.io?是否可以在 sanity.io 中设置默认地理点?
【发布时间】:2019-09-02 07:48:06
【问题描述】:

我有一个字段:

{
  name: 'location',
  title: 'Map',
  type: 'geopoint'
}

我使用@sanity/google-maps-input。很棒,但默认本地化是纽约。如何将其更改为其他位置?

【问题讨论】:

    标签: sanity


    【解决方案1】:

    可以在文件config/@sanity/google-maps-input.json

    {
      "apiKey": "XYZ",
      "defaultZoom": 11,
      "defaultLocation": {
        "lat": 40.7058254,
        "lng": -74.1180863
      }
    }

    【讨论】:

    • 很高兴你发现了!请注意,此默认设置仅适用于在工作室中显示 时的地图。您在此处指定的defaultLocation 不会存储在数据存储区的文档中。
    猜你喜欢
    • 2019-07-18
    • 1970-01-01
    • 2019-08-24
    • 2014-10-15
    • 1970-01-01
    • 2021-07-22
    • 2019-04-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多