This repository was archived by the owner on Aug 25, 2023. It is now read-only.
Repository navigation
Closed
Conversation
…nt markers to the map with coordinate, title, and description using the generic MKPointAnnotation red pin. Next step is to get Maki markers working.
Author
|
@incanus, FYI this one will need a bit of extra attention to merge for two reasons:
|
Author
|
I'm gonna close this for now as I've incorporated it into a new branch over at #38. |
Author
|
@incanus, I'm closing this per #9 (comment). I'm gonna make two new pull requests, starting with just simplestyle for #9. |
ghost
deleted the
issues5+9
branch
February 27, 2014 21:44
This pull request was closed.
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 is a fix for issues #5 and #9 which are closely related. All my new changes should be fenced off with
#ifdef MBXMAPKIT_ENABLE_SIMPLESTYLE_MAKIunless something slipped through the cracks.There are three main parts to my code:
MBXSimpleStylePointAnnotationimplementsMKAnnotationby way ofMKShape, and it knows how to download stand-alone marker images from the MapBox Core API (see https://www.mapbox.com/developers/api/#Stand-alone.markers). Justin, I chose to diverge a little bit from yourpin.pinImageID = MBXPinImageBus;suggestion because there's a pretty significant advantage to closely following the Core API... when new Maki icons are added, this code should still work without having to make any changes. One obvious potential improvement to my code would be to add defaults for the size and color, but for now I haven't done that.In
MBXMapView,-(void)updateMarkersloads the simplestyle geoJSON in parallel to the existing- (void)updateOverlay, and it creates anMBXSimpleStylePointAnnotationfor each Point in the simplestyle. The geoJSON, and the markers, are added to the cache according to the existing caching patterns. However, I didn't copy the automatic retry fromupdateOverlaybecause it looked like that could potentially cause an infinite loop.In
viewDidLoadofMBXViewController.m, I included a demonstration (in the style of issue add simplestyle support #9) for a map which I created on my MapBox account since the existing example map did not include any simplestyle features for testing with. I also demonstrated how to manually add a point marker (in the style of issue add MapBox marker support #5). An important thing to note is that a new demo map with simplestyle features needs to be created, and the map ID needs to be changed, before this gets merged.I've done some moderate testing for this on iOS, and it all seemed to work well. I have no idea what will happen on the Mac side since I don't have a membership to test that.