-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Location mark (not drawn) disappears when view crosses international date line. #3995
Comments
@manimaul thank you for reporting this edge-case, this is great information to have. |
There's no edge like the dateline edge. 🤔 |
@tobrun yes, dealing with the dateline is always fun. I'm wondering if you're willing to escalate this issue as it is a blocker for me. I have a large audience in New Zealand who use my app (MX Mariner) on the water, near the dateline. I'm currently using the previously deprecated Mapbox SDK and this is the remaining issue before making the switch to Mapbox GL. Thank you, |
@mb12 thanks, I'll definitely keep an eye on those issues before making the leap. |
@manimaul I added this issue to the higher priority list of bugs to solve. Sorry for not being able to give you a concrete ETA. It is not the only issue on that list. For now I'm doing some small tests around this issue to identify the source and determine the amount of work needed to get a fix in. |
@tobrun I'm using the Genymotion Android emulator which makes it easy to set the device's location. other options:
|
@manimaul if you pan the map a bit to the right, the UserLocationView disappears: The source of that issue will be the solution to what is mentioned above. |
I was able to pinpoint this to public PointF getMarkerScreenPoint() {
if (mMyLocationTrackingMode == MyLocationTracking.TRACKING_NONE) {
mMarkerScreenPoint = mProjection.toScreenLocation(mMarkerCoordinate);
} else {
// tracking the user
}
return mMarkerScreenPoint;
} This method is being called on every update call, to get the correct x,y coordinates for the UserLocationView. Currently not the correct values are returned. For example:
after
|
Been trying to locate this problem in C++. It is going through In PrecisionPoint TransformState::latLngToPoint(const LatLng& latLng) const {
return coordinateToPoint(latLngToCoordinate(latLng));
} which on his turn calls PrecisionPoint TransformState::coordinateToPoint(const TileCoordinate& coord) const {
mat4 mat = coordinatePointMatrix(coord.zoom);
matrix::vec4 p;
matrix::vec4 c = {{ coord.column, coord.row, 0, 1 }};
matrix::transformMat4(p, c, mat);
return { p[0] / p[3], height - p[1] / p[3] };
} TileCoordinate TransformState::latLngToCoordinate(const LatLng& latLng) const {
const double tileZoom = getZoom();
const double k = zoomScale(tileZoom) / worldSize();
return {
lngX(latLng.longitude) * k,
latY(latLng.latitude) * k,
tileZoom
};
} |
I made a follow up issue #4155, since this problem is found in |
I'm closing this issue in favour of #4155 |
Given the view crosses the international date line (180 degrees E)
Given the center of the screen is right/east of the dateline
When the user location is east of the dateline
Then the user location should be drawn (but is not drawn)
See below screenshots where the location is: 16.85 S , 179.89 W
The text was updated successfully, but these errors were encountered: