Advertisement
CristianCantoro

Leaflet_example

Sep 18th, 2013
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.78 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>Leaflet Quick Start Guide Example</title>
  5.     <meta charset="utf-8" />
  6.  
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.  
  9.     <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css"/>
  10.     <!--[if lte IE 8]><link rel="stylesheet" href="../dist/leaflet.ie.css" /><![endif]-->
  11. </head>
  12. <body>
  13.     <!-- copy-pasted from:
  14.          * http://leafletjs.com/examples/quick-start.html
  15.          * http://leafletjs.com/examples/custom-icons.html
  16.     -->
  17.     <div id="map" style="width: 600px; height: 400px"></div>
  18.  
  19.     <script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
  20.     <script>
  21.  
  22.         // Tux icon by: Larry Ewing, Simon Budig, Anja Gerwinski
  23.         // see https://commons.wikimedia.org/wiki/Image:Tux.svg
  24.  
  25.         var map = L.map('map').setView([45.70, 9.64], 13);
  26.  
  27.         L.tileLayer('http://{s}.tile.cloudmade.com/74f3f6ca3f714d4ab3aab495f7d9e6e9/997/256/{z}/{x}/{y}.png', {
  28.             maxZoom: 18,
  29.             attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
  30.         }).addTo(map);
  31.  
  32.         var TuxIcon = L.icon({
  33.             // download icon: http://img689.imageshack.us/img689/3476/9s4a.png
  34.             iconUrl: 'Tux_64x64.png',
  35.  
  36.             iconSize:     [44, 54], // size of the icon
  37.             iconAnchor:   [22, 40], // point of the icon which will correspond to marker's location
  38.             popupAnchor:  [10, -38] // point from which the popup should open relative to the iconAnchor
  39.         });
  40.  
  41.         L.marker([45.6907079, 9.6336869], {icon: TuxIcon}).addTo(map)
  42.             .bindPopup("<b>Linux Day 2013 a Bergamo</b><br />BGLUG - ecc. ecc. .").openPopup();
  43.  
  44.  
  45.         var popup = L.popup();
  46.  
  47.     </script>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement