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

Fix for issue #5 (markers) & #9 (simplestyle) - #21

Closed
ghost wants to merge 4 commits into
masterfrom
unknown repository
Closed

ghost wants to merge 4 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jan 14, 2014

Copy link
Copy Markdown

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_MAKI unless something slipped through the cracks.

There are three main parts to my code:

  1. MBXSimpleStylePointAnnotation implements MKAnnotation by way of MKShape, 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 your pin.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.

  2. In MBXMapView, -(void)updateMarkers loads the simplestyle geoJSON in parallel to the existing - (void)updateOverlay, and it creates an MBXSimpleStylePointAnnotation for 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 from updateOverlay because it looked like that could potentially cause an infinite loop.

  3. In viewDidLoad of MBXViewController.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.

…nt markers to the map with coordinate, title, and description using the generic MKPointAnnotation red pin. Next step is to get Maki markers working.
@ghost

ghost commented Feb 4, 2014

Copy link
Copy Markdown
Author

@incanus, FYI this one will need a bit of extra attention to merge for two reasons:

  1. Auto-merge doesn't work because of conflicts between this and pull request MBTiles for MBXMapKit (fix for issue #3 & #7) #20 (MBTiles). I tested it out and my manual merge is part of https://github.com/wsnook/mbxmapkit/compare/dev-0.1.1
  2. As I mentioned above, it needs a new demo map which includes markers.

@ghost

ghost commented Feb 17, 2014

Copy link
Copy Markdown
Author

I'm gonna close this for now as I've incorporated it into a new branch over at #38.

@ghost ghost closed this Feb 17, 2014
@incanus incanus reopened this Feb 21, 2014
@incanus incanus added this to the 0.2.0 milestone Feb 21, 2014
@incanus incanus mentioned this pull request Feb 24, 2014
@ghost

ghost commented Feb 25, 2014

Copy link
Copy Markdown
Author

@incanus, I'm closing this per #9 (comment). I'm gonna make two new pull requests, starting with just simplestyle for #9.

@ghost ghost closed this Feb 25, 2014
@ghost ghost mentioned this pull request Feb 26, 2014
@ghost
ghost deleted the issues5+9 branch February 27, 2014 21:44
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants