Skip to content

Instantly share code, notes, and snippets.

@tmcw
Last active August 29, 2015 14:08
Show Gist options
  • Save tmcw/e256d5b639d3b4705cdc to your computer and use it in GitHub Desktop.
Save tmcw/e256d5b639d3b4705cdc to your computer and use it in GitHub Desktop.
Crashing test case

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.3.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.3.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": 5,
"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",
"style": {
"background-color": "@land"
},
"style.night": {
"background-color": "@land_night"
},
"type": "background"
}, {
"id": "water",
"source": "mapbox",
"source-layer": "water",
"style": {
"fill-color": "@water",
"fill-outline-color": "#a2bdc0"
},
"style.night": {
"fill-color": "@water_night",
"fill-outline-color": "@water_dark_night"
},
"type": "fill"
}]
}
Display the source blob
Display the rendered blob
Raw
Loading
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