Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MapLibre
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Boris Mericskay
MapLibre
Commits
d85fafc5
Commit
d85fafc5
authored
3 years ago
by
Boris Mericskay
Browse files
Options
Downloads
Patches
Plain Diff
Update Cluster.html
parent
fededa44
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cluster.html
+26
-20
26 additions, 20 deletions
Cluster.html
with
26 additions
and
20 deletions
Cluster.html
+
26
−
20
View file @
d85fafc5
...
...
@@ -2,26 +2,26 @@
<html>
<head>
<meta
charset=
'utf-8'
/>
<title>
Create a heatmap layer
</title>
<title>
MapLibreGL / Clusters Map
</title>
<meta
name=
'viewport'
content=
'initial-scale=1,maximum-scale=1,user-scalable=no'
/>
<script
src=
"https://cdn.maptiler.com/maplibre-gl-js/v1.13.0-rc.4/mapbox-gl.js"
></script>
<link
href=
"https://cdn.maptiler.com/maplibre-gl-js/v1.13.0-rc.4/mapbox-gl.css"
rel=
"stylesheet"
/>
<script
src=
'https://unpkg.com/maplibre-gl@2.1.1/dist/maplibre-gl.js'
></script>
<link
href=
'https://unpkg.com/maplibre-gl@2.1.1/dist/maplibre-gl.css'
rel=
'stylesheet'
/>
<style>
body
{
margin
:
0
;
padding
:
0
;
}
#map
{
position
:
absolute
;
top
:
0
;
bottom
:
0
;
width
:
100%
;
}
</style>
</head>
<body>
<div
id=
'map'
></div>
<script>
// Map configuration
var
map
=
new
mapboxgl
.
Map
({
var
map
=
new
maplibregl
.
Map
({
container
:
'
map
'
,
style
:
'
https://api.maptiler.com/maps/positron/style.json?key=rrASqj6frF6l2rrOFR4A
'
,
zoom
:
11.7
,
// Zoom
...
...
@@ -32,7 +32,6 @@ style: 'https://api.maptiler.com/maps/positron/style.json?key=rrASqj6frF6l2rrOFR
map
.
on
(
'
load
'
,
function
()
{
// Add arrondissements
map
.
addSource
(
'
lignes
'
,
{
...
...
@@ -47,16 +46,16 @@ map.on('load', function() {
'
paint
'
:
{
'
line-width
'
:
1
,
'
line-color
'
:
'
#AAAAAA
'
}
});
// Add Bike stations data
// Add data bike stations
map
.
addSource
(
'
DMR
'
,
{
type
:
'
geojson
'
,
data
:
'
https://raw.githubusercontent.com/mastersigat/data/main/DMR.geojson
'
,
cluster
:
true
,
clusterMaxZoom
:
15
,
clusterRadius
:
4
5
clusterRadius
:
4
0
});
// Configuration cluster Size and color
...
...
@@ -71,8 +70,9 @@ map.addLayer({
'
#f1f075
'
,
2500
,
'
#f28cb1
'
,
5000
,
'
#FF4136
'
],
'
circle-stroke-color
'
:
'
#ffffff
'
,
'
circle-radius
'
:
[
'
step
'
,[
'
get
'
,
'
point_count
'
],
5
,
200
,
10
,
500
,
15
,
1000
,
2
5
,
3000
,
35
,
5000
,
5
0
]}
5
,
200
,
10
,
500
,
15
,
1000
,
2
0
,
3000
,
35
,
5000
,
45
,
8000
,
6
0
]}
});
...
...
@@ -85,16 +85,22 @@ filter: ['has', 'point_count'],
layout
:
{
'
text-field
'
:
'
{point_count_abbreviated}
'
,
'
text-font
'
:
[
'
DIN Offc Pro Medium
'
,
'
Arial Unicode MS Bold
'
],
'
text-size
'
:
1
2
}
'
text-size
'
:
1
3
}
});
});
// Add navigation control and scale
map
.
addControl
(
new
mapboxgl
.
NavigationControl
({
position
:
'
top-left
'
}));
map
.
addControl
(
new
mapboxgl
.
ScaleControl
({
position
:
'
bottom-right
'
}));
// Add navigation control and scale
var
nav
=
new
maplibregl
.
NavigationControl
();
map
.
addControl
(
nav
,
'
top-left
'
);
var
scale
=
new
maplibregl
.
ScaleControl
({
maxWidth
:
80
,
unit
:
'
metric
'
});
map
.
addControl
(
scale
);
</script>
</body>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment