I'm an open source enthusiast at Mapbox, the creator of Leaflet and 40+ other JS libraries, and a rock musician. AMA!

Vladimir Agafonkin on June 25, 2018

Hey! I'm Vladimir Agafonkin (aka @mourner) from Kyiv, Ukraine. In 2008, I started working on a small web maps library in secret from my boss, wh... [Read Full]
markdown guide
 

Hi @mourner !

I don't have any questions, and unfortunately I have never used Leaflet, yet.

Just wanted to say that you seem like a really great person and I loved the letter you received from the 77 year old!

Keep doing what you do!

 
 

Leaflet is a very nice library that I've used on a couple of sites 👍

 

Hi Vladimir! I'm a huge fan of the work you've done and it's one of my biggest goals to work on geospatial software like you have. I had a few questions if that's okay:

  • How did you get started in this area of combining geospatial and software development?

  • Does it help to have an extensive GIS background when it comes to working with geospatial software? With the tools we have nowadays (especially thanks to you), it's pretty easy to work with maps without any GIS knowledge and it's often the case that they don't really overlap depending on the use case.

  • Do you have any advice for people who want to break into geospatial tech (like myself), especially from the perspective of building tools?

Sorry if any of them are unclear or if there are repeats. Thanks!

 

Thank you!

How did you get started in this area of combining geospatial and software development?

I just got lucky — worked for a generic software consultancy in 2008 when our company got a client from the mapping industry, CloudMade. Then I learned about OpenStreetMap, online maps, got excited, and it started from there.

Does it help to have an extensive GIS background when it comes to working with geospatial software?

It probably depends, but in my case, it helped a lot to NOT have any GIS background. This way, I could build a mapping library from a perspective of a total newbie, making it simple and easy to use for others too. You can hear more about my background with Leaflet and mapping in this video.

Do you have any advice for people who want to break into geospatial tech (like myself), especially from the perspective of building tools?

I'd recommend just jumping straight into building something, and learn along the way. Find a cool project idea that you'd feel enthusiastic to work on, and don't worry about having any knowledge gaps — practice is the most effective way to learn.

Or find an open source project to contribute to. I know contributing to popular projects can be intimidating, but you can start small — e.g. even just fixing typos in the docs could be a good gateway, and then you build from there.

 

Vladimir, thank you for this thorough response! In your opinion, is Javascript the best gateway language to get into geospatial software space, or are other languages, e.g. Python or Ruby viable options as well?

JavaScript is perhaps the most popular gateway, but they're all great choices! I'd perhaps add R and Java.

 

You created the SunCalc library for calculating sun position, sunlight phases (times for sunrise, sunset, dusk, etc.), moon position and lunar phase for the given location and time. How does it work and what are some interesting ways that people have used it over the years?

 

The library came out of a website, suncalc.net, which I built more than 8 years ago and pretty much haven't updated since (you can tell by the fact that it still uses Google Maps :) — and I received so many wonderful e-mails about it over the years.

I got letters from imams who used it for optimal prayer times, from a Tibet monk who used it to plan lunches, from air conditioner installers, from people who used it when choosing a home / apartment to buy, and from many enthusiastic gardeners.

But the most endearing e-mail I got related to it is this one, and it warms my heart with joy and happiness:


❤️❤️❤️

 

I use suncalc to work out Nautical Twilight for my app River Thames Guide (boats and ships registered in the UK should strike their ensign at 2100 or Nautical Twilight whichever is earlier).
More at riverthamesguide.net

 
 

Beyond bugfixes and dropping support for eg non-ES6 browsers, what do you see as future developments for Leaflet?

 

I don't see Leaflet getting many new features — its whole point is to remain small, simple and lightweight, and given it's maturity, there's not much left to add. I'd actually be happy if we manage to remove some features. :) So the main focus would be on bugfixes, performance, refactoring it to make it even simpler, better docs, more examples, and more extensibility points for plugin authors. However, I won't be against taking Leaflet to a new direction if the community and its other maintainers decide that it's the right choice.

 

Regarding that: What about any of those fancy frameworks with so-called "server-side rendering"? (I prefer the term "templating").

In particular: Do you think that the advantages of a SvelteJS port of Leaflet (e.g. ability to not use JS on the client) would be worth the problems (e.g. state transition animations, loss of canvas rendering)?

I never thought about it, but it would be cool to explore. :) It's hard to imagine how a JS-less interactive map would look like though — like in pre-Google Maps era with a static image and buttons for panning that reload it?

I'd settle for something that is capable of templating all the HTML for the initial state of the map server-side, yet allow for JS-ful interaction afterwards. :-)

 

As I've always said, need some "mapping" solution for a problem you have? Check Vladimir's repos before anywhere else.

We use Leaflet operationally on our public website for weather maps and other specialist maps.

Needed a pole of inaccessibility calc for label placement on overlapping polygons, oh, Vladimir has polylabel.

Do yourself a favour, check his repos first.

On a personal note, thank you for all your effort, on Leaflet and on the more specialist libs. I really appreciate it and has saved me a lot of time.

Cheers

Ian

 
 

What are your thoughts on 3D mapping? It seems that in the near future, with autonomous cars on the roads, there will be an amazing amount of point cloud data that should be mapped. Removing a dimension of that data to draw it in 2D seems wasteful.

 

I definitely see an explosion in the adoption of 3D mapping technologies coming very soon. The two biggest limiting factors up till now were:

  1. Technical limitations such as browser performance, computing power on a typical user's machine — those were pretty much solved. Browsers are now extremely fast, the unbelievably powerful APIs such as WebGL now have mainstream support, and most people carry unbelievable computing power in their pockets. And this change happened much faster than anyone anticipated.
  2. The complexity of dealing with 3D — building easy to use software and APIs, implementing sophisticated visualization techniques, etc. This battle is still ongoing, and my colleagues at Mapbox are working hard to help bring those technologies to widespread adoption sooner.
 

Hi Vladimir,
I would personally want to thank you for Leaflet. It is an amazing tool !
There was a question below about it's future and I'd love this library to stay around for a while.
Leaflet accepts many plugins but some of them may not be updated by their creator. So some really interesting functions may not be available. Maybe it could be a good idea to embed them to Leaflet and update them yourself along with the library. I'm especially thinking about Locate plug-in and others to support third party external formats (like check when user location overlaps a polygon)
Also, I've been wondering for a long time why it is not possible to rotate maps according to user's device heading.

 

Thank you!

  1. Plugins getting out of date is a serious problem, but adopting maintenance of other projects is not something we can usually do, as maintainers already have a lot on their plate. We have to rely on the community to keep most plugins maintained. What I'd love to do in future is creating a better plugin registry, with easy search, GitHub stars, version compatibility indication, maybe a badge of quality, etc — maybe that would help attracting plugin contributions and adding an incentive to keep them up to date.
  2. We might add rotation — there was even an attempt at this some time ago. It's just difficult to introduce rotation while keeping the code simple and easy to maintain, since it's a feature that affects most of the codebase. And there hasn't been enough demand for it to prioritize — usually rotation doesn't work well with raster maps (e.g. labels get upside down, etc.), and works much better in vector maps libraries like Mapbox GL.
 

Thanks, Vald
As for the plugin, I was thinking about just a few of them that are almost basic needs for map users (locate is, definitely !)
Better plug in management would be a must !

 

Hi, mourner. I notice that many core vital algorithms are implemented by referencing academic papers. As reading academic papers are boring and tedious, how do you find one algorithm in papers that works?

 

It can be tedious indeed, and most papers are beyond my comprehension. So with practice, I learned to skim papers very quickly — e.g. go through abstract, conclusion, then scan the pictures, look for algorithm pseudocode etc. Now I can determine if a paper is worth reading into in more detail after a quick skim.

 

Hi Vladimir.
Looks like I'm a bit too late for the party, but still, I've decided to drop in with some words of appreciation.
I'm using leaflet for my pet-project and although I can't appreciate it at full-scale as pet-project is something that you craft for 15 minutes per month still I've enjoyed using this library and was pleased to hear that the author comes from the same city as me.
But what was the most surprising is that you're a guitarist of Обійми Дощу. This is really amazing how one can be both a decent software engineer and successful artist. Your path inspires me a lot!
P.S. Today I've listened to your new album Сон. Although IMO it's hard to say something new in a genre of progressive metal as there are already some mastodons who are there for decades, still I enjoy how you've embraced dozen of influences we love in progressive metal to create your own beautiful multi-layered mixture. Although Обійми Дощу and Somali Yacht Club represent different genres to me they both are great this year discoveries which show how Ukrainians do some world-class musicianship. Keep rocking \m/

 

Hey Vladimir! How much math would you say is involved in developing map tools and map development in general?

 

Quite a bit when working on map rendering and when implementing geometric algorithms, but nothing you can't catch up on quickly online — mostly basic vector and matrix math. The most advanced math concept I ever used in my 13-year career is function derivative, and only once — it was a very unexpected use.

 

Interesting, thanks for the response! Do you find that math influences your development and/or your music?

Yes, but not directly — I feel like graduating Applied Math immensely helped me structure my brain and prepared me for hard challenges ahead, even though I don't remember much of what I studied.

 

I attended Mapbox Locate recently and after Lauren Budorick's presentation on mapbox-gl I wondered if the power of GL could not be leveraged for performing spatial queries on geometric data that have already been loaded into a browser, as an alternative to turf.js on the front end. Is this something you've pondered, and/or do you see any viability in pursuing such a thing?

 

WebGL is great for rendering large amounts of data, but is very difficult to use for actual processing and analysis. There are many research papers with geometric algorithms tailored for the GPU for massive parallelization, but pretty much no real implementations, and those algorithms use advanced APIs such as compute shaders, which are currently not available for WebGL and won't be for a while. Khronos is working on such an extension for the upcoming WebGL 2.0, but it will take a long time.

 

What do you think tech folks around the world could learn from the local scene in Kiev? What is the local tech community there struggling with the most?

 

Kyiv is one of the biggest and fastest growing tech hubs in Europe, and one of the leading IT outsourcing hotspots in the world. Here's a good overview of the reasons, but I feel it comes down to two things:

  • Affordable, heavily STEM-focused education system, with multiple world class universities in the city. While it can feel pretty outdated at times, it gives a very strong foundation (e.g. mathematics), which eventually produces many top-talent engineers.
  • Abysmally low taxes, living and operational costs for engineers. It's very cheap to set up a startup team here compared to most other countries.

Kyiv is also a pretty comfortable, walkable city with lots of greenery, great food, awesome subway system, tons of coworking spaces.

The struggles are there too:

  • A LOT of the top talent immigrates to Europe and US. Mostly due to corruption, inadequate government, bad social security and unstable economy. Hundreds of my Ukrainian ex-colleagues now live in Berlin, Amsterdam, London, SF & Bay Area.
  • You'll find the diversity quite lackluster compared to the West — engineers are predominantly male, and there's a lot of gender bias (e.g. many people from the older generation think that girls don't need STEM education and instead have to find a husband and raise kids, cook and clean at home all the time). The situation is steadily improving every year though.
  • Most of the tech scene is outsourcing — Kyiv is heavily lacking in product startups, although this gets better too.
 
 

Oh, it's from my early student years when I considered myself a goth, wore a dark long coat and wanted to look all very grim, dark and mysterious. It stuck afterwards, and I like it. :)

 

How do you keep from being distracted working at home with your beautiful twin girls? I have five children and it can be a challenge especially when I'm on calls.

 

So true! It's so distracting with two kids that I can't imagine how you'd get anything at all done with 5 around — very impressive! :)

My solution on most days, especially when I really need to focus, is going to a coworking space — fortunately we have a lot of those in Kyiv, they're cheap (around $100 per month), quiet, with clean desks, fast wifi and free tea/cookies. The closest one to home looks like this:

I also enjoy the commute (around 40 minutes by bus / metro) because it's a perfect time to read my Kindle or listen to a podcast.

When I'm at home, on warm days, I usually work on our balcony, which is relatively quiet compared to the rest of our apartment.

 

You have the gift of being a prolific creator. How do you prioritize your work and organize your time?

 

To be honest, I'm absolutely terrible at time management and prioritization, and struggle hard to improve. Often, weeks and months will go by without getting anything of interest done. Pretty much all cool things I built were done on short-lived waves of enthusiasm, when I get obsessed with an idea and stop reacting to the outside world until proving that it works.

This makes me really bad at sustainably working on big, complex projects. That's why I prefer creating very small, laser-focused libraries — it's much easier to get them to a useful state before throwing in the towel. Also, with experience, you start to get good at recognizing ideas with a high impact-to-effort ratio.

When it comes to music, unfortunately, I spend a small fraction of the time on it compared to my student years. Otherwise we wouldn't spend 8 years to make one album. :) Hopefully, I'll be able to regain that area of my life more in future.

 

What do you think are main pain-points of leading open source projects and what can be done to reduce them? Also, how do you mitigate burnout and frustration when dealing with people's "silly problems" (I don't mean it, I just can't find better wording) instead of really pushing your projects forward?

 

Feeling guilty about unsolved issues piling up is a big pain point, and so is dealing with toxic people. What I found as a good strategy is:

  • Set up standard reply templates in GitHub, and close issues without hesitation. If a user feels entitled to your time while not willing to make any effort, such as filling out an issue template, providing a minimal test case, etc., it just takes away from people and issues that actually deserve your attention.
  • Never feel guilty about open issues and messages you didn't respond to. You are a human being, with lots of things to worry about and take care of, and any issue can wait. Projects don't have to be perfect all the time. If an issue is critical and important enough and you can't find enough time to deal with it, other people will come to help you — it's open source after all, and otherwise it can always wait.
  • Lock toxic discussions and block toxic people without hesitation — arguing with such people is not worth the emotional investment.
  • Embrace and grow new contributors. Cherish people who show enthusiasm about your project, be patient when reviewing their issues and PRs even if they lack experience and technical skills, and they will grow to be an amazing help. Give away admin rights to your repos generously — putting trust in other people pays off big time.

At the beginning, I tried to reply to everyone, but when you have an inbox that looks like this, you just have to stop worrying and blaming yourself for not responding, otherwise I'd burn out and stop doing open source a long time ago:

 

I got a big inspiration from you now.

But how can I keep myself as engineer working with only programming; because sometimes it is really hard for me when above management trying to push me into management role and I don't want.

Would you please give suggestion; I wanna stay in engineer path like you.

THANKS!

 

Thank you! I was just always upfront about it — if management asked me about how I see my career going forward, I'd always answer that I want to continue solving difficult engineering challenges, and not interested in management roles.

 

Currently Mapbox has 772 open-source repositories on github. That's too many for me to investigate or browse. What are your favorite ones?

 

I actually built a tool a while ago to be able to answer that question — it sorts organization repos by stars. :)

But since I'm involved with all my personal favorite ones, you can check out this list instead.

 

Got tips for managing an open source community in terms of project direction, expectations, etc?

 

Describing a set of simple core principles and goals of a project from the start helps a lot (e.g. in a readme or a contributing file). For Leaflet, the goal was to create the simplest, fastest and lightest mapping library that anyone could use — it's easy to align decisions with a simple, measurable goal like this (even if you have to reject contributions sometimes).

It's also important to keep a project focused — a small library that covers 90% of use cases in a specific, narrowly defined area is orders of magnitude easier to maintain than a big one that tries to cover 100%. That means learning to reduce the scope, say no to new features, and proactively work on simplifying the project.

 
 

Hello Vladimir. How did you first felt when Leaflet became so big that it is an industry standard? Was growing to that size slow or was it exponential?

 

It was pretty sudden — I never expected it to get that big. This was my first ever open source project, and I still remember how I awe-struck I was when it got adopted by Foursquare (first major user) a few months after the public release.

Here's a chart of monthly leafletjs.com users — so mostly steady growth, but with some sudden bumps (e.g. by being featured on the frontpage of Hackernews, etc.):

 

Thanks for your amazing work on Leaflet, I'm doing up a few tutorials on Dev.to at the moment and would love to teach people about leaflet as I further my knowledge on leaflet. I'm currently working on a tutorial on how to customise leaflet for the start of a web GIS interface 😀

 

What are your thoughts about geodetic grids? Do you think they will be able to take over the tyranny of EPSG:3857 tiles? Could protobuf geodetic hextiles be a thing?

 

Probably not taking over any time soon; at least for traditional web maps.

  • The sheer simplicity of Mercator tiles is hard to beat. This is perhaps the biggest driver in the popularity of any software technology.
  • The algorithms that power geospatial databases are designed for rectangular queries, and dealing with hexes would bring a lot of performance overhead.
  • Since most existing mapping software works with Mercator tiles, you don't have to deal with compatibility issues.
  • 99% mapping use cases only need accuracy at higher zoom levels, and don't deal with data around poles, so there's not enough incentive to switch to harder solutions.

However, I'd love for you and others to keep experimenting on that front, regardless of the current status quo — that's how progress happens after all. :)

 

hello , in this post you have presented supercluster algorithme.
i still didn't understand how to use it in a map.
is there a clear tutorial on how to do that ?
could we use it with folium map in python ?
there is also a python version

I need your help to understand how to use it ,for my final year project

cordially

 

Hi @mourner !

I have a question, do you know about the lib react-leaflet ?

In case of a yes, could you post something about rotation ? especially a retangle, because I could do using just Leaflet but passing to react couldn't make it. So I was hoping if you could help.

Thanks, you are awesome
ps. Sorry for my english, It's not my native language.

 

LTTP here but wanted to say thank you for creating Leaflet. I use it at work to display maps on our website with custom tiles and it works great!

 

very humble, wish you success in all your life, thanks a lot for helping us.

 

What do you think are the most valued competences you need to have a job like yours?

 

The most valued competency is being kind and empathetic to others — it's not just a personality trait, but, as I learned, a skill you have to cultivate. Especially if you're a maintainer of a popular open source software — you'll interact with many people that had a really bad day. Also, in tech companies, communication skills are often much more important than technical proficiency.

The other big one is curiosity — it's the core driving force behind everything I do. Diving head-first into challenging problems, constantly learning, experimenting fearlessly with everything, completely failing 20 times to come up with something amazing on the 21th.

 

Used Leaflet in 2014 for an IoT indoor navigation system, very good piece of software. :)

 

Hi Vlad,

I'm pretty much in awe of your and your team's work on Leaflet. Thanks for that great resource, not only for making nice Web maps, but also for showing us how to code by reading your code.

My question is: do you think it will be important for maps to become an internet media type, like video or SVG? Will this (script-less mapping) help get kids involved in mapping?

 
 

A typical workday looks like this:

  • Wake up around 8am, read some morning news, maybe lay in the bed just a bit more, or spend some time playing with kids.
  • Have a breakfast around 9-10am with my wife and kids while watching some TV series on a laptop together.
  • Have a ~40 bus/metro commute to the coworking space while reading a good book on my Kindle (I love sci-fi/fantasy and autobiographies) or listening to a podcast (my favourites are Reply All and Criminal)
  • Get a latte at a local third-wave coffee place to start my work day.
  • Work until ~2pm, then go for a 10-min walk to a lunch place.
  • Have a lunch while reading a book, then walk to a nearby park to read for 10-20 more minutes.
  • Walk back to my work place and work.
  • At ~7pm, SF wakes up on the other side of the world, so I usually have calls and scrums at this time.
  • Commute back home while reading a book.
  • At home around 9pm; help the kids with their dinner, then bath them, put them to bed and read a short book.
  • Go back to the living room, spend time my wife, have a dinner, and then relax until 12-1am sleep time. Maybe play some RPGs on PS4, or read a book in bed.
 

What's advantage of mapbox vs other companies doing gis?

 

An important distinction to make is that Mapbox is not a GIS company — it's a developer platform. So while some of our tools (such as Mapbox Studio) can be used directly for GIS purposes, the focus is on enabling other developers to create location-aware applications, and we excel at this.

That being said, here are some of the reasons we're the best developer platform for location apps, from the top of my mind:

  • Pretty much everything we do is open source. This is a huge selling point, because our users can actively participate in the development of our products — they're transparent, not a "black box" like with some competitors.
  • Thought leadership in the industry — we put an unusual amount of resources into research and development of innovative technologies that later get adopted in the industry, with competitors constantly playing catch up.
  • Focus on open data. We rely on OpenStreetMap, OpenAddresses, Landsat and many other awesome open data sources, and only fill the gaps with commercial sources where necessary.
  • Exceptional support — my team mates are some of the most loving, empathetic and talented people I know.
  • To put it simply, an amazing product.
 

You've made quite a lot of interesting pet projects. But how many pet projects have you not finished, or even not started?

 

A lot! But it's fair — kind of a natural selection, where if a project is not exciting enough, I likely won't get it to a good state. There also lots of experiments I abandoned because it ended up not being a good idea. It's important to keep experimenting even if many ideas fail.

There's one project that I didn't finish due to how hard it is — github.com/mapbox/polysnap, but I hope to wrap it up this year. :)

 

Day to day, how are you, your family, your work, and your friends affected by the political situation in Ukraine and Russia?

 

That's a difficult question to answer. Me and my family are not affected directly, and if you come to Kyiv, you likely will never notice anything that would remind you of war — people go on with their lives, laugh, play and enjoy sunny weather. However, we all feel sadness, dread and anger over all that is happening, over 8000 lives lost and millions of people misplaced from their homes, families torn apart, and hateful rhetoric and propaganda in the media.

A few years ago, I could do nothing but read news and activist blogs from the morning till night, but there's only so much you can take of this each day, and now we've grown resilient — so a report of just one young man killed on the front today feels ordinary, although deep inside you feel that this should never be normal.

I guess there could be a similarity to how you might feel, for example (although on a lesser scale), about your country being manipulated by a hostile power to yield to lies and hate and destroy your economy in the process. Or how Americans might feel about a hostile power manipulating them into electing a malicious hateful racist bigot that wants to destroy all the progress the country has made in the last few decades to enrich himself and his cronies. This is real war, but in the information space, in the minds of people rather than a physical battlefield, although in Ukraine's case it was both.

I'm hopeful that we can all win this war eventually, but in the moment, all we can do is go on with our lives, mend the hearts of our families, and vote.

 

Hey Vladimir! Thanks for doing this!

How do you find time for your hobbies?

 

The unfortunate answer is that I don't. :( I'm struggling very hard to find time and energy for hobbies, and even had to abandon / indefinitely postpone a few that I love dearly, such as karate and photography.

The only way to consistently find time for a hobby is to schedule it and stick to the time block. E.g. for music, we have a 4-hour band practice every Saturday and it happens no matter what.

 

Hello @mourner !

If you could go back in time to 2008, what advice would you give yourself about life and development in general?

 

I don't have any major regrets in my life, so I'd just tell myself to keep doing what I'm doing and expect an awesome life. Maybe start working out earlier, and hold on to friendships stronger.

 

Can you talk about the leaflet architecture and what books used for learn javascript + web mapping?

 
code of conduct - report abuse