Jin Igarashi

Jin Igarashi is a GIS software developer maintaining several open source libraries which can help water utilities in Eastern Africa. He is currently employed by United Nations Development Programme to help them develop GIS applications for decision making.


Sessions

07-18
16:30
30min
maplibre-gl-terradraw - new drawing plugin for maplibre-gl-js
Jin Igarashi

This talk introduces a new drawing plugin for MapLibre: maplibre-gl-terradraw.

Historically, both Mapbox and MapLibre have relied on an older plugin, mapbox-gl-draw, to provide drawing functionality in maplibre-gl-js. However, mapbox-gl-draw is no longer actively maintained, making it increasingly difficult to use with MapLibre.

As an alternative, Terra Draw offers advanced drawing features for multiple mapping libraries, including Mapbox, MapLibre, OpenLayers, Leaflet, Google Maps, and ArcGIS, all within a unified user interface. Compared to mapbox-gl-draw, Terra Draw is significantly easier to use. However, integrating its full functionality into MapLibre still requires extensive configuration.

To simplify this process, I developed maplibre-gl-terradraw, a new plugin that enables a pre-configured drawing feature with a single line of code using map.addControl.

With maplibre-gl-terradraw, users can easily add drawing controls using map.addControl(new MaplibreTerradrawControl()).

This immediately grants access to all drawing modes (point, line, polygon, rectangle, circle, etc) powered by Terra Draw. The plugin comes pre-configured with icons and additional functionalities, such as:

  • Selecting and deleting features
  • Downloading drawn features
  • Customizing Terra Draw options and styles, as described in the documentation

Furthermore, the measure control allows users to:

  • Measure the distance of a line or the area of a polygon
  • Query elevation data from raster DEM sources (MapLibre Terrain, TerrainRGB, and Terrarium)

In this talk, I will demonstrate the core functionalities of maplibre-gl-terradraw and show how easily you can integrate drawing features into your MapLibre applications.

State of software
SA02