0

If I zoom my NMAMapView completely out so that you can see the earth globe (NMAMapViewMinimumZoomLevel) a call to NMAMapViews boundingBox property does return the following coordinates for all the top* / bottom* properties:

po self.hereMapView.boundingBox?.topRight
▿ Optional<NMAGeoCoordinates>
  - some : <NMAGeoCoordinates: 0x2828bde00; latitude = -90.000000; longitude = 0.000000; altitude = -340282346638528859811704183484516925440.000000>

self.hereMapView.boundingBox?.topLeft
▿ Optional<NMAGeoCoordinates>
  - some : <NMAGeoCoordinates: 0x2828bca20; latitude = -90.000000; longitude = 0.000000; altitude = -340282346638528859811704183484516925440.000000>

// ...

This is also the case for some zoom levels above. This does not seem correct to me, is this a bug in Here SDK?

Edit: This seems to be only a problem with the 3D projection, in the 2D projection at the lowest zoom level we do get valid coordinates

JonEasy
  • 921
  • 10
  • 22
  • Which version of the HERE mobile SDK are you using? –  Jan 07 '20 at 09:12
  • It's HEREMaps 3.11.2 – JonEasy Jan 07 '20 at 11:45
  • Are you able to use the latest release which is 3.14 to test if the same issue still persists? You can download it from your account on developer.here.com –  Jan 07 '20 at 12:49
  • Because of our deployment target I can only go up to 3.13.3 and the issue still exists here unfortunately – JonEasy Jan 07 '20 at 13:46
  • 1
    Thanks for the info. We are looking into it and will get back to you soon. –  Jan 08 '20 at 08:46
  • I checked the latest HERE SDK version and get the same results. Looks like this behaviour has always been the same. Bounding box is rectangular area in a geographic coordinate system. Please note [top/bottom]/[right/left] are NMAGeoCoordinates. It is not possible to set invalid lat/log. Values outside of [-90, 90] or [-180;180] will be clamped to that range. Do you expect it to be some invalid values or valid ones but different for top and bottom? – dashchak Jan 14 '20 at 18:20

1 Answers1

1

Following the update in the question (valid Bounding box in 2D Projection) and comments from @dashchak ,this is expected behavior,The bounding box is a rectangle which would be capped to a value different from the bounds of a rectangle.

From Documentation :

The boundingBox of the map is the smallest possible NMAGeoBoundingBox which contains all of the map area currently visible on the screen. If the map is in 2D view (zero tilt), the boundingBox should (nearly) exactly coincide with the bounds of the screen rect. If the map is in 3D view, the visible screen area is a trapezoid in geographical space (the visible area is wider at the top of the screen than at the bottom due to perspective). Thus, the bounding box will contain some area that is not actually visible on the screen in this case.

  • I agree with the documentation. "If the map is in 3D view, the visible screen area is a trapezoid in geographical space (*the visible area is wider at the top of the screen than at the bottom due to perspective*). Thus, the bounding box will contain some area that is not actually visible on the screen in this case." What I get when the whole globe is in sight however is a bounding box with 4 coordinates (-90, 0) for each of it's corners. So that would mean the visible bounding box' width and height is 0. Can you explain to me how this is correct behaviour? – JonEasy Jan 29 '20 at 13:38
  • Not trying to be snarky here, appreciate the response thank you. – JonEasy Jan 29 '20 at 13:42
  • In general, bounding box are intended to be used with Mercator projection to approximate the spherical/ellipsoid shape of earth to a 2D rectangle, when totaly zoomed out and a whole spherical/ellipsoid shape of earth is shown, this approximation does not make much sense hence the coordinates are capped to the default values. You can try switching to a Mercator projection(NMAProjectionTypeMercator) in NMAMapView to check if the behavior is more as per your expectation. –  Feb 03 '20 at 08:25
  • In 3.15 SDK, bounding box will be nil if any of screen corners can not be projected on the map view. – dashchak Feb 14 '20 at 14:40