Skip to content

Instantly share code, notes, and snippets.

@Hbentzur Hbentzur/landslides.html Secret
Created Apr 3, 2018

What would you like to do?
< -- Global Landslide Catalog. -->
< -- The Global Landslide Catalog (GLC) was developed with the goal of identifying rainfall-triggered landslide events around the world, regardless of size, impacts or location. The GLC considers all types of mass movements triggered by rainfall, which
have been reported in the media, disaster databases, scientific reports, or other sources. The GLC has been compiled since 2007 at NASA Goddard Space Flight Center. This is a unique data set with the ID tag “GLC” in the landslide editor. This dataset
on was a one-time export from the Global Landslide Catalog maintained separately. It is current as of March 7, 2016. The original catalog is available here: -->
<!DOCTYPE html>
<html lang='en'>
body {
margin: 0;
padding: 0;
#map {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
<title> landslides </title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src=''></script>
<link href='' rel='stylesheet' />
<div id='map'> </div>
mapboxgl.accessToken = 'pk.eyJ1IjoiaGJ0IiwiYSI6ImNqOHo4NGh5czJpYXIzMnA4bnYybmtrcWQifQ.xFGp_QLgqKIrkPgCdJBtZA';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v9',
center: [-74.0006213, 40.7229971],
zoom: 3,
// I tried to use
map.on('load', function() {
map.addSource('landslides', {
type: 'geojson',
data: 'data/ls.geojson',
cluster: true,
clusterMaxZoom: 10, // Max zoom to cluster points on
clusterRadius: 30 // Radius of each cluster when clustering points
id: 'clusters',
type: 'circle',
source: 'landslides',
filter: ['has', 'point_count'],
paint: {
// * #e7616b, 10px circles when point count is less than 50
// * #617e9b, 30px circles when point count is between 50 and 100
// * #80966b, 60px circles when point count is greater than or equal to 100
'circle-color': [
'step', ['get', 'point_count'],
'circle-radius': [
'step', ['get', 'point_count'],
// Clusters count
id: 'cluster-count',
type: 'symbol',
source: 'landslides',
filter: ['has', 'point_count'],
layout: {
'text-field': '{point_count_abbreviated}',
'text-font': ['DIN Offc Pro Bold'],
'text-size': 10,
// Unclustered points
id: 'unclustered-point',
type: 'circle',
source: 'landslides',
filter: ['!has', 'point_count'],
paint: {
'circle-color': '#f2bf37',
'circle-radius': 5,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.