Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var myloc = new L.LatLng(13.7433242, 100.5421583);
- var myloc1 = new L.LatLng(14.979900, 102.097771);
- $(function () {
- var circle;
- var slider = document.getElementById('myRange');
- var output = document.getElementById('demo');
- output.innerHTML = slider.value + scale;
- slider.oninput = function (val) {
- output.innerHTML = this.value + scale;
- circle.setRadius(this.value);
- }
- circle = L.circle(myloc, {
- color: '#7a7777',
- weight: 0.1,
- fillColor: '#7a7777',
- fillOpacity: 0.2,
- radius: 0
- }).addTo(map);
- $('.btn-a').on('click', function(e){
- if ($(this).val() == 'First') {
- circle = L.circle(myloc, {
- color: '#7a7777',
- weight: 0.1,
- fillColor: '#7a7777',
- fillOpacity: 0.2,
- radius: 0
- }).addTo(map);
- } else if($(this).val() == 'Second') {
- circle = L.circle(myloc1, {
- color: '#7a7777',
- weight: 0.1,
- fillColor: '#7a7777',
- fillOpacity: 0.2,
- radius: 0
- }).addTo(map);
- }
- });
- });
- const circles = {
- First: myloc,
- Second: myloc1
- }
- L.circle(circles[$(this).val()], {
- color: '#7a7777',
- weight: 0.1,
- fillColor: '#7a7777',
- fillOpacity: 0.2,
- radius: 0
- }).addTo(map)
Add Comment
Please, Sign In to add comment