{"id":21539869,"url":"https://github.com/raruto/leaflet-control-layers-inline","last_synced_at":"2025-03-17T21:44:20.431Z","repository":{"id":98199472,"uuid":"193389841","full_name":"Raruto/leaflet-control-layers-inline","owner":"Raruto","description":"Leaflet plugin that allows to display inline layers control","archived":false,"fork":false,"pushed_at":"2020-08-06T13:41:17.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-29T23:24:05.195Z","etag":null,"topics":["basemaps","control","inline","layers","leaflet"],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Raruto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-06-23T19:56:58.000Z","updated_at":"2024-06-21T16:53:32.366Z","dependencies_parsed_at":null,"dependency_job_id":"4bc907e2-0e41-4fe3-81d6-5ea4317d48fc","html_url":"https://github.com/Raruto/leaflet-control-layers-inline","commit_stats":{"total_commits":15,"total_committers":3,"mean_commits":5.0,"dds":"0.33333333333333337","last_synced_commit":"81b31447767babde311714820aab028af65b8dd6"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raruto%2Fleaflet-control-layers-inline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raruto%2Fleaflet-control-layers-inline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raruto%2Fleaflet-control-layers-inline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Raruto%2Fleaflet-control-layers-inline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Raruto","download_url":"https://codeload.github.com/Raruto/leaflet-control-layers-inline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244117034,"owners_count":20400734,"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":["basemaps","control","inline","layers","leaflet"],"created_at":"2024-11-24T04:16:37.145Z","updated_at":"2025-03-17T21:44:20.408Z","avatar_url":"https://github.com/Raruto.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leaflet-control-layers-inline.js\nA Leaflet plugin that allows to display inline layers control\n\n_For a working example see [demo](https://raruto.github.io/leaflet-control-layers-inline/examples/leaflet-control-layers-inline.html)_\n\n---\n\n## How to use\n\n1. **include CSS \u0026 JavaScript**\n    ```html\n    \u003chead\u003e\n    ...\n    \u003cstyle\u003e html, body, #map { height: 100%; width: 100%; padding: 0; margin: 0; } \u003c/style\u003e\n    \u003c!-- Leaflet (JS/CSS) --\u003e\n    \u003clink rel=\"stylesheet\" href=\"https://unpkg.com/leaflet@1.6.0/dist/leaflet.css\" /\u003e\n    \u003cscript src=\"https://unpkg.com/leaflet@1.6.0/dist/leaflet.js\"\u003e\u003c/script\u003e\n    \u003c!-- Leaflet-Control-Layers-Inline --\u003e\n    \u003cscript src=\"https://unpkg.com/leaflet-control-layers-inline@latest/leaflet-control-layers-inline.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/leaflet-control-layers-inline@latest/leaflet-control-layers-inline.css\"\u003e\u003c/script\u003e\n    ...\n    \u003c/head\u003e\n    ```\n2. **choose a div container used for the slippy map**\n    ```html\n    \u003cbody\u003e\n    ...\n\t  \u003cdiv id=\"map\"\u003e\u003c/div\u003e\n    ...\n    \u003c/body\u003e\n    ```\n3. **create your first simple “leaflet-control-layers-inline” slippy map**\n    ```html\n    \u003cscript\u003e\n\n      var opts = {\n        map: {\n          center: [41.4583, 12.7059],\n          zoom: 5,\n          zoomControl: false\n        },\n        osmLayer: {\n          url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n          options: {\n            maxZoom: 19,\n            attribution: 'Map data: \u0026copy; \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e'\n          }\n        },\n        terrainLayer: {\n          url: 'https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png',\n          options: {\n            maxZoom: 18,\n            subdomains: 'abcd',\n            attribution: 'Map tiles by \u003ca href=\"http://stamen.com\"\u003eStamen Design\u003c/a\u003e, \u003ca href=\"http://creativecommons.org/licenses/by/3.0\"\u003eCC BY 3.0\u003c/a\u003e \u0026mdash; Map data \u0026copy; \u003ca href=\"https://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e contributors'\n          }\n        },\n        satelliteLayer: {\n          url: 'http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n          options: {\n            maxZoom: 18,\n            attribution: '\u0026copy; \u003ca href=\"http://www.esri.com/\"\u003eEsri\u003c/a\u003e'\n          }\n        },\n        otmLayer: {\n          url: 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',\n          options: {\n            maxZoom: 17,\n            attribution: 'Map data: \u0026copy; \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eOpenStreetMap\u003c/a\u003e, \u003ca href=\"http://viewfinderpanoramas.org\"\u003eSRTM\u003c/a\u003e | Map style: \u0026copy; \u003ca href=\"https://opentopomap.org\"\u003eOpenTopoMap\u003c/a\u003e (\u003ca href=\"https://creativecommons.org/licenses/by-sa/3.0/\"\u003eCC-BY-SA\u003c/a\u003e)'\n          }\n        }\n      };\n\n      var map = L.map('map', opts.map);\n\n      var baseLayers = {};\n\n      baseLayers[\"OSM\"] = L.tileLayer(opts.osmLayer.url, opts.osmLayer.options);\n      baseLayers[\"Terrain\"] = L.tileLayer(opts.terrainLayer.url, opts.terrainLayer.options);\n      baseLayers[\"Satellite\"] = L.tileLayer(opts.satelliteLayer.url, opts.satelliteLayer.options);\n      baseLayers[\"Topo\"] = L.tileLayer(opts.otmLayer.url, opts.otmLayer.options);\n\n      var zoom = L.control.zoom({\n        position: 'bottomright'\n      }).addTo(map);\n\n      var control = L.control.layers(baseLayers, null, {\n        inline: true, // enable inline mode\n        position: 'topleft'\n      }).addTo(map);\n\n      map.addLayer(baseLayers[\"Topo\"]);\n\n    \u003c/script\u003e\n    ```\n_Related: [Leaflet-UI presets](https://github.com/raruto/leaflet-ui)_\n\n---\n\n**Compatibile with:** leaflet@1.6.0\n\n---\n\n**Contributors:** [Raruto](https://github.com/Raruto/leaflet-control-layers-inline)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraruto%2Fleaflet-control-layers-inline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraruto%2Fleaflet-control-layers-inline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraruto%2Fleaflet-control-layers-inline/lists"}