Here's a little map I wrote

The code below is the code that generates the embedded map above. To embed the javascript and get the map to work you need to add the leaflet CSS files to the header of your theme. Go to Settings > Code injection and paste the link to the CSS into the header section.

<link rel="stylesheet" href="" />

Then, in the body of your post you can insert the HTML <div> and <script> tags which will be parsed along with the Markdown in the final output HTML file.

<div id="map" style="width: 100%; height: 400px;"></div>

<script src=""></script>

var map ='map').setView([51.505, -0.09], 13);
L.tileLayer('http://{s}{z}/{x}/{y}.png', {
        attribution: '&copy; <a href="">OpenStreetMap</a> contributors'
    L.marker([51.5, -0.09]).addTo(map)
    .bindPopup("<b>Hello world!</b><br />I am a popup.").openPopup();[51.508, -0.11], 500, {
    color: 'red',
    fillColor: '#f03',
    fillOpacity: 0.5
    }).addTo(map).bindPopup("I am a circle.");
        [51.509, -0.08],
        [51.503, -0.06],
        [51.51, -0.047]
    ]).addTo(map).bindPopup("I am a polygon.");
    var popup = L.popup();
    function onMapClick(e) {
            .setContent("You clicked the map at " + e.latlng.toString())
    map.on('click', onMapClick);