Bringing paper maps to life with Mapbox GL

Traditionally, maps have been static images on paper that were only referred to when requiring specific locations. They seldom change and had large print runs in frequency cycles of three to five years. The industry changed with the advent of online mapping services and libraries from technology providers like Google, HERE Technologies, Esri, Mapbox, and CARTO, to name a few. NGIS has been helping businesses move their spatial capabilities online for decades using these mapping services and libraries. 

More recently, the NGIS team was recently engaged by a client to digitise their road maps into a solution that could easily:

  1. Capture new instructions and enable simple modification of existing ones
  2. Distribute the information to recipients on the road in a timely manner

To meet the client’s needs, we created an Angular frontend mapping application that incorporated the Mapbox GL mapping library, integrated with a REST API layer to communicate with the backend.

In this week’s Geotech Friday blog, we delve into why we chose the Mapbox GL mapping library to transform road network paper maps into a responsive and reactive digital asset for our client. 

 

Why did we decide to use Mapbox GL? 

The Mapbox GL mapping library enables users to create fast, beautiful and functional maps – while also giving users the ability to draw custom objects directly on the map. These features perfectly matched the requirements outlined by our client. 

Another key requirement was the development of an admin portal that would allow users to:

  • View a custom generated map 
  • Dynamically draw and place polylines, polygons and points on a map
  • Snap the drawn polylines to roads 
  • Perform spatial analysis

After reviewing a number of mapping platforms available, we found Mapbox GL to be the most suitable due to its functionality, ease of use and setup. The licence and overall usage costs were favourable in this instance as well. 

 

How we did it

Integrating the Mapbox GL mapping library into an Angular solution involved:

  1. Downloading and installing the mapbox-gl, mapbox-gl-draw, mapbox-gl-directions and mapbox-gl-geocoder packages from npm by running the npm install commands in the terminal. 
  2. We then modified the solution’s angular.json file to incorporate the mapbox-gl.css and mapbox-gl-draw.css files.
  3. The next step was to obtain an access token from Mapbox (via the Mapbox site) which would record our usage so that in the event that the free usage limits were exceeded, we would only be charged for the additional usage. 
  4. With this all completed, we were then able to begin building out the mapping functionality within the application.

 

Version control

A complexity we faced while building the solution was that there were multiple instances where a new page would use the map object.

To keep a consistent standard throughout the entire solution while multiple developers were working on the project, we created a single map component that contained all the mapping functionality. This enabled us to keep all the map-related code in one place while enforcing a certain process for the developers to follow in terms of implementing the map on their parts of the project.

 

Adding functionality 

To move beyond the standard functionality of adding a basemap with zoom and layer toggle controls, we included functionality on the user interface that enabled spatial objects to be drawn directly onto the map.

This additional functionality allowed users to:

  • Place Points of Interest anywhere on the map
  • Draw polylines that would be snapped to the closest road
  • Draw polygon points on an area of the map 
  • Obtain information related to the area inside the specified polygon

 

 

 

The result

The process of working with paper maps can be cumbersome, costly and take a mountain of man hours to work out the logistics to deliver hard copies to colleagues. Digitising paper maps makes this process seamless for organisation and in this instance, our client. 

We were able to provide a complete solution that utilised the client’s proprietary data and displayed these data visually on a map. The client was able to perform spatial analysis and distribute this information to their clients easily and in real-time.

Related Articles

Here are more related articles you may be interested in.

Women in GIS at NGIS

Posted on
The geospatial industry has long been male-dominated, but women are making strides and shaping its future. At NGIS, women make up 43% of our team, demonstrating our commitment to diversity and inclusion. We are proud to celebrate the talented women at NGIS who are pushing boundaries, driving innovation, and inspiring the next generation.  Ahead of International Women’s Day, we spoke to four remarkable women in GIS about their journeys, challenges, and advice for those looking to enter the field. Here’s what they had to say:
Read More Women in GIS at NGIS

Monitoring the disappearing underwater forest

Posted on
What if one of the most critical ecosystems in our oceans was vanishing before our eyes without us even noticing? 95% of Tasmania’s kelp forests have vanished. Along Australia’s southern coastline, Giant Kelp forests, known for their towering underwater canopies and vital role in marine biodiversity, are quietly disappearing. NGIS is proud to be part…
Read More Monitoring the disappearing underwater forest

Launching a Sustainable Coffee Future

Posted on
During Climate Week 2024, a groundbreaking initiative was announced, uniting key global players to transform the coffee supply chain. The UNIDO Solutions Platform is a digital tool that helps coffee producers gain important insights into their supply chains. By using artificial intelligence (AI), the platform enables producers to understand the environmental impacts of their operations and adopt more sustainable practices. It specifically addresses the new and evolving regulatory requirements, providing data-driven solutions to create a sustainable and climate-resilient coffee supply chain for everyone involved.
Read More Launching a Sustainable Coffee Future

Empowering the Abu Dhabi Department of Municipalities and Transport in Traffic Monitoring and Flood Mitigation

Posted on
TraceMark™ Flow an NGIS Solution has helped the Abu Dhabi Department of Municipalities and Transport (DMT) in traffic monitoring and flood mitigation. During the heavy rain event in April 2024, TraceMark™ Flow proved instrumental in managing traffic disruptions and infrastructure challenges by providing real-time data and intuitive dashboards for swift, informed decision-making. Beyond traffic monitoring, TraceMark™…
Read More Empowering the Abu Dhabi Department of Municipalities and Transport in Traffic Monitoring and Flood Mitigation

TraceMark takes home the Transformative Solutions Award at The INCITE Awards

Posted on
We are pleased to announce that NGIS has won the Transformative Solutions Award for our TraceMark™ Sustainable Sourcing platform at this year’s INCITE Awards. Earlier this month, our team attended the awards ceremony at The Westin Perth. It was a wonderful evening, and a fantastic opportunity to meet so many West Australian innovators. This award…
Read More TraceMark takes home the Transformative Solutions Award at The INCITE Awards