Skip to content

Commit 9e34ca1

Browse files
authored
🚨 Apply Markdownlint fixes
1 parent 5635479 commit 9e34ca1

3 files changed

Lines changed: 24 additions & 22 deletions

‎content/posts/2019-03-24-how-to-create-a-simple-map-with-a-marker-based-on-openstreetmap.md‎

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ categories: ["howto"]
33
title: How to create a simple map (with a marker) based on OpenStreetMap
44
---
55

6+
## Introduction
7+
68
There are 2 most common open-source JavaScript libraries used to display a map : [Leaflet](https://leafletjs.com/) and [OpenLayers](https://openlayers.org/).
79

8-
### Build a simple map using Leaflet
10+
## Build a simple map using Leaflet
911

1012
This tutorial is based on [Leaflet Quick Start Guide](https://leafletjs.com/examples/quick-start/) and uses version `1.4.0` of the library. I suggest you check if there is a more up-to-date version before proceeding.
1113

@@ -17,31 +19,31 @@ This tutorial is based on [Leaflet Quick Start Guide](https://leafletjs.com/exam
1719
crossorigin="">
1820
```
1921

20-
2. Include the Leaflet JavaScript library at the end of the `<body>` section of your HTML page
22+
1. Include the Leaflet JavaScript library at the end of the `<body>` section of your HTML page
2123

2224
```html
2325
<script src="https://unpkg.com/leaflet@1.4.0/dist/leaflet.js"
2426
integrity="sha512-QVftwZFqvtRNi0ZyCtsznlKSWOStnDORoefr1enyq5mVL4tmKB3S/EnC3rRJcxCPavG10IcrVGSmPh6Qw5lwrg=="
2527
crossorigin=""></script>
2628
```
2729

28-
3. Put a `<div id="map">` element where you want your map to be
30+
1. Put a `<div id="map">` element where you want your map to be
2931

3032
```html
3133
<div id="map" style="width: 600px; height: 400px;"></div>
3234
```
3335

34-
4. Now you can add a `<script>` section at the end of the `<body>` section (after the `<script>` that loads Leaflet JavaScript library). All the following JavaScript code needs to go in that new `<script>` section.
36+
1. Now you can add a `<script>` section at the end of the `<body>` section (after the `<script>` that loads Leaflet JavaScript library). All the following JavaScript code needs to go in that new `<script>` section.
3537
36-
5. Initialize the map
38+
1. Initialize the map
3739
3840
```js
3941
var map = L.map('map').setView([50.84673, 4.35247], 12);
4042
```
4143
4244
The map will be displayed in `<div id="map">` element and will be centered on Brussels (Latitude = 50.84673, Longitude = 4.35247) at zoom level 12.
4345
44-
6. Add the OpenStreetMap Belgium baselayer
46+
1. Add the OpenStreetMap Belgium baselayer
4547
4648
```js
4749
L.tileLayer('https://tile.openstreetmap.be/osmbe/{z}/{x}/{y}.png', {
@@ -52,13 +54,13 @@ This tutorial is based on [Leaflet Quick Start Guide](https://leafletjs.com/exam
5254
}).addTo(map);
5355
```
5456
55-
7. You can add a marker at a specific location
57+
1. You can add a marker at a specific location
5658
5759
```js
5860
var marker = L.marker([50.84673, 4.35247]).addTo(map);
5961
```
6062
61-
8. And bind a popup to that marker.
63+
1. And bind a popup to that marker.
6264
6365
```js
6466
var popup = marker.bindPopup('<b>Hello world!</b><br />I am a popup.');
@@ -73,14 +75,14 @@ This tutorial is based on [Leaflet Quick Start Guide](https://leafletjs.com/exam
7375
7476
Now, you can check [the result](/leaflet-demo.html)!
7577
76-
#### Documentation:
78+
### Documentation
7779
7880
- Leaflet Map : <https://leafletjs.com/reference-1.4.0.html#map>
7981
- Leaflet TileLayer : <https://leafletjs.com/reference-1.4.0.html#tilelayer>
8082
- Leaflet Marker : <https://leafletjs.com/reference-1.4.0.html#marker>
8183
- Leaflet Popup : <https://leafletjs.com/reference-1.4.0.html#popup>
8284
83-
### Build a simple map using OpenLayers
85+
## Build a simple map using OpenLayers
8486
8587
This tutorial is based on [OpenLayers Quick Start Guide](https://openlayers.org/en/latest/doc/quickstart.html) and the [OpenLayers Popup Example](https://openlayers.org/en/latest/examples/popup.html) and uses version `5.3.0` of the library. I suggest you check if there is a more up-to-date version before proceeding.
8688
@@ -92,21 +94,21 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
9294
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css">
9395
```
9496
95-
2. Include the OpenLayers JavaScript library at the end of the `<body>` section of your HTML page
97+
1. Include the OpenLayers JavaScript library at the end of the `<body>` section of your HTML page
9698
9799
```html
98100
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
99101
```
100102

101-
3. Put a `<div id="map">` element where you want your map to be
103+
1. Put a `<div id="map">` element where you want your map to be
102104

103105
```html
104106
<div id="map" style="width: 600px; height: 400px;"></div>
105107
```
106108

107-
4. Now you can add a `<script>` section at the end of the `<body>` section (after the `<script>` that loads OpenLayers JavaScript library). All the following JavaScript code needs to go in that new `<script>` section.
109+
1. Now you can add a `<script>` section at the end of the `<body>` section (after the `<script>` that loads OpenLayers JavaScript library). All the following JavaScript code needs to go in that new `<script>` section.
108110
109-
5. Initialize the map with the OpenStreetMap Belgium baselayer
111+
1. Initialize the map with the OpenStreetMap Belgium baselayer
110112
111113
```js
112114
var attribution = new ol.control.Attribution({
@@ -135,7 +137,7 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
135137
136138
The map will be displayed in `<div id="map">` element and will be centered on Brussels (Latitude = 50.84673, Longitude = 4.35247) at zoom level 12.
137139
138-
6. You can add a marker at a specific location
140+
1. You can add a marker at a specific location
139141
140142
```js
141143
var layer = new ol.layer.Vector({
@@ -150,7 +152,7 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
150152
map.addLayer(layer);
151153
```
152154
153-
7. You can create a new `<div id="popup">` element right after the `<div id="map">` element
155+
1. You can create a new `<div id="popup">` element right after the `<div id="map">` element
154156
155157
```html
156158
<div id="popup" class="ol-popup">
@@ -159,7 +161,7 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
159161
</div>
160162
```
161163
162-
8. Initialize the popup (the following JavaScript code needs to go in the `<script>` section)
164+
1. Initialize the popup (the following JavaScript code needs to go in the `<script>` section)
163165
164166
```js
165167
var container = document.getElementById('popup');
@@ -182,7 +184,7 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
182184
};
183185
```
184186
185-
9. Add the function to open the popup when you click on the marker
187+
1. Add the function to open the popup when you click on the marker
186188
187189
```js
188190
map.on('singleclick', function (event) {
@@ -208,7 +210,7 @@ The OpenLayers library is more powerful than the Leaflet library and offers more
208210
209211
Now, you can check [the result](/openlayers-demo.html)!
210212
211-
#### Documentation:
213+
### Documentation
212214
213215
- OpenLayers Map : <https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html>
214216
- OpenLayers Attribution : <https://openlayers.org/en/latest/apidoc/module-ol_control_Attribution-Attribution.html>
@@ -220,6 +222,6 @@ Now, you can check [the result](/openlayers-demo.html)!
220222
- OpenLayers Feature : <https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html>
221223
- OpenLayers Overlay : <https://openlayers.org/en/latest/apidoc/module-ol_Overlay-Overlay.html>
222224
223-
### Other libraries
225+
## Other libraries
224226
225227
You can also have a look at [Mapbox GL JS](https://docs.mapbox.com/mapbox-gl-js/examples/).

‎content/posts/2019-03-24-how-to-see-the-map.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ categories: ["howto"]
33
title: How to see the map
44
---
55

6-
You can check the map here : [https://www.openstreetmap.org/](https://www.openstreetmap.org/#map=8/50.5157/4.45) !
6+
You can check the map here : [https://www.openstreetmap.org/](https://www.openstreetmap.org/#map=8/50.5157/4.45) !

‎content/posts/2019-03-24-how-to-use-free-openstreetmap-belgium-baselayer.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ var map = new ol.Map({
5454
zoom: 2
5555
})
5656
});
57-
```
57+
```

0 commit comments

Comments
 (0)