【问题标题】:Google maps api: what are xa and pa in get bounds?Google maps api:get bounds 中的 xa 和 pa 是什么?
【发布时间】:2014-10-25 21:12:00
【问题描述】:

Api 参考告诉我 getBounds() 返回 SW 和 NE 极值的坐标。当我调用它时,它返回给我一个以 xa 和 pa 作为键的对象,它们每个都以 j 和 k 作为坐标所在的键,看似随机。我试图在文档中找到它们,但一无所获。我可以编写自定义代码来找到最小值和最大值来自己确定它们,但我想知道我是否能知道它们的含义。

【问题讨论】:

    标签: javascript google-maps-api-3


    【解决方案1】:

    你应该使用:

    var bounds = map.getBounds();
    var NE = bounds.getNorthEast();
    var SW = bounds.getSouthWest();
    

    【讨论】:

      【解决方案2】:

      它们是“未记录的属性”。不要不要在您的代码中使用它们(它们会随着 API 版本的变化而变化)。

      使用documented methods of the google.maps.LatLngBounds object

      getNorthEast() | LatLng | Returns the north-east corner of this bounds.
      getSouthWest() | LatLng | Returns the south-west corner of this bounds.
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2011-05-02
        • 2013-07-10
        • 2023-03-25
        • 2010-11-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多