Skip to content

Instantly share code, notes, and snippets.

@iamtekson
Created October 31, 2019 08:19
Show Gist options
  • Save iamtekson/9b484ca98468d494822f6e485f8da46d to your computer and use it in GitHub Desktop.
Save iamtekson/9b484ca98468d494822f6e485f8da46d to your computer and use it in GitHub Desktop.
//var region defined
var region = $('#inputGroupSelect01').val()
region = $('#inputGroupSelect01').change(function() {
$(this).val()
});
//button click events
$('#load').click(function () {
//hazardLayer
var hazardLayer = L.tileLayer.wms("http://localhost:8080/geoserver/tajikistan/wms", {
layers: `tajikistan:${region}`,
format: 'image/png',
transparent: true,
version: '1.1.0',
attribution: "country layer"
});
hazardLayer.addTo(map);
$('#clear').click(function () {
map.removeLayer(hazardLayer);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment