Built with blockbuilder.org
Created
August 24, 2017 02:26
-
-
Save anonymous/ffc54aa42f9dc2d76b4d73fff594b041 to your computer and use it in GitHub Desktop.
fresh block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.39.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } | |
#map { position:absolute; top:0; bottom:0; width:100%; } | |
.marker { | |
background-image: url('./icons/svgs/marker-15.svg'); | |
background-size: cover; | |
width: 15px; | |
height: 15px; | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<div id='map'></div> | |
<script> | |
mapboxgl.accessToken = 'pk.eyJ1IjoibWFwdGFzdGlrIiwiYSI6IjNPMkREV1kifQ.2KGPFZD0QaGfvYzXYotTXQ'; | |
var map = new mapboxgl.Map({ | |
container: 'map', | |
style: 'mapbox://styles/maptastik/cj6my6c0x083o2qnsdv3bewpx', | |
center: [-73.284431,42.357363], | |
zoom: 16, | |
pitch: 45 | |
}); | |
map.on('load', function () { | |
map.addSource('poi', { | |
'type': 'geojson', | |
'data': 'poi.geojson' | |
}) | |
map.addLayer({ | |
'id': 'poi', | |
'type': 'symbol', | |
'source': 'poi', | |
'layout': { | |
'icon-image': '{icon}-15', | |
'text-field': '{title}', | |
'text-font': ["Open Sans Semibold", "Arial Unicode MS Bold"], | |
'text-offset': [0, 0.6], | |
'text-anchor': 'top' | |
}, | |
'paint': { | |
'text-halo-color': '#fff', | |
'text-halo-width': 1 | |
} | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment