Skip to content

API for list of available icons #60

Closed

Description

@incanus

It would be very handy to have an API for getting a list of available icons in the Maki set. This could benefit both projects like https://github.com/mapbox/mapbox-ios-sdk as well as http://mapbox.com/map-sites/locator/. In the former, I could make use of it to easily track changes and ship an offline, bundled version for offline apps. In the latter, the list of available icons for markers could be dynamic.

@samanpwbb @heyitsgarrett

Activity

  1. heyitsgarrett commented on Mar 21, 2013

    @heyitsgarrett
    Contributor

    Ah, I was running into this too last week when I was digging into Maki. Great idea.

  2. incanus commented on Mar 21, 2013

    @incanus
    ContributorAuthor

    Cool, that looks perfect. I guess we just need to make sure that it can be relied upon as an API. There is a difference between mapbox.com (GitHub) and tiles.mapbox.com (geo-redundant cloud).

  3. samanpwbb commented on Mar 21, 2013

    @samanpwbb
    Contributor

    Yeah, I try to make sure http://mapbox.com/maki/www/maki.json is up to date. What it would take to dependably keep http://mapbox.com/maki/www/maki.json available so you'd feel comfortable referencing it in your code? I'm guessing this is not an easy task? What are the options? Would add complexity to deploying maki that I don't know anything about.

  4. incanus commented on Mar 21, 2013

    @incanus
    ContributorAuthor

    @willwhite any thoughts on that?

  5. tmcw commented on Mar 21, 2013

    @tmcw
    Contributor

    This seems unnecessary. The locator project is just using gh-pages atm, and the difference between 'github' and 'geo-redundant cloud' is slight. If you need 100% uptime, have your makefile wget the file into your project.

  6. incanus commented on Mar 21, 2013

    @incanus
    ContributorAuthor

    That's great for when I build the project, but the SDK lives on in apps that deploy in the wild. Dependencies include the user updating the app and the developer updating the SDK in the source. It's not a viable option for non-web apps.

  7. tmcw commented on Mar 21, 2013

    @tmcw
    Contributor

    You would have your XcodeMakefile or whatever copy the file into the SDK and distribute that. People would get updated icons when they update the SDK.

  8. incanus commented on Mar 21, 2013

    @incanus
    ContributorAuthor

    To clarify: an API for getting the list of icons could enable a developer to build an app allowing selection of marker icon on the fly. So I'm talking also about uses beyond offline pre-bundling of the icons.

  9. tmcw commented on Mar 21, 2013

    @tmcw
    Contributor

    And that list could be prepackaged in the SDK, pulled from the existing maki.json file. What am I missing here?

  10. incanus commented on Mar 21, 2013

    @incanus
    ContributorAuthor

    So in the case of Locator, @heyitsgarrett has to watch Maki, and periodically, as icons are added, update that project manually or not benefit from the new icons.

    Same for the SDK. I need to watch Maki, determine when enough icons have been added to warrant rolling a new version of the SDK, do that, and then get developers to upgrade. And then users to update the apps.

    There is more power for developers in making this an API, and less administrivia for our team to deal with.

  11. heyitsgarrett commented on Mar 21, 2013

    @heyitsgarrett
    Contributor

    I actually couldn't find this JSON earlier, but I could poll this list rather easily on my end for the Locator icons, so I don't really have a dog in this fight.

  12. incanus commented on Feb 24, 2014

    @incanus
    ContributorAuthor

    Case in point:

    • The aforementioned https://github.com/mapbox/maki/blob/gh-pages/www/maki.json link is now dead.
    • Correcting it for https://github.com/mapbox/maki/blob/mb-pages/www/maki.json now reveals a literal symbolic link description that also does not work.
    • I can eventually find https://github.com/mapbox/maki/blob/mb-pages/_includes/maki.json, but will that stay up? Can we build add MapBox marker support mbxmapkit#5 (comment) atop it?
  13. samanpwbb commented on Feb 24, 2014

    @samanpwbb
    Contributor
  14. incanus commented on Feb 24, 2014

    @incanus
    ContributorAuthor

    My bad, I missed it in @tmcw's original comment about that in rescanning this. Disregard above about branch-specific source URLs, and sorry.

    This is still unresolved though. Two parts:

    • Making sure new icons are added to this when available so that if someone adds one (or observes it being added) to the Maki project, they have it available via this API as well. i.e. if someone is building an application with our iOS tools, they should be able to extend to their users the ability to show a palette of available icons. This shouldn't depend on someone having to update the source code SDK, nor should it slip through the cracks as part of a manual JSON editing process.
    • Versioning, discussed briefly in Versioning #61. We shouldn't deploy native code leaning on an unversioned URL which could 1) go away or 2) change format arbitrarily and require a (possibly two week) lead time on updating source code in an app to remedy. If we are going to build native code around this, it should be a real API, not just a JSON document hosted someplace.
  15. samanpwbb commented on Feb 24, 2014

    @samanpwbb
    Contributor

    Making sure new icons are added to this when available so that if someone adds one (or observes it being added) to the Maki project, they have it available via this API as well. i.e. if someone is building an application with our iOS tools, they should be able to extend to their users the ability to show a palette of available icons. This shouldn't depend on someone having to update the source code SDK, nor should it slip through the cracks as part of a manual JSON editing process.

    Icons will never slip through the cracks. In order to generate the CSS for the maki site, this JSON file needs a record of the icon. I make sure all pull requests include updates to the JSON.

    Versioning, discussed briefly in #61. We shouldn't deploy native code leaning on an unversioned URL which could 1) go away or 2) change format arbitrarily and require a (possibly two week) lead time on updating source code in an app to remedy.

    This is just about properly tagging releases via github right? Not that experienced versioning but next time I update the Maki project I'll add a tag and make a release.

    it should be a real API, not just a JSON document hosted someplace.

    I'm going to pull the "just a designer" card on this. Do you have any ideas for how to maintain Maki in a more useful way? Would be cool do be able to do more with the icon set. Can we learn anything from the http://api.thenounproject.com/ ?

  16. incanus commented on Feb 24, 2014

    @incanus
    ContributorAuthor

    This is just about properly tagging releases via github right? Not that experienced versioning but next time I update the Maki project I'll add a tag and make a release.

    To address this and your last point @samanpwbb, the difference is a version number in the URL, a là http://tiles.mapbox.com/v3.... The reason for this is there will be shipping native code in the wild pointing to a certain URL and if we want to change things up, we then require developers to sync releases (as well as user updates) to this URL change, which is basically impossible (both in terms of logistics and in terms of native code updates having a store review period). Analogy: you make a great site update, then "simply" require your users to all update their browsers as you push it live.

    If we like it how it is, we should add v1 to the URL, setup monitoring tests to make sure it's up, and then point native code at it.

    Do you have any ideas for how to maintain Maki in a more useful way?

    Unless I'm missing something, we should roll this out as we are tiles, directions, geocoding, etc., though I think it's far simpler as its static content between updates.

  17. samanpwbb commented on Feb 24, 2014

    @samanpwbb
    Contributor

    @incanus one more thing on versioning:

    There are no reasons to expect breaking changes to Maki. I think it'd be a bad idea to force our tools to use (or suggest that others should use) a static version of the icon set. I like the fact that I can incrementally update the icon set as soon as new icons are added and they're immediately available to everyone.

  18. samanpwbb commented on Feb 24, 2014

    @samanpwbb
    Contributor

    setup monitoring tests to make sure it's up

    Maki site is deployed the same way all the rest of our mb-pages sites are deployed. Don't we monitor this?

  19. incanus commented on Feb 24, 2014

    @incanus
    ContributorAuthor

    Sorry if I'm not being clear here. I want exactly that -- to not force tying Maki updates directly to our tools, but rather to have a reliable API for our (native) tools to query what's available and what each icon is called.

    What I want is to make this flow possible to our native developers:

    1. App queries .../maki.json and finds out what's available.
    2. App can then present an interface to user that builds on this info, such as allowing them to search for icons to add to their map via the tags we use or simply to use a template URL like http://api.tiles.mapbox.com/v3/marker/pin-m-{blah}.png and combine that with the always-updated list of available icons to show the icons in app.

    Without a reliable, versioned place to get the list of icons from, they can never fill in the {blah} dynamically based on the API info. Each release of the source code would be tied to whatever icons were available in Maki at the time of release to developers, frozen in time.

  20. incanus commented on Feb 24, 2014

    @incanus
    ContributorAuthor

    Hold on this; chatted offline and cleared some things up. I will add some tests to the repo that ensure the format is kept around / not broken so we can rely on it for production native code.

  21. samanpwbb commented on Feb 24, 2014

    @samanpwbb
    Contributor

    👍

  22. added a commit that references this issue on Feb 25, 2014
  23. incanus commented on Feb 25, 2014

    @incanus
    ContributorAuthor

    I just added some Mocha tests for the basics of what I'm looking for: ability to fetch on production URL and ability to parse the resulting JSON.

    Just to double-check, from what I could see:

    • Travis runs language-specific tests, in this case npm test.
    • This in turn runs Mocha as defined in package.json.
    • Mocha runs test/maki.test.js.

    I will add some more tests at a later time for checking expected structure, but pending above, we can call this done for now. Can someone confirm and close?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions