Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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/v1.3.1/leaflet.js'></script>
  8. <script src="leaflet-side-by-side.js"></script>
  9. <link href='http://cdn.leafletjs.com/leaflet/v1.3.1/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('https://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>