{"id":23586568,"url":"https://github.com/andrewl/leaflet","last_synced_at":"2026-05-02T02:33:19.415Z","repository":{"id":138547739,"uuid":"109251802","full_name":"andrewl/leaflet","owner":"andrewl","description":"Fork of Leaflet Drupal module","archived":false,"fork":false,"pushed_at":"2017-11-02T19:41:49.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"gh-8.x-1.x","last_synced_at":"2024-12-27T04:12:00.585Z","etag":null,"topics":["drupal","leaflet","mapping"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewl.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-11-02T10:44:16.000Z","updated_at":"2017-11-02T19:44:21.000Z","dependencies_parsed_at":"2023-05-25T21:00:43.484Z","dependency_job_id":null,"html_url":"https://github.com/andrewl/leaflet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fleaflet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fleaflet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fleaflet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewl%2Fleaflet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewl","download_url":"https://codeload.github.com/andrewl/leaflet/tar.gz/refs/heads/gh-8.x-1.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412450,"owners_count":19634016,"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":["drupal","leaflet","mapping"],"created_at":"2024-12-27T04:11:35.419Z","updated_at":"2025-11-03T10:30:39.667Z","avatar_url":"https://github.com/andrewl.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"This module provides integration with Leaflet map scripting library,\nhttp://leafletjs.com\n\n*NB This is a fork of the project on drupal.org which includes some patches for\ncritical and non-critical issues including:\n- \"LeafletMarker could not recognize geofield\" (https://www.drupal.org/node/2839538)\n- \"Style Leaflet requires a leaflet map to be configured\" (https://www.drupal.org/node/2683221)\n- \"Integration with Geolocation\" (https://www.drupal.org/node/2720901)\n\nTo use it you must have the Leaflet library installed. You can do this manually, or using composer. (see below)\n\nIn its current state, maps can be rendered as follows:\no via the included field formatter for Geofield (drupal.org/project/geofield)\nand Geolocation (drupal.org/project/geolocation)\no via Views (and Geofield)\no by using the API directly.\n\n\nInstallation (composer)\n-----------------------\n\n1. Run $ composer require drupal/leaflet:~1.0\n\n2. Add the proper repository to the composer.json file in your project root (NB not the module composer.json) to be able to require\n   the JS library:\n    {\n      \"type\": \"package\",\n      \"package\": {\n        \"name\": \"leaflet/leaflet\",\n        \"version\": \"1.0.2\",\n        \"type\": \"drupal-library\",\n        \"dist\": {\n          \"url\": \"https://github.com/Leaflet/Leaflet/archive/v1.0.2.zip\",\n          \"type\": \"zip\"\n        }\n      }\n    }\n\n3. Run $ composer require leaflet/leaflet:~1.0\n\n4. Enable Drupal modules as usual.\n\nInstallation (manual)\n---------------------\n\n1. Normal Drupal module installation\n\n2. Download the Leaflet library from http://leafletjs.com/. Leaflet 1.0.2 or\n   higher is recommended\n\n3. Enable leaflet_views for using Views and Leaflet (see below), or use the\n   display formatters for fields display.\n\n\n\nAPI Usage\n---------\nRendering a map is as simple as calling a single method, leaflet_render_map(),\nwhich takes 3 parameters.\n\n$map\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\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,\nmultipolygon, multipolygon, or json object. Additionally, features can be\ngrouped into layer groups so they can be controlled together,\nhttp://leafletjs.com/reference.html#layergroup. A feature will look something\nlike:\n\n$features = array(\n  array(\n    'type' =\u003e 'point',\n    'lat' =\u003e -12,\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, 'lon' =\u003e 123),\n      1 =\u003e array('lat' =\u003e  14, 'lon' =\u003e -123),\n      2 =\u003e array('lat' =\u003e -15, 'lon' =\u003e 123),\n      3 =\u003e array('lat' =\u003e  16, 'lon' =\u003e 123),\n      4 =\u003e array('lat' =\u003e -17, 'lon' =\u003e 123),\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\nViews integration\n-----------------\n\nTo render a map using Views, enable the module leaflet_views.\n\nYou need to add at least one geofield or geolocation field to the Fields list, and select the Leaflet\nMap style in Format.\n\nIn the settings of the style, select the geofield as the Data Source and select\na 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\nView mode.\n\nFor a tutorial, please read\nhttp://marzeelabs.org/blog/2012/09/24/building-maps-in-drupal-using-leaflet-views\n\nRoadmap\n-------\n\n* UI for managing maps\n* Better documentation\n\n\nAuthors/Credits\n---------------\n\n* [levelos](http://drupal.org/user/54135)\n* [pvhee](http://drupal.org/user/108811)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewl%2Fleaflet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewl%2Fleaflet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewl%2Fleaflet/lists"}