Leaflet makes creating maps in the browser deadsimple. With some HTML and 3 lines of JavaScript, we can quickly has a map displaying
//Create a map in the ' map ' div, set the view to a given place and zoomvarMap = l.map (' map '). Setview ([51.505,-0.09], 13);//Add an OpenStreetMap tile layerL.tilelayer (' Http://{s}.tile.osm.org/{z}/{x}/{y}.png ', {attribution:' © <a href= "Http://osm.org/copyright" >OpenStreetMap</a> contributors '}). AddTo (map);//add a marker in the given location, attach some popup content to it and open the popupL.marker ([51.5,-0.09]). AddTo (map). Bindpopup (' A pretty CSS3 popup. <br> easily customizable. '). Openpopup ();varCircle = L.circle ([51.508,-0.11], 500, {color:' Red ', FillColor:' #f03 ', fillopacity:0.5}). AddTo (map);varPolygon =L.polygon ([[51.509,-0.08], [51.503,-0.06], [51.51,-0.047]]). AddTo (map);
<!DOCTYPE HTML><HTML><Head> <Metaname= "description"content= "HTML5 Canvas Graphics and Animation Video 1" /> <MetaCharSet= "Utf-8"> <Linkrel= "stylesheet"href= "//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css"/></Head><Body><Scriptsrc= "//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></Script><DivID= "Map"style= "width:100%; height:630px;"></Div></Body></HTML>
[Javascript] Get Started with Leafletjs Mapping