Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

index.html 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset=utf-8 />
  5. <meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui' />
  6. <title>Leaflet Side-by-side</title>
  7. <script src='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet-src.js'></script>
  8. <script src="leaflet-side-by-side.js"></script>
  9. <link href='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css' rel='stylesheet' />
  10. <style>
  11. body {
  12. margin: 0;
  13. padding: 0;
  14. }
  15. #map {
  16. position: absolute;
  17. top: 0;
  18. bottom: 0;
  19. width: 100%;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div id='map'></div>
  25. <script>
  26. var map = L.map('map').setView([51.505, -0.09], 13);
  27. var osmLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  28. attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap<\/a> contributors'
  29. }).addTo(map);
  30. var stamenLayer = L.tileLayer('//stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png', {
  31. attribution:
  32. 'Map tiles by <a href="http://stamen.com">Stamen Design<\/a>, ' +
  33. '<a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0<\/a> &mdash; ' +
  34. 'Map data {attribution.OpenStreetMap}',
  35. minZoom: 1,
  36. maxZoom: 16
  37. }).addTo(map)
  38. L.control.sideBySide(stamenLayer, osmLayer).addTo(map);
  39. </script>
  40. </body>
  41. </html>