{"id":19621338,"url":"https://github.com/commenthol/leaflet-rastercoords","last_synced_at":"2025-04-07T07:04:29.331Z","repository":{"id":37445299,"uuid":"71530258","full_name":"commenthol/leaflet-rastercoords","owner":"commenthol","description":"Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet","archived":false,"fork":false,"pushed_at":"2023-09-25T19:56:13.000Z","size":60189,"stargazers_count":126,"open_issues_count":1,"forks_count":24,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-31T06:01:50.716Z","etag":null,"topics":["coordinates","leaflet-plugin","raster","tiled-image-viewer"],"latest_commit_sha":null,"homepage":"https://commenthol.github.io/leaflet-rastercoords","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/commenthol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-10-21T04:38:11.000Z","updated_at":"2025-03-20T08:25:22.000Z","dependencies_parsed_at":"2024-06-18T18:18:49.139Z","dependency_job_id":"ba7a8050-751c-4617-8567-e2793b25fefe","html_url":"https://github.com/commenthol/leaflet-rastercoords","commit_stats":{"total_commits":28,"total_committers":3,"mean_commits":9.333333333333334,"dds":0.1428571428571429,"last_synced_commit":"5624dac2865fc6e455f3797b73b1fdfe7294b4bd"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fleaflet-rastercoords","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fleaflet-rastercoords/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fleaflet-rastercoords/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commenthol%2Fleaflet-rastercoords/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commenthol","download_url":"https://codeload.github.com/commenthol/leaflet-rastercoords/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608150,"owners_count":20965952,"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":["coordinates","leaflet-plugin","raster","tiled-image-viewer"],"created_at":"2024-11-11T11:22:25.841Z","updated_at":"2025-04-07T07:04:29.309Z","avatar_url":"https://github.com/commenthol.png","language":"JavaScript","readme":"# leaflet-rastercoords\n\n\u003e Leaflet plugin for plain image map projection to display large images using tiles generated with gdal2tiles-leaflet\n\n[![NPM version](https://badge.fury.io/js/leaflet-rastercoords.svg)](https://www.npmjs.com/package/leaflet-rastercoords)\n\nSee the plugin in action on \u003chttps://commenthol.github.io/leaflet-rastercoords/\u003e.\n\n## Usage\n\nProcess your \"large\" image with [gdal2tiles-leaflet][]\n\n```js\n// for use with browserify / webpack\nvar L = require('leaflet')\nL.RasterCoords = require('leaflet-rastercoords')\n\nvar img = [\n  3831,  // original width of image (here from `example/karta.jpg`)\n  3101   // original height of image\n]\n// create the map\nvar map = L.map('map', {\n  crs: L.CRS.Simple\n})\n\n// assign map and image dimensions\nvar rc = new L.RasterCoords(map, img)\n// set max zoom Level (might be `x` if gdal2tiles was called with `-z 0-x` option)\nmap.setMaxZoom(rc.zoomLevel())\n// all coordinates need to be unprojected using the `unproject` method\n// set the view in the lower right edge of the image\nmap.setView(rc.unproject([img[0], img[1]]), 2)\n\n// set markers on click events in the map\nmap.on('click', function (event) {\n  // any position in leaflet needs to be projected to obtain the image coordinates\n  var coords = rc.project(event.latlng)\n  var marker = L.marker(rc.unproject(coords))\n    .addTo(map)\n  marker.bindPopup('[' + Math.floor(coords.x) + ',' + Math.floor(coords.y) + ']')\n    .openPopup()\n})\n\n// the tile layer containing the image generated with `gdal2tiles --leaflet -p raster -w none \u003cimg\u003e tiles`\nL.tileLayer('./tiles/{z}/{x}/{y}.png', {\n  noWrap: true,\n  bounds: rc.getMaxBounds(),\n  maxNativeZoom: rc.zoomLevel()\n}).addTo(map)\n```\n\n## Example\n\nThe tiles in the example were generated using [gdal2tiles-leaflet][].\nTake a look at [example/createtiles.sh](./example/createtiles.sh).\n\n## License\n\nCopyright (c) 2016- commenthol (MIT License)  \nSee [LICENSE][] for more info.\n\n## References\n\n\u003c!-- !ref --\u003e\n\n* [example][example]\n* [gdal2tiles-leaflet][gdal2tiles-leaflet]\n* [LICENSE][LICENSE]\n\n\u003c!-- ref! --\u003e\n\n[LICENSE]: ./LICENSE\n[gdal2tiles-leaflet]: https://github.com/commenthol/gdal2tiles-leaflet\n[example]: https://commenthol.github.io/gdal2tiles-leaflet/test/index.html\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fleaflet-rastercoords","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommenthol%2Fleaflet-rastercoords","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommenthol%2Fleaflet-rastercoords/lists"}