Skip to content
Discussion options

You must be logged in to vote

MapMaker can change the built-in icon styling, but it does not currently upload and host a custom sprite for the style. There are two practical ways to add your own icons after exporting the style.

1. Add the images in MapLibre GL JS (simplest)

Load each PNG after the style has loaded, register it with addImage, then change the POI symbol layers' icon-image expression.

map.on('style.load', async () => {
  const custom = {
    church: '/icons/church.png',
    peak: '/icons/peak.png',
    water: '/icons/water.png'
  };

  for (const [id, url] of Object.entries(custom)) {
    const image = await map.loadImage(url);
    if (!map.hasImage(id)) map.addImage(id, image.data);
  }

  const iconFor…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by muesliq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants