mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-08-15 22:36:58 +00:00
add linting to examples (WIP)
This commit is contained in:
@ -17,39 +17,37 @@ title: Zoom Levels Tutorial
|
||||
attribution: cartodbAttribution
|
||||
}).addTo(map);
|
||||
|
||||
function zoomCycle(){
|
||||
function zoomCycle() {
|
||||
map.setZoom(0);
|
||||
timeouts = [];
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.25); }, 1000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.50); }, 2000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.75); }, 3000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(1); }, 4000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.75); }, 5000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.50); }, 6000));
|
||||
timeouts.push(setTimeout(function(){ map.setZoom(0.25); }, 7000));
|
||||
var timeouts = [];
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.25); }, 1000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.50); }, 2000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.75); }, 3000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(1.00); }, 4000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.75); }, 5000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.50); }, 6000));
|
||||
timeouts.push(setTimeout(function () { map.setZoom(0.25); }, 7000));
|
||||
}
|
||||
zoomCycle();
|
||||
|
||||
var zoomingInterval = setInterval(zoomCycle, 8000);
|
||||
|
||||
var ZoomViewer = L.Control.extend({
|
||||
onAdd: function(){
|
||||
|
||||
var container= L.DomUtil.create('div');
|
||||
onAdd: function () {
|
||||
var container = L.DomUtil.create('div');
|
||||
var gauge = L.DomUtil.create('div');
|
||||
container.style.width = '200px';
|
||||
container.style.background = 'rgba(255,255,255,0.5)';
|
||||
container.style.textAlign = 'left';
|
||||
map.on('zoomstart zoom zoomend', function(ev){
|
||||
map.on('zoomstart zoom zoomend', function (ev) {
|
||||
gauge.innerHTML = 'Zoom level: ' + map.getZoom();
|
||||
})
|
||||
});
|
||||
container.appendChild(gauge);
|
||||
|
||||
return container;
|
||||
}
|
||||
});
|
||||
|
||||
var zoomViewerControl = (new ZoomViewer).addTo(map);
|
||||
var zoomViewerControl = (new ZoomViewer()).addTo(map);
|
||||
|
||||
map.setView([0, 0], 0);
|
||||
</script>
|
||||
|
@ -18,9 +18,9 @@ title: Zoom Levels Tutorial
|
||||
|
||||
var scaleControl = L.control.scale({maxWidth: 150}).addTo(map);
|
||||
|
||||
setInterval(function(){
|
||||
setInterval(function () {
|
||||
map.setView([0, 0], 0, {duration: 1, animate: true});
|
||||
setTimeout(function(){
|
||||
setTimeout(function () {
|
||||
map.setView([60, 0], 0, {duration: 1, animate: true});
|
||||
}, 2000);
|
||||
}, 4000);
|
||||
|
@ -15,30 +15,30 @@ title: Zoom Levels Tutorial
|
||||
attribution: cartodbAttribution
|
||||
}).addTo(map);
|
||||
|
||||
setInterval(function(){
|
||||
setInterval(function () {
|
||||
|
||||
map.setZoom(0);
|
||||
|
||||
setTimeout(function(){
|
||||
setTimeout(function () {
|
||||
map.setZoom(1);
|
||||
}, 2000);
|
||||
|
||||
}, 4000);
|
||||
|
||||
var ZoomViewer = L.Control.extend({
|
||||
onAdd: function(){
|
||||
onAdd: function () {
|
||||
var gauge = L.DomUtil.create('div');
|
||||
gauge.style.width = '200px';
|
||||
gauge.style.background = 'rgba(255,255,255,0.5)';
|
||||
gauge.style.textAlign = 'left';
|
||||
map.on('zoomstart zoom zoomend', function(ev){
|
||||
map.on('zoomstart zoom zoomend', function (ev) {
|
||||
gauge.innerHTML = 'Zoom level: ' + map.getZoom();
|
||||
})
|
||||
});
|
||||
return gauge;
|
||||
}
|
||||
});
|
||||
|
||||
var zoomViewer = (new ZoomViewer).addTo(map);
|
||||
var zoomViewer = (new ZoomViewer()).addTo(map);
|
||||
|
||||
map.setView([0, 0], 0);
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user