Skip to content

Commit

Permalink
Create mbj-wms.html
Browse files Browse the repository at this point in the history
  • Loading branch information
daveism authored May 9, 2018
1 parent 865c0be commit eb9f3d9
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions mbj-wms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Add a WMS source</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.45.0/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.45.0/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 = 'undefined';
var map = new mapboxgl.Map({
container: 'map',
style: 'mapbox://styles/mapbox/light-v9',
zoom: 8,
center: [-74.5447, 40.6892]
});

map.on('load', function() {

map.addLayer({
'id': 'wms-test-layer',
'type': 'raster',
'source': {
'type': 'raster',
'tiles': [
'https://geodata.state.nj.us/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&width=256&height=256&layers=Natural2015'
],
'tileSize': 256
},
'paint': {}
}, 'aeroway-taxiway');
});
</script>

</body>
</html>

0 comments on commit eb9f3d9

Please sign in to comment.