{"id":404,"date":"2013-12-27T14:45:59","date_gmt":"2013-12-27T19:45:59","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=404"},"modified":"2013-12-27T14:45:59","modified_gmt":"2013-12-27T19:45:59","slug":"leaflet-is-a-modern-open-source-javascript-library","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2013\/12\/27\/leaflet-is-a-modern-open-source-javascript-library\/","title":{"rendered":"Leaflet is a modern open-source JavaScript library"},"content":{"rendered":"<p>Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by\u00a0<a href=\"http:\/\/agafonkin.com\/en\">Vladimir Agafonkin<\/a>\u00a0with a\u00a0team of dedicated\u00a0<a href=\"https:\/\/github.com\/Leaflet\/Leaflet\/graphs\/contributors\">contributors<\/a>. Weighing just about\u00a0<abbr title=\"33 KB gzipped \u2014 that's 123 KB minified and 218 KB in the source form, with 10 KB of CSS (2 KB gzipped) and 11 KB of images.\">33 KB of JS<\/abbr>, it has all the\u00a0<a href=\"http:\/\/leafletjs.com\/features.html\">features<\/a>\u00a0most developers ever need for online maps.<\/p>\n<p>Leaflet is designed with\u00a0<em>simplicity<\/em>,\u00a0<em>performance<\/em>\u00a0and\u00a0<em>usability<\/em>\u00a0in mind. It works efficiently across all major desktop and mobile platforms out of the box, taking advantage of HTML5 and CSS3 on modern browsers while still being accessible on older ones. It can be extended with a huge amount of\u00a0<a href=\"http:\/\/leafletjs.com\/plugins.html\">plugins<\/a>, has a beautiful, easy to use and\u00a0<a title=\"Leaflet API reference\" href=\"http:\/\/leafletjs.com\/reference.html\">well-documented API<\/a>\u00a0and a simple, readable\u00a0<a title=\"Leaflet GitHub repository\" href=\"https:\/\/github.com\/Leaflet\/Leaflet\">source code<\/a>\u00a0that is a\u00a0joy to<a title=\"A guide to contributing to Leaflet\" href=\"https:\/\/github.com\/Leaflet\/Leaflet\/blob\/master\/CONTRIBUTING.md\">contribute<\/a>\u00a0to.<\/p>\n<p>Used by:\u00a0<a href=\"http:\/\/flickr.com\/map\">Flickr<\/a>\u00a0<a href=\"https:\/\/foursquare.com\/\">foursquare<\/a>\u00a0<a href=\"http:\/\/t.co\/V4EiURIA\">craigslist<\/a>\u00a0<a href=\"http:\/\/data.gov\/\">Data.gov<\/a>\u00a0<a href=\"http:\/\/www.ign.com\/wikis\/the-elder-scrolls-5-skyrim\/interactive-maps\/Skyrim\">IGN<\/a>\u00a0<a href=\"http:\/\/blog.wikimedia.org\/2012\/04\/05\/new-wikipedia-app-for-ios-and-an-update-for-our-android-app\/\">Wikimedia<\/a>\u00a0<a href=\"http:\/\/openstreetmap.org\/\">OSM<\/a>\u00a0<a href=\"http:\/\/www.meetup.com\/\">Meetup<\/a>\u00a0<a href=\"http:\/\/projects.wsj.com\/campaign2012\/maps\/\">WSJ<\/a>\u00a0<a href=\"http:\/\/mapbox.com\/\">MapBox<\/a>\u00a0<a href=\"http:\/\/cloudmade.com\/\">CloudMade<\/a>\u00a0<a href=\"http:\/\/cartodb.com\/\">CartoDB<\/a>\u00a0<a href=\"http:\/\/www.giscloud.com\/\">GIS Cloud<\/a>\u00a0\u2026<\/p>\n<div id=\"map\" tabindex=\"0\">\n<div>\n<div>\n<div>\n<div><\/div>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/c.tile.openstreetmap.org\/17\/65477\/43584.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/b.tile.openstreetmap.org\/17\/65476\/43584.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/b.tile.openstreetmap.org\/17\/65477\/43583.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/a.tile.openstreetmap.org\/17\/65476\/43583.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/c.tile.openstreetmap.org\/17\/65476\/43585.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/a.tile.openstreetmap.org\/17\/65477\/43585.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/a.tile.openstreetmap.org\/17\/65475\/43584.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/a.tile.openstreetmap.org\/17\/65478\/43584.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/b.tile.openstreetmap.org\/17\/65475\/43585.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/c.tile.openstreetmap.org\/17\/65475\/43583.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/c.tile.openstreetmap.org\/17\/65478\/43583.png\" \/><img decoding=\"async\" alt=\"\" src=\"http:\/\/b.tile.openstreetmap.org\/17\/65478\/43585.png\" \/><\/div>\n<\/div>\n<\/div>\n<div>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/leafletjs.com\/dist\/images\/marker-shadow.png\" \/><\/div>\n<div><\/div>\n<div><img decoding=\"async\" tabindex=\"0\" alt=\"\" src=\"http:\/\/leafletjs.com\/dist\/images\/marker-icon.png\" \/><\/div>\n<div>\n<div><a href=\"http:\/\/leafletjs.com\/index.html#close\">\u00d7<\/a><\/p>\n<div>\n<div>A pretty CSS3 popup.<br \/>\nEasily customizable.<\/div>\n<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div>\n<div><a title=\"Zoom in\" href=\"http:\/\/leafletjs.com\/index.html#\">+<\/a><a title=\"Zoom out\" href=\"http:\/\/leafletjs.com\/index.html#\">&#8211;<\/a><\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div>\n<div><a title=\"A JS library for interactive maps\" href=\"http:\/\/leafletjs.com\/\">Leaflet<\/a>\u00a0| \u00a9\u00a0<a href=\"http:\/\/openstreetmap.org\/copyright\">OpenStreetMap<\/a>\u00a0contributors<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>In this basic example, we create a map with\u00a0<abbr title=\"Here we use OpenStreetMap tiles, but Leaflet doesn't force you to \u2014 use whatever works for you, it's open source!\">tiles of our choice<\/abbr>, add a marker and bind a popup with some text to it:<\/p>\n<pre><code>\/\/ create a map in the \"map\" div, set the view to a given place and zoom\nvar map = L.map('map').setView([51.505, -0.09], 13);\n\n\/\/ add an OpenStreetMap tile layer\nL.tileLayer('http:\/\/{s}.tile.osm.org\/{z}\/{x}\/{y}.png', {\n    attribution: '&amp;copy; &lt;a href=\"http:\/\/osm.org\/copyright\"&gt;OpenStreetMap&lt;\/a&gt; contributors'\n}).addTo(map);\n\n\/\/ add a marker in the given location, attach some popup content to it and open the popup\nL.marker([51.5, -0.09]).addTo(map)\n    .bindPopup('A pretty CSS3 popup. &lt;br&gt; Easily customizable.')\n    .openPopup();\n<\/code><\/pre>\n<p>Learn more with the\u00a0<a href=\"http:\/\/leafletjs.com\/examples\/quick-start.html\">quick start guide<\/a>, check out\u00a0<a href=\"http:\/\/leafletjs.com\/examples.html\">other tutorials<\/a>, or head straight to the\u00a0<a href=\"http:\/\/leafletjs.com\/reference.html\">API documentation<\/a>.<br \/>\nIf you have any questions, take a look at the\u00a0<a href=\"https:\/\/github.com\/Leaflet\/Leaflet\/blob\/master\/FAQ.md\">FAQ<\/a>\u00a0first.<\/p>\n<h2 id=\"getting-involved\">Getting Involved<\/h2>\n<p>Third-party patches are absolutely essential on our quest to create the best mapping library that will ever exist. However, they\u2019re not the only way to get involved with the development of Leaflet. You can help the project tremendously by discovering and\u00a0<a href=\"https:\/\/github.com\/Leaflet\/Leaflet\/blob\/master\/CONTRIBUTING.md#reporting-bugs\">reporting bugs<\/a>,<a href=\"https:\/\/github.com\/Leaflet\/Leaflet\/blob\/master\/CONTRIBUTING.md#improving-documentation\">improving documentation<\/a>, helping others on the\u00a0<a href=\"https:\/\/groups.google.com\/forum\/#!forum\/leaflet-js\">Leaflet forum<\/a>\u00a0and\u00a0<a href=\"https:\/\/github.com\/Leaflet\/Leaflet\/issues\">GitHub issues<\/a>, showing your support for your favorite feature suggestions on\u00a0<a href=\"http:\/\/leaflet.uservoice.com\/\">Leaflet UserVoice page<\/a>, tweeting to\u00a0<a href=\"http:\/\/twitter.com\/LeafletJS\">@LeafletJS<\/a>\u00a0and spreading the word about Leaflet among your colleagues and friends.<\/p>\n<p>Check out the\u00a0<a title=\"A guide to contributing to Leaflet\" href=\"https:\/\/github.com\/Leaflet\/Leaflet\/blob\/master\/CONTRIBUTING.md\">contribution guide<\/a>\u00a0for more information on getting involved with Leaflet development.<\/p>\n<p>&nbsp;<\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by\u00a0Vladimir Agafonkin\u00a0with a\u00a0team of dedicated\u00a0contributors. Weighing just about\u00a033 KB of JS,&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-404","post","type-post","status-publish","format-standard","hentry","category-web-design"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=404"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}