简体   繁体   中英

Customize SVG icons in Tilemill/Mapbox

I added a data layer on my map and I'm using an svg image to represent the markers.

#points {
  point-file: url(marker2.svg);
  marker-width:10;
  marker-fill:#fff;
}

since it's an SVG image, I'm trying to customize the fill color but it is not working. marker-fill seems to only work on the markers they provide, but not on SVG images. Is this possible to do using TileMill/Mapbox ? Is it possible with the JS API ?

UPDATE

From http://mapbox.com/blog/announcing-tilemill-0.10.0/ , it looks like using marker-fill should have done the trick but that's not the case. Could the problem be with my svg image ?

Solved it, looks like if you're looking to customize the marker, you need

marker-file: url(marker2.svg); instead of point-file: url(marker2.svg);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM