Skip to content

Instantly share code, notes, and snippets.

Last active Mar 20, 2017
What would you like to do?
Using WMS in maps

Using WMS in web maps.

<!DOCTYPE html>
<meta charset='utf-8'>
<link rel="stylesheet" href="" />
#map {
height: 500px;
width: 1000px;
<div id="map"></div>
<script src=""></script>
// Create a Leaflet map and center it
var map ='map').setView([37.3382, -121.8863], 10);
// Add an CARTO basemap
L.tileLayer('http://{s}{z}/{x}/{y}.png', {
attribution: '&copy; <a href="">OpenStreetMap</a> &copy; <a href="">CartoDB</a>'
// Add WMS layer - railways
L.tileLayer.wms('', {
// specify layers
layers: 'druid:cf342kq2270',
// specify the format & transparency
format: 'image/png',
transparent: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment