Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom icons #3346

Closed
gmaclennan opened this issue Aug 12, 2016 · 5 comments
Closed

Support custom icons #3346

gmaclennan opened this issue Aug 12, 2016 · 5 comments

Comments

@gmaclennan
Copy link
Contributor

Similar to how the API currently supports other options for customized deployments it would be very useful to support custom icons associated with custom presets. Maintaining a fork for custom icons is challenging.

Potentially related: #3025

@tmcw this might already be happening as part of the refactor?

@bhousel
Copy link
Member

bhousel commented Aug 12, 2016

Yes, #3025 was an idea related to this.. I'm not sure yet how we'll do it.
cc @jimmyrocks, who implemented a custom iconset for places editor - I know he was looking into this..

@sweco-semtne
Copy link

Is there any documentation on whats required to add custom icons besides what is described in #3025?
I mean if I were to add an icon to a custom build of iD, what is the current preferred way?

@bhousel
Copy link
Member

bhousel commented Oct 18, 2016

We still use the make to compile assets like svg sprites. This will go away soon and be replaced with a node script or npm run command or something.

But for now I would:

  1. Edit the Makefile to do the same thing we do to create the maki spritesheet:
MAKI_SOURCES = node_modules/maki/src/*.svg

dist/img/maki-sprite.svg: $(MAKI_SOURCES) Makefile
        node_modules/.bin/svg-sprite --symbol --symbol-dest . --symbol-sprite $@ $(MAKI_SOURCES)

...add some lines to do that for your own icons.

2. Then edit modules/svg/defs.js around here to import your icons into iD's <defs> svg element.

3. Then you can use them in iD, but that will require customization in different parts of the code that expect maki icons to exist.

@sweco-semtne
Copy link

Thanks for the great support.
Is there a timeline for the refactor you mentioned?

@bhousel
Copy link
Member

bhousel commented Nov 1, 2016

Closing this in favor of #3025

Update: the Makefile is gone and we use npm scripts for building things now.

@bhousel bhousel closed this as completed Nov 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants