This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
fixes #1675: fix initial annotation markers - #2289
Merged
Merged
Conversation
Contributor
Author
|
Here's a simple diff to check the behavior: diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm
index d94e41b..e7548c6 100644
--- a/ios/app/MBXViewController.mm
+++ b/ios/app/MBXViewController.mm
@@ -82,7 +82,14 @@ static NSUInteger const kStyleVersion = 8;
target:self
action:@selector(locateUser)];
- [self restoreState:nil];
+// [self restoreState:nil];
+
+ self.mapView.debugActive = YES;
+
+ MGLPointAnnotation *point = [MGLPointAnnotation new];
+ point.coordinate = CLLocationCoordinate2DMake(45, -123);
+ [self.mapView addAnnotation:point];
+ [self.mapView setCenterCoordinate:point.coordinate zoomLevel:15 animated:NO];
}
- (void)saveState:(__unused NSNotification *)notification
@@ -354,6 +361,8 @@ static NSUInteger const kStyleVersion = 8;
- (MGLAnnotationImage *)mapView:(MGLMapView * __nonnull)mapView imageForAnnotation:(id <MGLAnnotation> __nonnull)annotation
{
+ if (annotation.title == nil) return [MGLAnnotationImage annotationImageWithImage:[UIImage imageNamed:@"Icon.png"] reuseIdentifier:@"foo"];
+
NSString *title = [(MGLPointAnnotation *)annotation title];
NSString *lastTwoCharacters = [title substringFromIndex:title.length - 2]; |
Contributor
Author
|
I should add that this |
…ost-sprite/sprite store load
incanus
force-pushed
the
1675-initial-zoom-markers
branch
from
September 9, 2015 01:04
9c6993b to
0d899df
Compare
Contributor
Author
|
Mind giving this a pass @friedbunny @1ec5 in light of the First Steps guide? Working good for me. |
Contributor
|
Lookin' at this... |
Contributor
|
Works well, polylines and markers both show up immediately when drawn in |
This was referenced Sep 14, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does two things:
Observerpattern already used in the style and the map context for decoupled communications.