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

Commit

Permalink
[ios, macos] Update shapeAnnotationIsEnabled documentation, improve c…
Browse files Browse the repository at this point in the history
…ode readability.
  • Loading branch information
fabian-guerra committed Aug 20, 2018
1 parent f9472b5 commit 995f0b9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion platform/ios/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Mapbox welcomes participation and contributions from everyone. Please read [CONT
* Fixed inconsistencies in exception naming. ([#12583](https://github.com/mapbox/mapbox-gl-native/issues/12583))
* Added `MGLShapeOfflineRegion` for defining arbitrarily shaped offline regions [#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447)
* Added a one-time warning about possible attribute loss when initializing an `MGLShapeSource` with an `MGLShapeCollection` [#12625](https://github.com/mapbox/mapbox-gl-native/pull/12625)
* Added an -[MGLMapViewDelegate mapView:shapeAnnotationIsEnabled:] method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352))
* Added an `-[MGLMapViewDelegate mapView:shapeAnnotationIsEnabled:]` method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352))

## 4.3.0 - August 15, 2018

Expand Down
5 changes: 2 additions & 3 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4183,9 +4183,8 @@ - (MGLAnnotationTag)annotationTagAtPoint:(CGPoint)point persistingResults:(BOOL)
{
if ([annotation isKindOfClass:[MGLMultiPoint class]])
{
if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)] &&
![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]) {
return true;
if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)]) {
return !!(![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]);
} else {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions platform/ios/src/MGLMapViewDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,8 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns a Boolean value indicating whether the shape annotation can be selected.
If the return value is YES, the user can select the annotation by tapping [clicking]
on it. If the delegate does not implement this method, the default value is YES.
If the return value is `YES`, the user can select the annotation by tapping
on it. If the delegate does not implement this method, the default value is `YES`.
@param mapView The map view that has selected the annotation.
@param annotation The object representing the shape annotation.
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* The `-[MGLMapView annotationAtPoint:]` method can now return annotations near tile boundaries at high zoom levels. ([#12570](https://github.com/mapbox/mapbox-gl-native/pull/12570))
* Fixed inconsistencies in exception naming. ([#12583](https://github.com/mapbox/mapbox-gl-native/issues/12583))
* Added `MGLShapeOfflineRegion` for defining arbitrarily shaped offline regions [#11447](https://github.com/mapbox/mapbox-gl-native/pull/11447)
* Added an -[MGLMapViewDelegate mapView:shapeAnnotationIsEnabled:] method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352))
* Added an `-[MGLMapViewDelegate mapView:shapeAnnotationIsEnabled:]` method to specify whether an annotation is selectable. ([#12352](https://github.com/mapbox/mapbox-gl-native/pull/12352))

# 0.10.0 - August 15, 2018

Expand Down
5 changes: 2 additions & 3 deletions platform/macos/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2108,9 +2108,8 @@ - (MGLAnnotationTag)annotationTagAtPoint:(NSPoint)point persistingResults:(BOOL)

if ([annotation isKindOfClass:[MGLMultiPoint class]])
{
if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)] &&
![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]) {
return true;
if ([self.delegate respondsToSelector:@selector(mapView:shapeAnnotationIsEnabled:)]) {
return !!(![self.delegate mapView:self shapeAnnotationIsEnabled:(MGLMultiPoint *)annotation]);
} else {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions platform/macos/src/MGLMapViewDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ NS_ASSUME_NONNULL_BEGIN
/**
Returns a Boolean value indicating whether the shape annotation can be selected.

If the return value is YES, the user can select the annotation by tapping [clicking]
on it. If the delegate does not implement this method, the default value is YES.
If the return value is `YES`, the user can select the annotation by clicking
on it. If the delegate does not implement this method, the default value is `YES`.

@param mapView The map view that has selected the annotation.
@param annotation The object representing the shape annotation.
Expand Down

0 comments on commit 995f0b9

Please sign in to comment.