Welcome back, map maker! In Module One, you learned about data and why it matters. In Module Two, you designed a Kobo form. In Module Three, you collected real data and managed it in the cloud. In Module Four, you installed GeoServer and published your data as a map layer.
But right now, your map is plain. All the dots look the same. There are no colours to show which water tap is working and which is broken. There are no labels to show names. There are no icons to make it friendly. And your map is only visible inside GeoServer. How do you share it with the world?
That is what this module is about. You will learn two big things. First, you will learn how to style your map. Style means changing colours, sizes, and symbols. Second, you will learn how to integrate your map into a website. Integration means putting your map on a web page so anyone can see it.
By the end of this module, you will have a beautiful, styled map that you can share with your friends, your family, and your community. Letโs make your map shine!
After you finish this module, you will be able to:
Amina lived in Kano. In Module Four, she had published a map of all the health clinics in her local government area. She used GeoServer. The map worked, but it was boring. Every clinic was a plain grey dot. You could not tell which clinics had doctors and which did not. You could not tell which ones were open at night.
Amina showed the map to her mother, who worked at the health department. Her mother said, โThis map is useful, but it does not tell me what I need to know. I need to see which clinics are well-staffed and which need help.โ
Amina had an idea. She learned about something called SLD. SLD is a special file that tells the map how to look. She created an SLD file. She made clinics with doctors green. She made clinics without doctors red. She made clinics open at night blue. She added labels with the clinic names.
She applied the SLD in GeoServer. She refreshed the preview. Suddenly, the map came alive. Green, red, and blue dots showed the status of every clinic. Her mother could see at a glance which clinics needed support.
โNow this is a map that speaks,โ her mother said. Amina smiled. She had learned the power of style.
Moral of the story: A styled map tells a story. A plain map just shows locations.
Definition: Map style is how things look on your map. It includes colour, size, shape, and labels.
Why it is important: Style makes your map easy to understand. It helps people see patterns.
Simple explanation: Imagine you are drawing a picture. You choose a red crayon for fire and a blue crayon for water. That is style.
Real-life example: In a traffic app, red means heavy traffic and green means clear roads.
School example: In a school map, you might use a yellow star for the library and a blue circle for the toilets.
Home example: On a family map, you might use a heart for Grandmaโs house.
Nigerian example: A map of Nigeria might use green for agriculture areas and brown for desert areas.
Illustration:
+---------------------+ | STYLE | | [๐ด] Red = Danger | | [๐ข] Green = Safe | | [๐ต] Blue = Water | +---------------------+
Mini summary: Style is how things look on your map. Good style makes your map clear.
Definition: SLD stands for Styled Layer Descriptor. It is a file that tells GeoServer how to draw your map.
Why it is important: Without SLD, all your data looks the same. SLD lets you change colours and sizes.
Simple explanation: SLD is like a recipe for your map. It says: โDraw this point red. Draw that line thick. Draw this polygon green.โ
Real-life example: A weather map uses SLD to show rain in blue and heat in red.
School example: A school map uses SLD to show classrooms in yellow and offices in pink.
Home example: A family map uses SLD to show homes in green and shops in orange.
Nigerian example: A map of Lagos uses SLD to show water in blue and roads in grey.
Illustration:
SLD File
|
V
+---------------------+
| Point: Red |
| Line: Blue, thick |
| Polygon: Green |
+---------------------+
Mini summary: SLD is a file that tells GeoServer how to draw your map.
Definition: SLD is written in XML. XML uses tags like <tag> and </tag>.
Why it is important: You need to understand the structure to write your own SLD.
Simple explanation: SLD has a few main parts: the style name, the feature type, and the rules. Rules say what to draw and how.
Real-life example: Like a set of instructions for assembling a toy.
School example: Like the steps in a science experiment.
Home example: Like a recipe with steps.
Nigerian example: Like instructions for making jollof rice.
Basic structure:
<StyledLayerDescriptor>
<NamedLayer>
<Name>MyLayer</Name>
<UserStyle>
<FeatureTypeStyle>
<Rule>
<PointSymbolizer>
...
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Mini summary: SLD has a structure. It has a name, a feature type, and rules.
Definition: A point is a single location on the map. It can be a school, a market, or a water tap.
Why it is important: Points are the most common feature on maps. Styling them well is key.
Simple explanation: You can change the colour, size, and shape of a point. You can use a circle, a square, or an icon.
Real-life example: A map of restaurants might use a fork and knife icon for each restaurant.
School example: A map of your school might use a blue circle for classrooms and a red circle for offices.
Home example: A map of your house might use a star for your bedroom.
Nigerian example: A map of Lagos markets might use a yellow circle for each market.
Example SLD for a red point:
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
</Mark>
<Size>8</Size>
</Graphic>
</PointSymbolizer>
Illustration:
Circle point: โ Square point: โ Star point: โ Icon point: ๐
Mini summary: You can style points with different colours, sizes, and shapes.
Definition: You can change the style of a point based on its data. For example, green for working taps and red for broken taps.
Why it is important: This turns your map into a tool for understanding. You can see patterns at a glance.
Simple explanation: You add a filter to your SLD rule. The filter says: โOnly apply this style if status = working.โ
Real-life example: A map of clinics uses green for clinics with doctors and red for clinics without.
School example: A map of exam results uses green for high scores and red for low scores.
Home example: A map of your familyโs favourite foods uses a bigger icon for the most loved food.
Nigerian example: A map of Nigeria uses different shades of green for different crop yields.
Example SLD with filter:
<Rule>
<Name>Working Taps</Name>
<Filter>
<PropertyIsEqualTo>
<PropertyName>status</PropertyName>
<Literal>working</Literal>
</PropertyIsEqualTo>
</Filter>
<PointSymbolizer>
...
<Fill>
<CssParameter name="fill">#00FF00</CssParameter>
</Fill>
</PointSymbolizer>
</Rule>
Illustration:
Data: working -> green circle โ Data: broken -> red circle โ Data: unknown -> grey circle โ
Mini summary: Data-driven styling changes the look based on values. It makes your map smart.
Definition: A line is a path between two points. It can be a road, a river, or a boundary.
Why it is important: Lines show connections and routes.
Simple explanation: You can change the colour, thickness, and pattern of a line. A dashed line means something different from a solid line.
Real-life example: A map of a bus route uses a thick blue line to show the path.
School example: A map of your school might use a red line for the fire escape route.
Home example: A map of your street might use a black line for the road.
Nigerian example: A map of Nigeria might use a blue line for the River Niger.
Example SLD for a blue line:
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
<CssParameter name="stroke-width">4</CssParameter>
<CssParameter name="stroke-dasharray">10 10</CssParameter>
</Stroke>
</LineSymbolizer>
Illustration:
Solid line: โโโโโโโโ Dashed line: โโ โโ โโ Thick line: โโโโโโโโ Thin line: โโโโโโโโ
Mini summary: You can style lines with colour, width, and dash patterns.
Definition: A polygon is a shape with many sides. It can be a park, a state, or a building.
Why it is important: Polygons show areas. They help you see regions and boundaries.
Simple explanation: You can change the fill colour, the border colour, and the transparency of a polygon.
Real-life example: A map of a flood zone uses a semi-transparent blue polygon.
School example: A map of your school might use a green polygon for the football field.
Home example: A map of your compound might use a brown polygon for the house.
Nigerian example: A map of Nigeria uses polygons for all 36 states.
Example SLD for a green polygon:
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#00FF00</CssParameter>
<CssParameter name="fill-opacity">0.5</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#006400</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</PolygonSymbolizer>
Illustration:
+--------+ | Polygon| | โโโโ | | โโโโ | +--------+
Mini summary: You can style polygons with fill colour and border.
Definition: A label is text on the map. It names a place.
Why it is important: Labels help people know what they are looking at.
Simple explanation: You can show the name of a city, a school, or a market.
Real-life example: Google Maps shows the names of streets and cities.
School example: A school map shows โLibraryโ, โScience Labโ, and โFootball Fieldโ.
Home example: A family map shows โGrandmaโs Houseโ and โUncleโs Shopโ.
Nigerian example: A map of Nigeria shows โLagosโ, โAbujaโ, and โKanoโ.
Example SLD for labels:
<TextSymbolizer>
<Label>
<PropertyName>name</PropertyName>
</Label>
<Font>
<CssParameter name="font-size">12</CssParameter>
<CssParameter name="font-family">Arial</CssParameter>
</Font>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
</TextSymbolizer>
Illustration:
โ Abuja โ Lagos โ Kano
Mini summary: Labels are text that name places. They make your map readable.
Definition: Applying SLD means telling GeoServer to use your style file.
Why it is important: Without applying, GeoServer will use the default style.
Simple explanation: You go to the Layers page. You click on your layer. You click โPublishingโ. You find โDefault Styleโ. You choose your SLD. You save.
Real-life example: Like choosing a theme for your phone.
School example: Like choosing the colour of your notebook cover.
Home example: Like choosing a wallpaper for your room.
Nigerian example: Like choosing the pattern for your ankara fabric.
Steps:
Illustration:
Click "Layers"
|
V
Click Your Layer
|
V
Click "Publishing"
|
V
Choose Your SLD
|
V
Click "Save"
|
V
Style Applied! ๐
Mini summary: Applying SLD in GeoServer is easy. Choose your style and save.
Definition: Web integration means putting your map on a website.
Why it is important: A map inside GeoServer is only visible to you. A map on a website is visible to everyone.
Simple explanation: You write some HTML code. You tell the code to load your GeoServer layer. The map appears on the web page.
Real-life example: A news website shows a map of election results.
School example: A school website shows a map of the campus.
Home example: A family blog shows a map of relativesโ houses.
Nigerian example: A Nigerian tourism website shows a map of attractions.
Illustration:
GeoServer
|
V
WMS Service
|
V
Web Page (HTML)
|
V
Anyone Can See Your Map!
Mini summary: Web integration puts your map on a website. Anyone can see it.
Definition: OpenLayers is a free tool for showing maps on websites.
Why it is important: OpenLayers can load WMS layers from GeoServer.
Simple explanation: You create an HTML file. You add OpenLayers. You create a map. You add a WMS layer with your GeoServer URL.
Real-life example: Many government websites use OpenLayers to show maps.
School example: A school project can use OpenLayers to show a map of the campus.
Home example: A family website can use OpenLayers to show a map of favourite places.
Nigerian example: A Lagos traffic app can use OpenLayers to show live traffic.
Example code:
<!DOCTYPE html>
<html>
<head>
<title>My GeoServer Map</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ol@v7.3.0/ol.css">
<style>
#map { width: 100%; height: 400px; }
</style>
</head>
<body>
<h1>My GeoServer Map</h1>
<div id="map"></div>
<script src="https://cdn.jsdelivr.net/npm/ol@v7.3.0/dist/ol.js"></script>
<script>
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Image({
source: new ol.source.ImageWMS({
url: 'http://localhost:8080/geoserver/wms',
params: { 'LAYERS': 'water_data:taps' }
})
})
],
view: new ol.View({
center: ol.proj.fromLonLat([7.4985, 6.4402]),
zoom: 14
})
});
</script>
</body>
</html>
What the code does: It creates a map. It adds an OpenStreetMap base layer. It adds your GeoServer WMS layer on top. It sets the view to your data location.
Illustration:
HTML File
|
V
OpenLayers + WMS
|
V
Map Appears!
Mini summary: OpenLayers can show your GeoServer map on a website. You need the WMS URL and layer name.
Definition: Testing means trying your map to make sure it works.
Why it is important: You do not want your users to find bugs. You want to find them first.
Simple explanation: Open the HTML file in a browser. Zoom in and out. Click on features. Try on different devices.
Real-life example: Before a new app is released, testers try every button.
School example: Before a school play, students practise the whole play.
Home example: Before you serve food, you taste it.
Nigerian example: Before a new bus route starts, the drivers test the road.
Illustration:
Open HTML File
|
V
Check Map Loads
|
V
Test Zoom
|
V
Test on Phone
|
V
Fix Problems
|
V
Celebrate ๐
Mini summary: Always test your web map. Check on different devices and fix any problems.
Definition: A legend shows what the colours and symbols mean. A scale shows distance.
Why it is important: The legend helps people understand your map. The scale helps them understand distance.
Simple explanation: You add a legend box to your HTML. You add a scale line to your OpenLayers map.
Real-life example: A hiking map has a legend showing trail colours and a scale showing kilometres.
School example: A school map has a legend showing what each colour means.
Home example: A family map has a legend showing what each icon means.
Nigerian example: A map of Lagos has a legend showing what each colour means for traffic.
Illustration:
+---------------------+ | LEGEND | | ๐ข Working tap | | ๐ด Broken tap | | ๐ต Unknown | +---------------------+ | [====] 1 km | +---------------------+
Mini summary: A legend shows what colours mean. A scale shows distance. Both are important.
Definition: These are mistakes beginners often make.
Why it is important: Knowing them helps you avoid them.
Simple explanation: Here are some mistakes to watch out for.
List of mistakes:
Illustration:
Bad Style Good Style +----------------+ +----------------+ | 20 colours | | 3-5 colours | | No legend | | Clear legend | | No scale | | Scale included | +----------------+ +----------------+
Mini summary: Avoid common mistakes. Keep it simple. Test everything.
Definition: You will now combine everything you learned.
Why it is important: A live map on the web is the goal of this course.
Simple explanation: Start with your GeoServer layer. Create an SLD. Apply the SLD. Create an HTML file with OpenLayers. Add your WMS layer. Test it. Share it.
Real-life example: A water tap map is published on a village website.
School example: A school campus map is published on the school website.
Home example: A family map is shared with relatives.
Nigerian example: A map of health clinics is published for the community.
Illustration:
GeoServer Layer
|
V
Create SLD
|
V
Apply SLD
|
V
Create HTML with OpenLayers
|
V
Add WMS Layer
|
V
Test
|
V
Share with the World! ๐
Mini summary: You can now publish a styled, live map on the web. You are a map publisher!
| Word | Simple Definition |
|---|---|
| Style | How something looks on the map. |
| SLD | A file that tells GeoServer how to draw your map. |
| Point | A single location on the map. |
| Line | A path between two points. |
| Polygon | A shape with many sides. |
| Label | Text that names a place. |
| Filter | A rule that applies a style only to some features. |
| WMS | A service that gives map pictures. |
| OpenLayers | A free tool for showing maps on websites. |
| Legend | A box that shows what colours mean. |
| Scale | A line that shows distance. |
| Integration | Putting your map on a website. |
div for the map.ol.Map.ol.layer.Image with ol.source.ImageWMS.
Collect Data (Kobo)
|
V
Export as GeoJSON
|
V
Publish in GeoServer
|
V
Create SLD
|
V
Apply SLD
|
V
Create HTML with OpenLayers
|
V
Test
|
V
Share with the World! ๐
Module 1: Learn about data Module 2: Design a form Module 3: Collect and manage data Module 4: Publish with GeoServer Module 5: Style and share on the web Now: Your map is live!
| Feature | Style Property | What it does |
|---|---|---|
| Point | fill | Inside colour |
| Point | size | Size of the point |
| Line | stroke | Line colour |
| Line | stroke-width | Thickness |
| Line | stroke-dasharray | Dash pattern |
| Polygon | fill | Inside colour |
| Polygon | stroke | Border colour |
| Feature | OpenLayers | MapLibre |
|---|---|---|
| WMS support | Yes | Yes |
| WFS support | Yes | Limited |
| Learning curve | Medium | Easy |
| Best for | GIS data | Vector tiles |
| Free? | Yes | Yes |
Lesson 1: Style is how things look on your map.
Lesson 2: SLD is a file that tells GeoServer how to draw your map.
Lesson 3: SLD has a structure: name, feature type, and rules.
Lesson 4: You can style points with colour, size, and shape.
Lesson 5: Data-driven styling changes the look based on data.
Lesson 6: You can style lines with colour, width, and dash.
Lesson 7: You can style polygons with fill and border.
Lesson 8: Labels name places on the map.
Lesson 9: Applying SLD in GeoServer is easy.
Lesson 10: Web integration puts your map on a website.
Lesson 11: OpenLayers can show your GeoServer map.
Lesson 12: Always test your web map.
Lesson 13: A legend and scale help people understand your map.
Lesson 14: Avoid common mistakes. Keep it simple.
Lesson 15: You can now publish a styled, live map on the web.
In this module, you learned how to style your map and share it on the web. You discovered SLD, a file that tells GeoServer how to draw your map. You learned how to style points, lines, and polygons. You learned how to use data-driven styling to change colours based on values. You learned how to add labels. You applied your SLD in GeoServer. You learned how to integrate your map into a website using OpenLayers. You tested your map and learned to add a legend and scale. You also learned to avoid common mistakes. Your map is now beautiful, styled, and live on the web. You are a certified map maker!
Match the word to its meaning.
| Word | Meaning |
|---|---|
| 1. SLD | A. A single location on the map |
| 2. Point | B. A file that tells GeoServer how to draw |
| 3. Label | C. A free tool for showing maps on websites |
| 4. OpenLayers | D. Text that names a place |
| 5. Legend | E. A box that shows what colours mean |
Answers: 1-B, 2-A, 3-D, 4-C, 5-E
Title: Style and Share a Group Map
Instructions: In groups of 3, take a GeoServer layer from Module Four. Create an SLD that styles the data based on a property. Apply the SLD. Create an HTML page with OpenLayers. Load your WMS layer. Add a legend. Present your map to the class.
Title: Style Your Own Map
Instructions: Take your GeoServer layer. Create an SLD that styles the data. Apply the SLD. Preview it. Create an HTML page with OpenLayers. Load your WMS layer. Test it on your computer and phone. Write down what you see.
Title: A Complete Styled Web Map
Instructions: Take the data you collected in Module Three. Publish it in GeoServer. Create an SLD that styles the data based on a property. Apply the SLD. Create an HTML page with OpenLayers. Load your WMS layer. Add a legend and a scale. Test on different devices. Share the link with your family and friends.
Task: Write a short paragraph (5 sentences) explaining what you learned about styling and web integration. Then, list three things you found easy and one thing you found hard. Finally, describe your map and what data it shows.
Congratulations! You have completed all five modules of the Certified GeoServer/KoboToolbox 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 GeoServer/KoboToolbox User