简体   繁体   English

在Tilemill / Mapbox中自定义SVG图标

[英]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. 我在地图上添加了一个数据层,并且正在使用svg图像表示标记。

#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. 由于它是SVG图像,因此我尝试自定义填充颜色,但无法正常工作。 marker-fill seems to only work on the markers they provide, but not on SVG images. marker-fill似乎仅适用于它们提供的标记,而不适用于SVG图像。 Is this possible to do using TileMill/Mapbox ? 使用TileMill / Mapbox可以做到吗? Is it possible with the JS API ? 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. http://mapbox.com/blog/announcing-tilemill-0.10.0/看来,使用marker-fill应该可以解决问题,但事实并非如此。 Could the problem be with my svg image ? 问题出在我的svg图片上吗?

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); 而不是point-file: url(marker2.svg);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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