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

Icon doesn't render properly when using SVG and fa-icon #55

Open
leonardotvd opened this issue Aug 6, 2020 · 6 comments
Open

Icon doesn't render properly when using SVG and fa-icon #55

leonardotvd opened this issue Aug 6, 2020 · 6 comments
Labels

Comments

@leonardotvd
Copy link

leonardotvd commented Aug 6, 2020

Using SVG to be able to apply RGB color on an Extra Marker icon, it is not rendering properly the icon. As you can see in the image below, the fa-bolt icon is below the marker and there is a red shadow.

GreenStartBoltIcon

That is my code to create the extra marker:

var customIcon = L.ExtraMarkers.icon({
icon: 'fa-bolt',
markerColor: '#3deb47',
shape: 'start',
prefix: 'fa',
svg: true
});

What have I missed?

@coryasilva
Copy link
Owner

coryasilva commented Aug 7, 2020 via email

@leonardotvd
Copy link
Author

Even changing "start" to "star", it is showing wrong. Can you see that red shade behind the start and also the bolt icon under the marker? Is that right?

@coryasilva
Copy link
Owner

@leonardotvd Did you ever resolve this issue? (sorry for the 1 year later follow up... life)

@giaroc
Copy link

giaroc commented Feb 1, 2022

Hi, same problem here. Using SVG the icon is not in the correct position.
I have found this workaround. You have to set an extraClass to the marker icon and then you can add a CSS. In my example I used the following options:

L.ExtraMarkers.icon({
extraClasses: 'translate-to-markers',
icon: 'fa-circle',
iconColor: 'white',
markerColor: '#feb96a',
shape: 'circle',
prefix: 'fa',
svg: true
});

and my css:
.translate-to-markers {
transform: translate(11px, -41px);
}

2022-02-01 16_32_14-localhost_8000_it_

@JaviCodess
Copy link

Hi, i tried with the extraclass and is still not working. Does anyone have a solution for this issue?

@do9xe
Copy link

do9xe commented Dec 27, 2023

This is was causing the issue for me. Setting icon to true (or to any string at all) made my Marker show up on the map.
https://github.com/coryasilva/Leaflet.ExtraMarkers/blob/c4f5f1e4184194b584ef112a609af7a1f91db172/src/assets/js/leaflet.extra-markers.js#L30C23-L30C23

@coryasilva coryasilva added the faq label Sep 7, 2024
@coryasilva coryasilva reopened this Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants