Leaflet map integration


I’m interested in buying a long-term plan on write.as. I’m particularly interested in integrating a custom leaflet map. I checked Leaflet’s quick guide, but I couldn’t get it to work. As an example, I would like this map to be integrated in my blog and I can figure it out from there. Any help is greatly appreciated!

PS. I’m not a programmer, but I understand HTML and CSS basics, it’s just JavaScript I’m not familiar with. I currently use the 14-day trial period for testing this.

Hi @tothemoon! I tried working this out. One way I found is that you can take the embed of the Codepen example you shared and add it to a post like this — the only catch is that it includes all the Codepen cruft with it. Is that close to what you were thinking?

The JavaScript is the tricky part here. I tried adding it to a test blog but it didn’t seem to be working either. Maybe someone else has an idea of how to get it working?

Hey @cjeller1592, thanks for the reply! This is a decent attempt, since it’s a working map! Of course a direct integration of the map would be ideal, but it’s better than nothing. Could you please share what code you used to achieve this? I successfully embedded it using the iframe option, but it includes the code in a sidebar and it’s distracting. Also, in case I don’t find a way of integrating it directly (although it should be possible, right?), perhaps I can cover up the codepen stuff with some tricky CSS? Something like an inner border?

Edit: Nevermind, had to remove js, from default-tab=js,result in HTML. Also, I don’t fully understand why the iframe option works, whereas the HTML one (which is the “recommended” one) doesn’t.

Edit2: I tried removing codepen’s elements via CSS and was initially happy because it worked by styling it on the spot. I then tried to include the CSS in write.as but failed. After searching, I realized that I can’t change CSS elements of iframe, since I have no control over that domain. An interesting lesson nonetheless. :slight_smile:

I’m sorry for bumping this thread, but since I’m interested in buying a 5 year plan with the discount, I would like to ask, firstly, whether this direct integration of a leaflet map is possible in write.as, and secondly, whether there are any particular limits regarding the amount of lines/characters in javascript (since the map itself could potentially contain lots of lines).

I have also sent a relevant email to discounts@write.as and hello@write.as, but I haven’t received a reply yet.

Thank you :slight_smile: