I want to create a maker for google maps which uses symbols from font-awesome. I would like that it looks somehow like this:
I found at Using Icon Fonts as Markers in Google Maps V3 a solution for this problem, however this requires to include a .js file which is ~0.5 MB large and thus not usable for me.
I also found this solution: https://github.com/lvoogdt/Leaflet.awesome-markers but I did not like the style of the markers.
I managed to create with css the following picture
<div style='display:inline-block;background-color:#08c;padding:10px;border-radius:20px;border:2px solid #FFF;color:#FFF;'>
<i class="fa fa-university" aria-hidden="true"></i>
</div>
But I don't know how to:
Get a nice white pointer at the bottom with CSS (as in the purple icon)
How to use this css marker in google maps. The best I can think of is to make a screenshot, make the black background transparent and save it as a png. But I guess there must be a more proper way to do it?
EDIT: I found in the comments from Using Icon Fonts as Markers in Google Maps V3
I don't think it's possible, one way of doing it would be to extract the SVG properties from Font Awesome icons, and then define google.maps.Symbol using SVG notation. Then you'd be able to use them as symbols
I tried that and it failed. I am using the bank icon with unicode: f19c. So I opend fontawesome-webfont.svg and found an entry
<glyph unicode="" horiz-adv-x="2048" d="M960 1536l960 -384v-
128h-128q0 -26 -20.5 -45t-48.5 -19h-1526q-28 0 -48.5 19t-20.5
45h-128v128zM256 896h256v-768h128v768h256v-768h128v768h256v-768h128v768h256v-
768h59q28 0 48.5 -19t20.5 -45v-64h-1664v64q0 26 20.5 45t48.5 19h59v768zM1851
-64 q28 0 48.5 -19t20.5 -45v-128h-1920v128q0 26 20.5 45t48.5 19h1782z" />
Following the instructions to create marker symbols I tried
marker = new google.maps.Marker({
position: myLatlng,
map: map,
icon: {
path: 'M960 1536l960 -384v-128h-128q0 -26 -20.5 -45t-48.5
-19h-1526q-28 0 -48.5 19t-20.5 45h-128v128zM256 896h256v-768h128v768h256v-
768h128v768h256v-768h128v768h256v-768h59q28 0 48.5 -19t20.5 -45v-64h-
1664v64q0 26 20.5 45t48.5 19h59v768zM1851 -64 q28 0 48.5 -19t20.5 -45v-128h-
1920v128q0 26 20.5 45t48.5 19h1782z'
}
});
But I do not get a bank icon, only some strange lines:
Does anyone know why I don't get an icon here? And does this maybe lead to create a icon as wished above?