Javascript examples for Leaflet:Map
Multiple Leaflet maps on same page with same options
<html> <head> <title>2 maps</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css"> <script type="text/javascript" src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script> <style id="compiled-css" type="text/css"> #map { height: 300px; } #map2 { height: 300px; } </style> <script type="text/javascript"> window.onload=function(){/*from w ww. ja va2 s.c o m*/ var map = L.map('map').setView([48.858190, 2.294470], 16); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map); L.marker([48.858190, 2.294470]).addTo(map) .bindPopup('This is the Eiffel Tower<br> Easily customizable.') .openPopup(); var map2 = L.map('map2').setView([48.858190, 2.294470], 16); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' }).addTo(map2); } </script> </head> <body> <div id="map"></div> <div id="map2"></div> </body> </html>