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

Commit

Permalink
Match results from before optimization.
Browse files Browse the repository at this point in the history
  • Loading branch information
julianrex committed Jun 15, 2020
1 parent 418dee0 commit 4e9878d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,11 @@ - (void)testQueryRoadsAroundDCAccessibilityResults🔒 {

NSString *filename = @"testQueryRoadsAroundDC";

#if 0
writeDictionaryToFile(accessibilityDictionary, [NSString stringWithFormat:@"%@.json", filename]);
#else

NSDictionary *expected = readAccessibilityDictionaryFromBundle(filename, [NSBundle bundleForClass:[self class]]);
XCTAssertNotNil(expected);
[self assertAccessibilityDictionary:accessibilityDictionary isEqualToDictionary:expected];
#endif

accessibilityDictionary = nil;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.63731</real>
<real>0.11232</real>
<key>baselineIntegrationDisplayName</key>
<string>Jun 14, 2020 at 3:24:48 PM</string>
<string>Jun 15, 2020 at 12:15:03 AM</string>
</dict>
</dict>
<key>testQueryRoadsPerformanceAroundDC🔒</key>
<dict>
<key>com.apple.XCTPerformanceMetric_WallClockTime</key>
<dict>
<key>baselineAverage</key>
<real>0.052211</real>
<real>0.052153</real>
<key>baselineIntegrationDisplayName</key>
<string>Jun 14, 2020 at 3:12:22 PM</string>
<string>Jun 15, 2020 at 12:15:03 AM</string>
</dict>
</dict>
</dict>
Expand Down
15 changes: 9 additions & 6 deletions platform/ios/src/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2931,12 +2931,14 @@ - (void)generateAccessibilityElementsIfNeeded

// Places
NSArray *sortedPlaceFeatures = nil;

NSArray *visiblePlaceFeatures;
if (!_sortedVisiblePlaceElements) {

MGL_SIGNPOST_BEGIN(self.log, signpost, "gae/query-places");
NSArray *placeStyleLayerIdentifiers = [self.style.placeStyleLayers valueForKey:@"identifier"];
NSArray *visiblePlaceFeatures = [self visibleFeaturesInRect:bounds inStyleLayersWithIdentifiers:[NSSet setWithArray:placeStyleLayerIdentifiers]];

// TODO:
/*NSArray **/visiblePlaceFeatures = [self visibleFeaturesInRect:bounds inStyleLayersWithIdentifiers:[NSSet setWithArray:placeStyleLayerIdentifiers]];
MGL_SIGNPOST_END(self.log, signpost, "gae/query-places");


Expand Down Expand Up @@ -2970,7 +2972,6 @@ - (void)generateAccessibilityElementsIfNeeded
NSUInteger numberOfPlaces = _sortedVisiblePlaceElements.count;

// Roads

if (!_sortedVisibleRoadElements) {
MGL_SIGNPOST_BEGIN(self.log, signpost, "gae/query-roads");
NSArray *roadStyleLayerIdentifiers = [self.style.roadStyleLayers valueForKey:@"identifier"];
Expand Down Expand Up @@ -3027,7 +3028,8 @@ - (void)generateAccessibilityElementsIfNeeded
{
MGL_SIGNPOST_BEGIN(self.log, signpost, "gae/build-elements");

BOOL compassViewVisible = self.compassView.alpha > 0.0;
// TODO: Previously, accessibility considered the compass always visible
BOOL compassViewVisible = YES;//self.compassView.alpha > 0.0;
BOOL userLocationViewVisible = self.userLocationAnnotationView && !self.userLocationAnnotationView.isHidden;
BOOL attributionButtonVisible = self.attributionButton && !self.attributionButton.isHidden;

Expand Down Expand Up @@ -3081,8 +3083,9 @@ - (void)generateAccessibilityElementsIfNeeded
if (numberOfPlaces > 0) {
NSMutableArray *placesArray = [NSMutableArray arrayWithCapacity:4];
NSMutableSet *placesSet = [NSMutableSet setWithCapacity:numberOfPlaces];

for (id <MGLFeature> placeFeature in sortedPlaceFeatures) {
// TODO:
// for (id <MGLFeature> placeFeature in sortedPlaceFeatures){
for (id <MGLFeature> placeFeature in visiblePlaceFeatures.reverseObjectEnumerator){
NSString *name = [placeFeature attributeForKey:@"name"];
if (![placesSet containsObject:name]) {
[placesArray addObject:name];
Expand Down

0 comments on commit 4e9878d

Please sign in to comment.