从当前边界或笛卡尔坐标/矩形形状获得平躺的经度和纬度 [英] get lying longitude and latitude from current bound or Cartesian coordinates/Rectangle shape

查看:265
本文介绍了从当前边界或笛卡尔坐标/矩形形状获得平躺的经度和纬度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力从地图上绘制的形状获取Instagram结果。
Instagram需要经纬度和半径。

  https://api.instagram.com/v1/media/ search?lat = 48.858844& lng = 2.294351& access_token = ACCESS-TOKEN 

我的问题是我可以做到这一点,如果我使用圆形,但矩形我没有得到什么发送到API。

我的图像/地图加矩形。





如果我使用 getBounds();
然后我得到

  _northEast 

Object {lat = 33.97980872872457,lng = -82.166748046875,equals = function(),more ...}

_southWest

Object {lat = 33.568861182555565,lng = -83.5565185546875,equals = function(),more ...}



但Api只需要一个经纬度。在这种情况下,有人可以帮助发送给api吗?

解决方案> GMSGeometryContainsLocation(coordinate,rect ,true)将为此工作。将CLLocationCoordinate2D的对象作为坐标传递,GMSPath作为直接传递。它给Bool值。
谢谢


I am working to get Instagram results from a shape drawn on a map. Instagram needs lat and lon + radius.

https://api.instagram.com/v1/media/search?lat=48.858844&lng=2.294351&access_token=ACCESS-TOKEN

What my issue is I can do this if I use circle but for rectangle I am not getting what to send to api.

My image/ map plus rectangle.

If I use getBounds(); Then I get

_northEast

    Object { lat=33.97980872872457, lng=-82.166748046875, equals=function(), more...}

_southWest

    Object { lat=33.568861182555565, lng=-83.5565185546875, equals=function(), more...}

But Api needs only one lat and lon. So can some one help what to send to api in this case?

解决方案

GMSGeometryContainsLocation(coordinate, rect, true) will work for this. Pass the object of CLLocationCoordinate2D as coordinate and and GMSPath as rect. It give Bool value. Thanks

这篇关于从当前边界或笛卡尔坐标/矩形形状获得平躺的经度和纬度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆