Select to view content in your preferred language

Best class for handling bounding boxes

689
3
Jump to solution
06-07-2023 01:16 AM
padmalcom
Occasional Contributor

Hi, we are coming from OSMdroid and work with the class bounding box which specifies an area defined by two lon/lat pairs. Now that we migrate to ESRI Maps SDK I wonder what class you propose for such a bounding box.

1 Solution

Accepted Solutions
GuntherHeppner
Esri Contributor

Hi @padmalcom,

Could you provide more details on which specific API calls or use case(s) you want to make/achieve with the ESRI Maps SDK?

I'm guessing you want to specify an area on the map, in which case you would likely want ot use Envelope.

View solution in original post

0 Kudos
3 Replies
GuntherHeppner
Esri Contributor

Hi @padmalcom,

Could you provide more details on which specific API calls or use case(s) you want to make/achieve with the ESRI Maps SDK?

I'm guessing you want to specify an area on the map, in which case you would likely want ot use Envelope.

0 Kudos
padmalcom
Occasional Contributor

Hi @GuntherHeppner, we are calling an api to get all points within an area - specifically on the area shown in the current mapView. I found Envelope but it does not use lat/lon but x/y and thus everything in me refuses to  use it since it is not geo specific. So I think we go with a custom data class. Nevertheless, thanks for your response.

0 Kudos
GuntherHeppner
Esri Contributor

An Envelope can handle lat/lon. It is used to specify a geographic area on the map, see the documentation on its base class Geometry

You might also want to take a look at MapView.screenToLocation, which allows you to convert a screen point to a geographic point in map coordinates. From these points you can then create an Envelope.

0 Kudos