{"id":25209850,"url":"https://github.com/backdrop-contrib/leaflet","last_synced_at":"2025-10-25T09:31:45.367Z","repository":{"id":3916108,"uuid":"51096471","full_name":"backdrop-contrib/leaflet","owner":"backdrop-contrib","description":"Backdrop CMS Integration with the Leaflet map scripting library.","archived":false,"fork":false,"pushed_at":"2024-09-06T09:14:23.000Z","size":3115,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":11,"default_branch":"1.x-1.x","last_synced_at":"2024-09-06T16:11:12.774Z","etag":null,"topics":["backdropcms","leaflet","mapping"],"latest_commit_sha":null,"homepage":"https://backdropcms.org/project/leaflet","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/backdrop-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-04T18:35:18.000Z","updated_at":"2024-09-06T09:06:37.000Z","dependencies_parsed_at":"2024-02-19T14:38:10.150Z","dependency_job_id":"8d4f3ccf-698b-4cfe-ad2e-c2d70b1324a6","html_url":"https://github.com/backdrop-contrib/leaflet","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backdrop-contrib%2Fleaflet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backdrop-contrib%2Fleaflet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backdrop-contrib%2Fleaflet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/backdrop-contrib%2Fleaflet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/backdrop-contrib","download_url":"https://codeload.github.com/backdrop-contrib/leaflet/tar.gz/refs/heads/1.x-1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238117361,"owners_count":19419223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backdropcms","leaflet","mapping"],"created_at":"2025-02-10T13:18:42.420Z","updated_at":"2025-10-25T09:31:39.531Z","avatar_url":"https://github.com/backdrop-contrib.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet\n\nIntegration with a recent version of the [Leaflet](https://leafletjs.com/) JS\n mapping library, a modern, lightweight Open-Source library for interactive\n maps.\n\n*The Leaflet module features:*\n\n- Field formatter for the [Geofield](https://backdropcms.org/project/geofield)\n  to render geospatial data as maps (main module)\n- Views integration that plots data on a map (using the sub module Leaflet Views)\n- Animated marker clustering functionality using the Leaflet MarkerCluster library\n  (in a sub module)\n- A lot more attractive map styles from a variety of providers (in another sub module)\n- A demo block for all those map styles (in its own sub module)\n- Lightweight and easy to use API for defining maps and displaying data on a map\n\n**Coming from Drupal 7?**\n\nThe formerly extra contrib projects *Leaflet Markercluster* and *Leaflet More\nMaps* now both ship with this module. And so do the required Javascript\nlibraries. This makes the Leaflet module your \"one-stop shop\" for mapping in\nBackdrop.\n\n![Example map](https://raw.githubusercontent.com/backdrop-contrib/leaflet/1.x-1.x/screenshots/map.webp)\n\n## Installation\n\n- Install this module using the\n  [official Backdrop CMS instructions](https://docs.backdropcms.org/documentation/extend-with-modules)\n\n- The module comes packaged with Leaflet library, and a set of leaflet plugins.\n\n## Related modules\n\nThe [Leaflet Widget](https://backdropcms.org/project/leaflet_widget)\n utilizes this module's library to input values like markers or\n geometries into [Geofields](https://backdropcms.org/project/geofield) in a\n user-friendly way.\n\nIf you need a *legacy version* of the leaflet library:\n [Leaflet library](https://backdropcms.org/project/leaflet_lib) ships with\n version 1.2.0. Note that the library module is no dependency of this\n module, as this one ships with the most recent version of Leaflet.\n\n## Issues\n\nBugs and feature requests should be reported in the\n[Issue Queue](https://github.com/backdrop-contrib/leaflet/issues).\n\n\n## Views integration\n\nTo render a map using Views, enable the module leaflet_views.\n\nYou need to add at least one geofield to the Fields list, and select the\nLeaflet Map style in Format.\n\nIn the settings of the style, select the geofield as the Data Source and\nselect a field for Title and Description (which will be rendered in the popup).\n\nAs a more powerful alternative, you can use node view modes to be rendered in\nthe popup. In the Description field, select `\u003centire node\u003e` and then select a View mode.\n\nFor a tutorial, please read this (relatively old) blog post\nhttps://marzeelabs.org/blog/2012-09-24-building-maps-in-drupal-using-leaflet-views\n\n\n## API Usage (for developers)\n\nBuilding a map is as simple as calling a single method, `leaflet_build_map()`,\nwhich takes 3 parameters.\n\n`$map` (array)\nAn associative array defining a map. See `hook_leaflet_map_info()`. The module\ndefines a default map with a OpenStreet Maps base layer.\n\n`$features` (array)\nThis is the tricky part. This is an associative array of all the features you\nwant to plot on the map. A feature can be a point, linestring, polygon,\nmultilinestring, multipolygon, or json object. Additionally, features can be\ngrouped into layer groups so they can be controlled together,\nhttps://leafletjs.com/reference.html#layergroup. A feature will look\nsomething like:\n\n```php\n$features = array(\n  array(\n    'type' =\u003e 'point',\n    'lat' =\u003e 12.32,\n    'lon' =\u003e 123.45,\n    'icon' =\u003e array(\n      'iconUrl' =\u003e 'sites/default/files/mymarker.png'\n    ),\n    'popup' =\u003e l($node-\u003etitle, 'node/' . $node-\u003enid),\n    'leaflet_id' =\u003e 'some unique ID'\n  ),\n  array(\n    'type' =\u003e 'linestring',\n    'points' =\u003e array(\n      0 =\u003e array('lat' =\u003e 13.24, 'lon' =\u003e 123.2),\n      1 =\u003e array('lat' =\u003e 13.24, 'lon' =\u003e 123.2),\n      2 =\u003e array('lat' =\u003e 13.24, 'lon' =\u003e 123.2),\n      3 =\u003e array('lat' =\u003e 13.24, 'lon' =\u003e 123.2),\n      4 =\u003e array('lat' =\u003e 13.24, 'lon' =\u003e 123.2),\n    ),\n    'popup' =\u003e l($node-\u003etitle, 'node/' . $node-\u003enid),\n    'leaflet_id' =\u003e 'some unique ID'\n  ),\n  array(\n    'type' =\u003e 'json',\n    'json' =\u003e [JSON OBJECT],\n    'properties' = array(\n      'style' =\u003e [style settings],\n      'leaflet_id' =\u003e 'some unique ID'\n    )\n  )\n);\n```\n\n`$height` (string)\nHeight of the map expressed in pixels. Append 'px'. Default: '400px'.\n\n## Current Maintainers\n\n- Wes Jones (https://github.com/earthday47)\n- Indigoxela (https://github.com/indigoxela)\n\n## Credits\n\n- Ported to Backdrop CMS by gifad (https://www.drupal.org/u/gifad)\n- Originally written for Drupal by [levelos](http://drupal.org/user/54135) and \n  [pvhee](http://drupal.org/user/108811)\n\nThis module wouldn't be possible without the fabulous [Leaflet](https://leafletjs.com/)\nJavascript library, see their [LICENSE file](https://github.com/Leaflet/Leaflet/blob/master/LICENSE)\nfor details.\n\nThe also bundled Leaflet.markercluster library by the same team uses\n[MIT License](https://github.com/Leaflet/Leaflet.markercluster/blob/master/MIT-LICENCE.txt)\n\nThis module also ships with several Leaflet plugins, see the README.md file in\nthe libraries/leaflet_plugins directory for details.\n\nThe default map style provided by the main module is \"OSM Mapnik\", which\nrelies on [OpenStreetMap](https://www.openstreetmap.org/copyright) data.\n\n\n## License\n\nThis project is GPL v2 software. See the LICENSE.txt file in this directory for complete text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackdrop-contrib%2Fleaflet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbackdrop-contrib%2Fleaflet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbackdrop-contrib%2Fleaflet/lists"}