summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-12-13 16:25:53 -0800
committerMinh Nguyễn <mxn@1ec5.org>2015-12-13 17:26:53 -0800
commita01dd8ade1f4dd61aa87ddbdeacb03767703d19b (patch)
tree232d0c9c38267420853f4b8fa2520058cab7729a
parent835bb6ab081c41c8cacb651d9d0b410ff8d37d02 (diff)
downloadqtlocation-mapboxgl-a01dd8ade1f4dd61aa87ddbdeacb03767703d19b.tar.gz
[osx] Corrected documentation
Corrected the path to the build output. Also added a missing inline comment.
-rw-r--r--docs/BUILD_OSX.md2
-rw-r--r--platform/osx/src/MGLMapView.mm10
2 files changed, 7 insertions, 5 deletions
diff --git a/docs/BUILD_OSX.md b/docs/BUILD_OSX.md
index 0d3c685f41..87793c48da 100644
--- a/docs/BUILD_OSX.md
+++ b/docs/BUILD_OSX.md
@@ -4,7 +4,7 @@ This project provides an OS X SDK analogous to the Mapbox iOS SDK. Mapbox does n
### Build
-1. Run `make xpackage`, which produces a `Mapbox.framework` in the `gyp/build/Release/` folder.
+1. Run `make xpackage`, which produces a `Mapbox.framework` in the `build/osx/pkg/` folder.
### Install
diff --git a/platform/osx/src/MGLMapView.mm b/platform/osx/src/MGLMapView.mm
index 5d3995b3eb..0ccf93ba83 100644
--- a/platform/osx/src/MGLMapView.mm
+++ b/platform/osx/src/MGLMapView.mm
@@ -1659,14 +1659,16 @@ public:
std::sort(nearbyAnnotations.begin(), nearbyAnnotations.end());
if (nearbyAnnotations == _annotationsNearbyLastClick) {
+ // The first selection in the cycle should be the one nearest to the
+ // click.
CLLocationCoordinate2D currentCoordinate = [self convertPoint:point toCoordinateFromView:self];
std::sort(nearbyAnnotations.begin(), nearbyAnnotations.end(), [&](const MGLAnnotationTag tagA, const MGLAnnotationTag tagB) {
CLLocationCoordinate2D coordinateA = [[self annotationWithTag:tagA] coordinate];
CLLocationCoordinate2D coordinateB = [[self annotationWithTag:tagB] coordinate];
- double distanceA = hypot(coordinateA.latitude - currentCoordinate.latitude,
- coordinateA.longitude - currentCoordinate.longitude);
- double distanceB = hypot(coordinateB.latitude - currentCoordinate.latitude,
- coordinateB.longitude - currentCoordinate.longitude);
+ CLLocationDegrees distanceA = hypot(coordinateA.latitude - currentCoordinate.latitude,
+ coordinateA.longitude - currentCoordinate.longitude);
+ CLLocationDegrees distanceB = hypot(coordinateB.latitude - currentCoordinate.latitude,
+ coordinateB.longitude - currentCoordinate.longitude);
return distanceA < distanceB;
});