Welcome back, map maker! You have come a long way. In Module One, you made your first map. In Module Two, you added data sources and layers. In Module Three, you styled your map to make it beautiful. In Module Four, you made your map interactive with clicks, popups, and controls.
Now your map is powerful. But there is one big problem. Your map is sitting on your computer. Only you can see it. How do you share it with your friends, your family, or the whole world? That is what this module is about.
We will learn about integration and deployment. Integration means putting your map inside a bigger website or app. Maybe you want your map to be part of a React or Vue project. Deployment means putting your map on the internet so anyone can visit it. We will learn how to build your project and publish it online for free.
We will keep using simple words and lots of examples. By the end, you will have your map live on the internet. Letβs get your map out into the world!
After you finish this module, you will be able to:
Ada lived in Abuja. She had built an amazing map of all the libraries in her city. It had colours, popups, and even a draw tool. She was very proud of it. But there was one problem. The map only worked on her own laptop. When she showed it to her friends, they said, βWe want to see it too! Send us the link.β
Ada did not have a link. Her map was just a file on her computer. It was invisible to everyone else. She felt sad. Then her older brother said, βAda, you need to deploy your map. You need to put it on the internet.β
Ada learned about GitHub Pages. She uploaded her files, clicked a few buttons, and waited. A few minutes later, she had a link: https://ada-maps.github.io/libraries. She sent it to her friends. They opened it on their phones. They could see her map! They could click and draw. Ada was so happy. Her map was no longer invisible. It was live for the whole world to see.
Moral of the story: A map on your computer is a secret. A deployed map is a gift to the world.
Definition: Integration means putting your map inside a bigger project. That project could be a website, a mobile app, or a dashboard.
Why it is important: Maps rarely live alone. They are usually part of a bigger system.
Simple explanation: Imagine your map is a puzzle piece. Integration is fitting that piece into a bigger puzzle.
Real-life example: A delivery app has a map inside its order tracking page.
School example: A school website has a map showing the location of the school.
Home example: A family blog has a map showing where the family has travelled.
Nigerian example: A news website has a map showing election results by state.
Illustration:
+---------------------+ | BIGGER PROJECT | | +---------------+ | | | YOUR MAP | | | +---------------+ | +---------------------+
Mini summary: Integration means putting your map inside a bigger project.
Definition: Deployment means putting your project on the internet so anyone can visit it.
Why it is important: A map on your computer helps only you. A deployed map helps everyone.
Simple explanation: Deployment is like moving your shop from your bedroom to the market. Now people can find you.
Real-life example: When a new app appears in the app store, it has been deployed.
School example: When your teacher posts homework on the school website, it is deployed.
Home example: When you upload a photo to social media, it is deployed.
Nigerian example: When a Nigerian business puts its website online, it is deployed.
Illustration:
Your Computer
|
V
Upload to Internet
|
V
+---------------------+
| Live Website |
| Anyone can visit |
+---------------------+
Mini summary: Deployment puts your map on the internet. It becomes live for everyone.
Definition: Development is when you are building and testing. Production is when your project is live for real users.
Why it is important: The two environments are different. What works in development may need changes for production.
Simple explanation: Development is like practising a play. Production is the actual performance.
Real-life example: A restaurant tests a new dish in the kitchen (development) before adding it to the menu (production).
School example: You write a draft essay (development), then submit the final version (production).
Home example: You try a new recipe for your family (development), then cook it for guests (production).
Nigerian example: A fashion designer makes a sample outfit (development), then sells it in the shop (production).
Table: Development vs Production
| Feature | Development | Production |
|---|---|---|
| Who sees it? | Only you | Everyone |
| Purpose | Building and testing | Real use |
| Speed | Can be slow | Must be fast |
| Mistakes | Okay to make | Must be avoided |
Mini summary: Development is for building. Production is for real users. They are different.
Definition: React is a popular tool for building websites. A component is a small piece of a website.
Why it is important: Many modern websites use React. You need to know how to put a map inside one.
Simple explanation: You create a component called MapComponent. Inside it, you use useRef to hold the map container. Then you create the map in useEffect.
Real-life example: A real estate website uses a React component to show house locations.
School example: A school dashboard shows a map of the campus using React.
Home example: A family website shows a map of relatives using React.
Nigerian example: A Lagos traffic app uses React to show live traffic maps.
Example code:
import React, { useRef, useEffect } from 'react';
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
function MapComponent() {
const mapRef = useRef();
useEffect(() => {
new Map({
target: mapRef.current,
layers: [new TileLayer({ source: new OSM() })],
view: new View({ center: [0, 0], zoom: 2 })
});
}, []);
return <div ref={mapRef} style={{ width: '100%', height: '400px' }}></div>;
}
Illustration:
React Component
|
V
useRef (container)
|
V
useEffect (create map)
|
V
Map appears!
Mini summary: In React, you use useRef and useEffect to create a map inside a component.
Definition: Vue is another popular tool for building websites. It also uses components.
Why it is important: Many websites use Vue. You need to know how to put a map inside one.
Simple explanation: You create a Vue component with a div for the map. In onMounted, you create the map.
Real-life example: A travel blog uses Vue to show a map of destinations.
School example: A school portal shows a map of the campus using Vue.
Home example: A family recipe site shows where ingredients come from using Vue.
Nigerian example: A Nigerian tourism site uses Vue to show attractions.
Example code:
<template>
<div ref="mapContainer" style="width: 100%; height: 400px;"></div>
</template>
<script>
import { onMounted, ref } from 'vue';
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
export default {
setup() {
const mapContainer = ref(null);
onMounted(() => {
new Map({
target: mapContainer.value,
layers: [new TileLayer({ source: new OSM() })],
view: new View({ center: [0, 0], zoom: 2 })
});
});
return { mapContainer };
}
};
</script>
Illustration:
Vue Component
|
V
ref (container)
|
V
onMounted (create map)
|
V
Map appears!
Mini summary: In Vue, you use ref and onMounted to create a map inside a component.
Definition: A build tool takes your code and prepares it for the internet. It bundles files, makes them smaller, and fixes problems.
Why it is important: Browsers cannot understand all your code directly. Build tools prepare it.
Simple explanation: A build tool is like a chef. It takes raw ingredients and prepares a beautiful meal.
Real-life example: When you order food online, the kitchen prepares it before delivery.
School example: You write rough notes (code), then write a neat final copy (build).
Home example: You wash and cut vegetables (build) before cooking.
Nigerian example: A tailor takes fabric (code) and sews a complete outfit (build).
Illustration:
Your Code
|
V
Build Tool (Vite)
|
V
Bundled Files
|
V
Ready for Internet
Mini summary: A build tool prepares your code for the internet. Vite is a popular one.
Definition: Vite is a fast build tool for modern web projects.
Why it is important: Vite is easy to use and very fast. It is great for beginners.
Simple explanation: You run a command, and Vite creates a dist folder with all your files ready to deploy.
Real-life example: A factory takes raw materials and produces finished goods.
School example: You gather all your notes and make a study guide.
Home example: You pack everything you need for a trip into one suitcase.
Nigerian example: A caterer prepares all the food for a party and packs it neatly.
Steps:
npm run build.dist folder.Illustration:
Terminal
|
V
npm run build
|
V
dist/ folder created
|
V
Ready to deploy!
Mini summary: Vite builds your project into a dist folder. That folder is ready for the internet.
Definition: MapLibre uses a worker file to do heavy work in the background. The worker file must be included in your build.
Why it is important: If the worker file is missing, your MapLibre map will not work after deployment.
Simple explanation: The worker is like a helper. It does the hard work so the map stays fast. You must make sure the helper comes with you.
Real-life example: When you move to a new house, you must remember to pack your tools.
School example: When you go to an exam, you must bring your pen and calculator.
Home example: When you travel, you must bring your charger.
Nigerian example: When you travel to the village, you must bring your generator fuel.
Solution: Use a plugin like vite-plugin-maplibre-gl or copy the worker file to your public folder.
Illustration:
MapLibre Map
|
V
Needs Worker File
|
V
Include in Build
|
V
Map Works!
Mini summary: MapLibre needs its worker file. Make sure it is included in your build.
Definition: GitHub Pages is a free service that hosts websites. You can put your map there.
Why it is important: It is free and easy. You do not need to pay for hosting.
Simple explanation: You create a GitHub repository. You push your code. You turn on GitHub Pages. Your site is live.
Real-life example: Many open-source projects have their websites on GitHub Pages.
School example: A school club can host its website on GitHub Pages.
Home example: You can host your family blog on GitHub Pages.
Nigerian example: A Nigerian student can host a portfolio website on GitHub Pages for free.
Steps:
main) and folder (usually /root or /docs).https://yourusername.github.io/repository.Illustration:
GitHub Repository
|
V
Settings β Pages
|
V
Select branch
|
V
Site is live!
|
V
Share the link π
Mini summary: GitHub Pages is a free way to host your map. It is easy to set up.
Definition: Static hosting means hosting files that do not change. Your map is usually a static site.
Why it is important: There are many free options besides GitHub Pages.
Simple explanation: You can use Netlify, Vercel, or Cloudflare Pages. They are all free for small projects.
Real-life example: Many companies use Netlify for their websites.
School example: A school project can be hosted on Netlify.
Home example: A family photo site can be hosted on Vercel.
Nigerian example: A Nigerian startup can host its landing page on Cloudflare Pages.
Table: Static Hosting Options
| Service | Free? | Best for |
|---|---|---|
| GitHub Pages | Yes | Simple projects |
| Netlify | Yes | Modern sites |
| Vercel | Yes | React/Vue apps |
| Cloudflare Pages | Yes | Fast global sites |
Mini summary: Many free static hosting options exist. GitHub Pages, Netlify, Vercel, and Cloudflare Pages are all good.
Definition: Sometimes your map needs a server. A server can store data, handle users, or run calculations.
Why it is important: If your map needs a database, static hosting is not enough.
Simple explanation: A static site is like a poster. A server-side site is like a shop with a shopkeeper.
Real-life example: A ride-hailing app needs a server to match riders with drivers.
School example: A school portal needs a server to store student grades.
Home example: A family budget app needs a server to store expenses.
Nigerian example: A Nigerian e-commerce site needs a server to process payments.
Illustration:
User
|
V
+---------------------+
| Server |
| - Database |
| - Logic |
+---------------------+
|
V
Map with live data
Mini summary: Server-side deployment is needed when your map uses a database or live data.
Definition: You can deploy a server-side app on platforms like Heroku, Render, or Railway.
Why it is important: These platforms make it easy to run a server without managing hardware.
Simple explanation: You push your code. The platform runs it. You get a URL.
Real-life example: Many startups use Heroku to launch quickly.
School example: A school project can use Render to host a simple API.
Home example: A family app can use Railway to store data.
Nigerian example: A Nigerian developer can use Render to host a map API for a client.
Steps:
Illustration:
GitHub Repo
|
V
Platform (Heroku/Render)
|
V
Build & Run
|
V
Live URL
Mini summary: Server-side apps can be deployed on Heroku, Render, or Railway. They handle the server for you.
Definition: Mobile-friendly means your map works well on phones and tablets.
Why it is important: Most people use phones to browse the internet.
Simple explanation: Your map should resize to fit the screen. Buttons should be big enough to tap. Text should be readable.
Real-life example: Google Maps works on both phones and computers.
School example: A school map should be easy to use on a tablet.
Home example: Your family map should work on your parentsβ phones.
Nigerian example: A map of Lagos should work on a small phone with a slow connection.
Tips:
width: 100%; height: 100vh;.Illustration:
+-------------+ | Phone | | +-------+ | | | MAP | | | +-------+ | | [π+] [π-]| +-------------+
Mini summary: Make your map work on phones. Use responsive sizes and big buttons.
Definition: After deployment, you must test your map on the live internet.
Why it is important: Things that work locally may fail online. You must check.
Simple explanation: Open your live URL. Click everything. Zoom in and out. Try on different devices.
Real-life example: Before a concert, the band does a sound check.
School example: Before a presentation, you practise in front of a mirror.
Home example: Before serving food, you taste it.
Nigerian example: Before a wedding, the family does a rehearsal.
Checklist:
Illustration:
Deploy
|
V
Open live URL
|
V
Test everything
|
V
Fix problems
|
V
Test again
|
V
Celebrate π
Mini summary: Always test your deployed map. Check on different devices and fix any problems.
Definition: Sharing means sending your map link to others.
Why it is important: A map is meant to be used. Sharing is the final step.
Simple explanation: Copy your URL. Send it to friends, family, and teachers. Post it on social media.
Real-life example: When a new website launches, the team shares the link everywhere.
School example: You share your school project map with your teacher and classmates.
Home example: You share your family map with relatives.
Nigerian example: You share your map of local markets with your community.
Illustration:
Your Map URL
|
V
+---------------------+
| Share on: |
| - WhatsApp |
| - Email |
| - Social Media |
| - School Website |
+---------------------+
Mini summary: Share your map link with the world. You built something amazing!
| Word | Simple Definition |
|---|---|
| Integration | Putting your map inside a bigger project. |
| Deployment | Putting your project on the internet. |
| Development | Building and testing your project. |
| Production | The live version for real users. |
| React | A tool for building websites with components. |
| Vue | Another tool for building websites. |
| Build tool | Prepares your code for the internet. |
| Vite | A fast build tool. |
| Worker file | A helper file for MapLibre. |
| GitHub Pages | A free hosting service. |
| Static hosting | Hosting files that do not change. |
| Server-side | Using a server for data and logic. |
| Mobile-friendly | Works well on phones and tablets. |
npm run build to create the dist folder.dist folder to a branch called gh-pages.gh-pages branch.https://yourusername.github.io/repository.npm install vite-plugin-maplibre-gl.vite.config.js.dist folder.npm run build before deploying.
Write Code
|
V
Test Locally
|
V
Build (npm run build)
|
V
Deploy (GitHub Pages)
|
V
Test Live
|
V
Share Link π
Module 1: First Map Module 2: Data & Layers Module 3: Style & Smart Maps Module 4: Interaction Module 5: Integration & Deployment Now: Your map is live!
| Option | Free? | Best for | Difficulty |
|---|---|---|---|
| GitHub Pages | Yes | Static sites | Easy |
| Netlify | Yes | Modern sites | Easy |
| Vercel | Yes | React/Vue apps | Easy |
| Cloudflare Pages | Yes | Fast global sites | Medium |
| Heroku | No | Server-side apps | Medium |
| Render | Yes (limited) | Server-side apps | Medium |
| Feature | React | Vue |
|---|---|---|
| Created by | Evan You | |
| Year | 2013 | 2014 |
| Learning curve | Medium | Easy |
| Popularity | Very high | High |
| Map integration | useRef + useEffect | ref + onMounted |
Lesson 1: Integration means putting your map inside a bigger project.
Lesson 2: Deployment means putting your map on the internet.
Lesson 3: Development is for building. Production is for real users.
Lesson 4: In React, you use useRef and useEffect to create a map.
Lesson 5: In Vue, you use ref and onMounted to create a map.
Lesson 6: A build tool prepares your code for the internet.
Lesson 7: Vite builds your project into a dist folder.
Lesson 8: MapLibre needs its worker file in the build.
Lesson 9: GitHub Pages is a free way to host your map.
Lesson 10: Netlify, Vercel, and Cloudflare Pages are other free options.
Lesson 11: Server-side deployment is needed for databases and live data.
Lesson 12: Heroku, Render, and Railway host server-side apps.
Lesson 13: Make your map mobile-friendly.
Lesson 14: Always test your deployed map.
Lesson 15: Share your map with the world.
In this module, you learned how to take your map from your computer and share it with the world. You discovered integration β putting your map inside React and Vue projects. You learned about deployment β putting your map on the internet using GitHub Pages and other free services. You explored build tools like Vite, and you learned how to handle MapLibreβs worker file. You also learned about server-side deployment for when you need a database. Finally, you learned how to make your map mobile-friendly and how to test and share it. Your map is now live for everyone to see. You are a certified map maker!
Match the word to its meaning.
| Word | Meaning |
|---|---|
| 1. Integration | A. Putting your project on the internet |
| 2. Deployment | B. A fast build tool |
| 3. Vite | C. Putting your map in a bigger project |
| 4. GitHub Pages | D. A helper file for MapLibre |
| 5. Worker | E. A free hosting service |
Answers: 1-C, 2-A, 3-B, 4-E, 5-D
Title: Deploy a Group Map
Instructions: In groups of 3, create a simple map with at least three points. Build it with Vite. Deploy it to GitHub Pages. Share the link with the class. Discuss what worked and what was difficult.
Title: My First Deployment
Instructions: Take a map you built in a previous module. Build it with Vite. Deploy it to GitHub Pages. Write down the URL. Test it on your phone. Share it with a friend.
Title: A Live Map of My Favourite Places
Instructions: Create an HTML file with a map. Add at least five points of interest. Add popups and a zoom control. Build the project with Vite. Deploy it to GitHub Pages. Share the link with your family and friends.
Task: Write a short paragraph (5 sentences) explaining what you learned about integration and deployment. Then, list three things you found easy and one thing you found hard. Finally, write down the URL of your deployed map.
Congratulations! You have completed all five modules of the Certified OpenLayers/MapLibre User course. In the next steps, you can:
You are now a certified map maker. Go and map the world! π
End of Module Five Β· Certified OpenLayers/MapLibre User