mapboxgl.accessToken = 'pk.eyJ1IjoiZHVlcm1hZWwiLCJhIjoiNTRmNjc2MjYzN2Y0NDk5ZjRjMTM1MDA2YjQzYTY4NjUifQ.zdJRPPXa8WvpcMZC1_RAyw';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/light-v9', //stylesheet location
center: [-82.34997950000002, 23.135253],
zoom: 13.2,
});
map.addControl(new MapboxGeocoder({
accessToken: mapboxgl.accessToken
}));
map.on('load', function() {
// Add a new source from our GeoJSON data and set the
// 'cluster' option to true.
map.addSource("earthquakes", {
type: "geojson",
// Point to GeoJSON data. This example visualizes all M1.0+ earthquakes
// from 12/22/15 to 1/21/16 as logged by USGS' Earthquake hazards program.
data: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/135743/hotels.geojson",
cluster: true,
clusterMaxZoom: 14, // Max zoom to cluster points on
clusterRadius: 40 // Radius of each cluster when clustering points (defaults to 50)
});
map.addLayer({
id: 'unclustered-points',
source: 'earthquakes',
type: 'circle',
"filter": ["!has", "point_count"],
paint: {
'circle-radius': 8,
'circle-color': '#b4f175' ,
},
});
// Use the earthquakes source to create five layers:
// One for unclustered points, three for each cluster category,
// and one for cluster labels.
map.addLayer({
"id": "unclustered-points2",
"type": "symbol",
"source": "earthquakes",
"filter": ["!has", "point_count"],
"layout": {
"icon-image":"marker-15",
"icon-size":0,
"text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
"text-field": "{HOTEL}",
"text-offset": [0, 0.9],
"text-anchor": "top",
"text-size": 11,
"text-letter-spacing": 0.05,
"text-transform": "uppercase",
"icon-allow-overlap": true,
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.