From 1d4fb0cf09c39804356e00a0d56aeb45fb448892 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 14 May 2020 09:07:46 -0500 Subject: [PATCH] labcluster --- labcluster.php | 243 ++++++++++++++++++++++++++++++ maperogl.php | 396 +++++++++++++++++++++---------------------------- 2 files changed, 415 insertions(+), 224 deletions(-) create mode 100644 labcluster.php diff --git a/labcluster.php b/labcluster.php new file mode 100644 index 0000000..edb768d --- /dev/null +++ b/labcluster.php @@ -0,0 +1,243 @@ + + + + +Create and style clusters + + + + + + + + + + + + + + +
+ + + + + diff --git a/maperogl.php b/maperogl.php index 5d751e6..2d4c32d 100644 --- a/maperogl.php +++ b/maperogl.php @@ -1,238 +1,186 @@ - - - Tupale.co - - - - - + + + + + - -
-
-
-
-
-
- - - - - - -
- - - - - }; - - map.once('style.load', function(e) { - init(); - map.addControl(new mapboxgl.NavigationControl()); - map.on('click', function(e) { - var features = map.queryRenderedFeatures(e.point, { - layers: ['datos-1'] - }); - if (!features.length) { - return; - } - var feature = features[0]; - - var popup = new mapboxgl.Popup() - .setLngLat(map.unproject(e.point)) - .setHTML(feature.properties.description ) - .addTo(map); - }); - - //Hide loading bar once tiles from geojson are loaded - map.on('data', function(e) { - if (e.dataType === 'source' && e.sourceId === 'LosDatos') { - document.getElementById("loader").style.visibility = "hidden"; - } - }) - - // Use the same approach as above to indicate that the symbols are clickable - // by changing the cursor style to 'pointer'. - map.on('mousemove', function(e) { - var features = map.queryRenderedFeatures(e.point, { - layers: ['datos-1'] - }); - map.getCanvas().style.cursor = (features.length) ? 'pointer' : ''; - }); - - }); - -