{"id":16875464,"url":"https://github.com/ivansanchez/leaflet.cheaplayerat","last_synced_at":"2026-01-04T11:48:13.542Z","repository":{"id":143885459,"uuid":"47830047","full_name":"IvanSanchez/Leaflet.CheapLayerAt","owner":"IvanSanchez","description":"A cheap replacement of point-in-polygon calculations for LeafletJS maps","archived":false,"fork":false,"pushed_at":"2020-01-06T06:15:26.000Z","size":4,"stargazers_count":9,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"gh-pages","last_synced_at":"2025-02-25T22:47:43.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/IvanSanchez.png","metadata":{"files":{"readme":"README.md","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":"2015-12-11T14:07:49.000Z","updated_at":"2023-04-16T12:42:30.000Z","dependencies_parsed_at":"2023-04-17T23:31:38.349Z","dependency_job_id":null,"html_url":"https://github.com/IvanSanchez/Leaflet.CheapLayerAt","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/IvanSanchez%2FLeaflet.CheapLayerAt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanSanchez%2FLeaflet.CheapLayerAt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanSanchez%2FLeaflet.CheapLayerAt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IvanSanchez%2FLeaflet.CheapLayerAt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IvanSanchez","download_url":"https://codeload.github.com/IvanSanchez/Leaflet.CheapLayerAt/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244326945,"owners_count":20435307,"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":[],"created_at":"2024-10-13T15:36:04.877Z","updated_at":"2026-01-04T11:48:13.511Z","avatar_url":"https://github.com/IvanSanchez.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Leaflet.CheapLayerAt\n\nA cheap replacement of point-in-polygon calculations for LeafletJS maps\n\n\n\nThis [LeafletJS](http://www.leafletjs.com) plugin allows developers to query the\nmap for the layer which is under a given point in the map. It's \"cheap\" because\nit covers some use cases more efficiently than point-in-polygon queries, but it\nwon't work on all circumstances.\n\n\nSee the [demo](http://ivansanchez.github.io/Leaflet.CheapLayerAt/demo.html).\n\n\n## Why use CheapLayerAt\n\n* Does not need computationally expensive algorithms\n* Very small code size (1/20th of leaflet-pip)\n\n## Why *not* use CheapLayerAt\n\n* `\u003ccanvas\u003e` layers will prevent it from working\n* Only works on SVG vectors, markers and image overlays\n* Only retrieves the top-most layer\n* Might have sub-pixel accuracy problems\n* Ignores tile layers\n* Only works within the visible map bounds\n\n## Usage\n\nThe plugin adds two functions to `L.Map`:\n\n### `map.getLayerAt(point)`\n\nGiven an instance of `L.Point`, representing the pixel coordinates relative to the\ntop left corner of the map container, returns the `L.Layer` under that pixel, or\n`undefined` if there is no layer under that pixel.\n\nIf there is more than one layer under that pixel, this function will return the\ntop-most one, according to the DOM. e.g. if there is a marker icon over a polygon,\nthe marker will be returned and the polygon will be ignored.\n\nThe `point` parameter must be contained within the map size. Will return `undefined`\nif `point` is outside the map viewport size.\n\n### `map.getLayerAtLatLng(latlng)`\n\nGiven an instance of `L.LatLng`, returns the top-most layer containing that lat-lng.\n\nWill return `undefined` if the `latlng` is outside the current map viewport bounds.\n\n\n## Legalese\n\n---\n\n\"THE BEER-WARE LICENSE\":\n\u003civan@sanchezortega.es\u003e wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think\nthis stuff is worth it, you can buy me a beer in return.\n\n---\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivansanchez%2Fleaflet.cheaplayerat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivansanchez%2Fleaflet.cheaplayerat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivansanchez%2Fleaflet.cheaplayerat/lists"}