{"id":39451504,"url":"https://github.com/as-shiddiq/leaflet-bmswitcher","last_synced_at":"2026-01-18T04:29:55.107Z","repository":{"id":171993767,"uuid":"648555660","full_name":"as-shiddiq/leaflet-bmswitcher","owner":"as-shiddiq","description":"Leaflet Control BaseMap Switcher","archived":false,"fork":false,"pushed_at":"2023-06-09T03:30:09.000Z","size":529,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-06T07:16:20.236Z","etag":null,"topics":["leaflet","leaflet-basemap","leaflet-control","leaflet-responsive"],"latest_commit_sha":null,"homepage":"https://as-shiddiq.github.io/leaflet-bmswitcher/example/index.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/as-shiddiq.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}},"created_at":"2023-06-02T08:41:48.000Z","updated_at":"2023-06-03T01:45:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f384e86-9dc8-4643-ae4a-9b867980f6c2","html_url":"https://github.com/as-shiddiq/leaflet-bmswitcher","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"a6aa0d938b47119ed9f759513091d8583777e3a0"},"previous_names":["as-shiddiq/leaflet-bmswitcher"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/as-shiddiq/leaflet-bmswitcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-shiddiq%2Fleaflet-bmswitcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-shiddiq%2Fleaflet-bmswitcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-shiddiq%2Fleaflet-bmswitcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-shiddiq%2Fleaflet-bmswitcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/as-shiddiq","download_url":"https://codeload.github.com/as-shiddiq/leaflet-bmswitcher/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/as-shiddiq%2Fleaflet-bmswitcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28529603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["leaflet","leaflet-basemap","leaflet-control","leaflet-responsive"],"created_at":"2026-01-18T04:29:54.553Z","updated_at":"2026-01-18T04:29:55.099Z","avatar_url":"https://github.com/as-shiddiq.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet BaseMap Switcher\na simple plugins to make it easier to create a basemap control to make it look more attractive, besides that it is also responsive for mobile displays.\n![Leaflet BaseMap Switcher](thumbnail.jpg)\n\nBased and inspired on [L.switchBasemap](https://github.com/clavijojuan/L.switchBasemap)\n## Example\nSee the [example](https://as-shiddiq.github.io/leaflet-bmswitcher/example/index.html)\n\n## How to usage?\n\n```\nnpm i leaflet-bmswitcher\n```\nor download this repository direcly and save to your project.\n\nand then include the `leaflet-bmswitcher.js` and don't forget also load `leaflet-bmswitcher.css` file from the `src/` dir, and then create an object and continue like the example below :\n```js\nconst map = L.map('map').setView([-3.8420201, 114.727848], 13);\nconst bmList = [\n\t{\n\t\tlayer :  L.tileLayer(\"http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}.png\",{attribution:\"Map data © \u003ca href=\\\\\\\"http://openstreetmap.org\\\\\\\"\u003eOpenStreetMap\u003c/a\u003e contributors\"}).addTo(map),\n\t\tname : \"ArcGIS Online\",\n\t\ticon : \"assets/arcgis-online.png\"\n    },\n\t{\n\t\tlayer :  L.tileLayer(\"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\",{attribution:\"\u0026copy; \u003ca href=\\\\\\\"https://www.openstreetmap.org/copyright\\\\\\\"\u003eOpenStreetMap\u003c/a\u003e contributors\"}),\n\t\tname : \"OpenStreetMap\",\n\t\ticon : \"assets/osm.png\"\n    },\n\t{\n\t\tlayer :  L.tileLayer(\"http://mt0.google.com/vt/lyrs=m\u0026x={x}\u0026y={y}\u0026z={z}\",{attribution:\"Map data © \u003ca href=\\\\\\\"http://openstreetmap.org\\\\\\\"\u003eOpenStreetMap\u003c/a\u003e contributors\"}),\n\t\tname : \"Google Street\",\n\t\ticon : \"assets/google.png\"\n    },\n\t{\n\t\tlayer :  L.tileLayer(\"http://mt0.google.com/vt/lyrs=s\u0026x={x}\u0026y={y}\u0026z={z}\",{attribution:\"Map data © \u003ca href=\\\\\\\"http://openstreetmap.org\\\\\\\"\u003eOpenStreetMap\u003c/a\u003e contributors\"}),\n\t\tname : \"Google Satelite\",\n\t\ticon : \"assets/google-satelit.png\"\n    },\n\t{\n\t\tlayer :  L.tileLayer(\"https://stamen-tiles-{s}.a.ssl.fastly.net/toner-background/{z}/{x}/{y}{r}.png\",{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\t\tname : \"Stemen Toner\",\n\t\ticon : \"assets/stemen-toner.png\"\n    }\n];\nnew L.bmSwitcher(bmList).addTo(map);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas-shiddiq%2Fleaflet-bmswitcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fas-shiddiq%2Fleaflet-bmswitcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fas-shiddiq%2Fleaflet-bmswitcher/lists"}