Skip to content

Instantly share code, notes, and snippets.

@zdila
Created December 28, 2015 13:53
Show Gist options
  • Save zdila/0c3960795706a3a21034 to your computer and use it in GitHub Desktop.
Save zdila/0c3960795706a3a21034 to your computer and use it in GitHub Desktop.
Prechodene
<!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.12.2/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.2/mapbox-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>
mapboxgl.accessToken = 'pk.eyJ1IjoiemRpbGEiLCJhIjoicG9GQkJJcyJ9.wXWZ0F89jkxE1eJJ45axTg';
var map = new mapboxgl.Map({
container: 'map', // container id
// style: 'mapbox://styles/mapbox/dark-v8', //hosted style id
style: {
"version": 8,
sources: {
"freemap": {
"type": "raster",
"tiles": [
"https://a.freemap.sk/T/{z}/{x}/{y}.png",
"https://b.freemap.sk/T/{z}/{x}/{y}.png",
"https://c.freemap.sk/T/{z}/{x}/{y}.png",
"https://d.freemap.sk/T/{z}/{x}/{y}.png"
],
"tileSize": 256
},
"neprechodene": {
"type": "vector",
"url": "mapbox://zdila.375avhnw"
}
},
"layers": [{
"id": "simple-tiles",
"type": "raster",
"source": "freemap",
"minzoom": 0,
"maxzoom": 22
},
{
"id": "simple-tiles2",
"type": "line",
"source": "neprechodene",
"source-layer": "polished_trk",
"minzoom": 0,
"maxzoom": 22,
'paint': {
'line-color': '#000000',
'line-width': 2
}
}
]
},
center: [21, 49], // starting position
zoom: 8 // starting zoom
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment