Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Forked from tmcw/README.md
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfirebaugh/56f4bc62a91c04dba9d4 to your computer and use it in GitHub Desktop.
Save jfirebaugh/56f4bc62a91c04dba9d4 to your computer and use it in GitHub Desktop.

Crashes in Chrome Version 38.0.2125.104

<!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.4.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.4.1/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.eyJ1IjoidG1jdyIsImEiOiJwRTNGUVBnIn0.I5Miy6PRRoBIqjxA1JfcyQ';
var map = new mapboxgl.Map({
container: 'map',
style: 'style.json',
center: [0, 0],
zoom: 1
});
mapboxgl.util.getJSON('./tiles.geojson', function(err, data) {
var sourceObj = new mapboxgl.GeoJSONSource({ data: data });
map.addSource('tiles', sourceObj);
});
</script>
</body>
</html>
{
"version": 6,
"sprite": "https://www.mapbox.com/mapbox-gl-styles/sprites/outdoors",
"glyphs": "mapbox://fontstack/{fontstack}/{range}.pbf",
"constants": {
"@land": "rgb(244,239,225)",
"@water": "#cdd"
},
"sources": {
"mapbox": {
"type": "vector",
"url": "mapbox://mapbox.mapbox-terrain-v1,mapbox.mapbox-streets-v6-dev",
"maxzoom": 15
}
},
"layers": [{
"id": "background",
"paint": {
"background-color": "@land"
},
"paint.night": {
"background-color": "@land_night"
},
"type": "background"
}, {
"id": "water",
"source": "mapbox",
"source-layer": "water",
"paint": {
"fill-color": "@water",
"fill-outline-color": "#a2bdc0"
},
"paint.night": {
"fill-color": "@water_night",
"fill-outline-color": "@water_dark_night"
},
"type": "fill"
}]
}
Display the source blob
Display the rendered blob
Raw
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