Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Problem with check if a marker is inside visible region or not when map bearing is not 0. #11363

Closed
kingfisherphuoc opened this issue Mar 2, 2018 · 2 comments

Comments

@kingfisherphuoc
Copy link

kingfisherphuoc commented Mar 2, 2018

**Platform: Android **
Mapbox SDK version: 5.4.1

Steps to trigger behavior

  1. Open MapView, add a marker and rotate map (map bearing is not 0).
  2. Use mapboxMap.getProjection().getVisibleRegion().latLngBounds.contains(latLng); to check if marker is inside the visible region or not

Expected behavior

The marker should be inside the latlngBounds.

Actual behavior

The function return false even though the marker is visible to me. It's pretty weird while it returned true if I did not rotate mapview (bearing = 0).

This is the value of mapboxMap.getProjection().getVisibleRegion().latLngBounds:

latitudeNorth = 21.00293121818784
latitudeSouth = 21.003773874652552
longitudeEast = 105.80025097650582
longitudeWest = 105.80326133152118

This is my marker position:

latitude = 21.003241995
longitude = 105.802001673
@tobrun
Copy link
Member

tobrun commented Mar 2, 2018

Thanks for the report @kingfisherphuoc , @osana fixed this with #11226. I cherry picked that commit to be included in the 5.5.0 release that happened yesterday. Would you be able to retest? Closing as issue is already resolved. Note that a couple more improvements are coming to 6.0.0 (eg. crossing dateline etc).

@tobrun tobrun closed this as completed Mar 2, 2018
@kingfisherphuoc
Copy link
Author

oops, I am sorry that I did not notice the newest release. I tested and it worked! Great work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants