Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Leaflet emoji marker
<!DOCTYPE html>
<html lang="en">
<title>Leaflet - Emoji marker</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="" rel="stylesheet" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin=""/>
<script src="" integrity="sha512-gZwIG9x3wUXg2hdXF6+rVkLF/0Vi9U8D2Ntg4Ga5I5BZpVkVxlJWbSQtXPSiUTtC0TjtGOmxa1AJPuV0CPthew==" crossorigin=""></script>
.mymarker { font-size: 50px; }
.leaflet-popup {
margin-bottom: 70px;
<div id="map-placeholder" style="height:400px"></div>
const size = 50; // needs to correspond to font-size above
const iconOptions = {
iconSize : [size, size],
iconAnchor: [size/2, size + 9],
className : 'mymarker',
//runner, medium skin tone, Zero-Width-Joiner, female:
html: '🏃🏽‍♀' // or: '&#x1f3c3;&#x1f3fd;&#x200d;&#x2640;'
const markerOptions = {
draggable: true,
icon: L.divIcon(iconOptions)
const center = [-37.8178, 144.968]
const myMap ='map-placeholder').setView(center, 9)
const myMarker = L.marker(center, markerOptions).addTo(myMap)
.bindPopup('I am an emoji marker, a runner, <br/>female with medium dark skin.<br/><br/>You can drag me too.')
{ attribution: '© <a href="">OpenStreetMap</a> contr.' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment