admin管理员组文章数量:1418138
I want to use the leaflet AwesomeMarkers (.awesome-markers). However there is no possibility to not set a marker color. That means, I just want to have the icon on the map, with a transparent markerColor.
Anyone knows how to do that?
I want to use the leaflet AwesomeMarkers (https://github./lvoogdt/Leaflet.awesome-markers). However there is no possibility to not set a marker color. That means, I just want to have the icon on the map, with a transparent markerColor.
Anyone knows how to do that?
Share Improve this question asked Feb 10, 2016 at 10:49 threxxthrexx 1,2352 gold badges32 silver badges61 bronze badges 1-
you can use opacity also in
div
tag and prevent css apply to child tag..It will give u transparent background – Dhara Commented Feb 10, 2016 at 11:15
2 Answers
Reset to default 4Here's a fiddle that leaves out the color:
http://jsfiddle/VPzu4/861/
I've set the markerColor to transparent
which results in the marker getting the class awesome-marker-icon-transparent
and then I've defined my own style for that class which just removes the background for the icon.
Note that this will probably break something if Leaflet.awesome-markers ever decides to use the transparent
keyword in a different way.
Update:
To get rid of the shadow you could hide the entire leaflet-shadow-pane
by css but that would hide all the shadows.
To set the size of the marker you can try applying more css rules to awesome-marker-icon-transparent
or you can pass in the extraClasses
property which is used to add classes to the icon element.
There's also the possibility that one of the 160 forks in GitHub already does what you want.
for @vue-leaflet/vue-leaflet
packet in Vue 3. @vue-leaflet/vue-leaflet
version is 0.10.1
.
.leaflet-div-icon {
background: none !important;
border: none !important;
}
本文标签: javascriptset markerColor of leaflet AwesomeMarkers to 39nonetransparent39Stack Overflow
版权声明:本文标题:javascript - set markerColor of leaflet AwesomeMarkers to 'nonetransparent' - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745271463a2650917.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论