Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         var map = L.map('map');
  2.   9         var osm = new L.TileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
  3.  10                             maxZoom: 18
  4.  11                             });
  5.  12         var london = new L.LatLng(51.505, -0.09); // geographical point (longitude and latitude)
  6.  13         map.setView(london, 13).addLayer(osm);
  7.  14         var marker = L.marker([51.5, -0.09]).addTo(map);
  8.  15         var circle = L.circle([51.508, -0.11], 500, {
  9.  16                     color: 'red',
  10.  17                         fillColor: '#f03',
  11.  18                             fillOpacity: 0.5
  12.  19                             }).addTo(map);
  13.  20         var polygon = L.polygon([
  14.  21                     [51.509, -0.08],
  15.  22                         [51.503, -0.06],
  16.  23                             [51.51, -0.047]
  17.  24                             ]).addTo(map);
  18.  25         marker.bindPopup("<b>Hello world!</b><br>I am a popup.").openPopup();
  19.  26         circle.bindPopup("I am a circle.");
  20.  27         polygon.bindPopup("I am a polygon.");
  21.  28         var popup = L.popup()
  22.  29         .setLatLng([51.5, -0.09])
  23.  30         .setContent("I am a standalone popup.")
  24.  31             .openOn(map);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement