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?
Based on the Instagram API, you can ONLY send a circle. The closes equivalent would be send the smallest enclosing circle
With the Maps API, I would take a shortcut and use the following algorithim:
getBounds().getCenter()
to get the center LatLng of your rectangle. This is your LatLng.computeDistanceBetween
method of the geometry library along with either of the points from the originalgetBounds()
call to calculate your radius.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