Skip to content

Commit

Permalink
Add WMS example. Fixes #2775
Browse files Browse the repository at this point in the history
  • Loading branch information
tmcw authored and Lucas Wojciechowski committed Aug 10, 2016
1 parent 74883fe commit 4541d82
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/_posts/examples/3400-01-01-wms.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
layout: example
category: example
title: WMS Support
description: Adding an external Web Map Service layer to the map
---
<div id='map'></div>
<script>
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.addSource('wms-test', {
'type': 'raster',
'tiles': [
'http://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
});

map.addLayer({
'id': 'wms-test-layer',
'type': 'raster',
'source': 'wms-test',
'paint': {}
}, 'aeroway-taxiway');
});
</script>

0 comments on commit 4541d82

Please sign in to comment.