{"id":13555583,"url":"https://github.com/calvinmetcalf/leaflet-ajax","last_synced_at":"2025-10-10T03:36:17.995Z","repository":{"id":5411753,"uuid":"6602440","full_name":"calvinmetcalf/leaflet-ajax","owner":"calvinmetcalf","description":"plugin for leaflet for ajax","archived":false,"fork":false,"pushed_at":"2017-11-15T19:16:07.000Z","size":1014,"stargazers_count":372,"open_issues_count":19,"forks_count":188,"subscribers_count":18,"default_branch":"gh-pages","last_synced_at":"2025-10-03T20:29:37.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://calvinmetcalf.github.io/leaflet-ajax/example/","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/calvinmetcalf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-08T20:08:52.000Z","updated_at":"2025-05-30T10:31:13.000Z","dependencies_parsed_at":"2022-08-06T18:15:18.456Z","dependency_job_id":null,"html_url":"https://github.com/calvinmetcalf/leaflet-ajax","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/calvinmetcalf/leaflet-ajax","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fleaflet-ajax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fleaflet-ajax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fleaflet-ajax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fleaflet-ajax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calvinmetcalf","download_url":"https://codeload.github.com/calvinmetcalf/leaflet-ajax/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calvinmetcalf%2Fleaflet-ajax/sbom","scorecard":{"id":263373,"data":{"date":"2025-08-11","repo":{"name":"github.com/calvinmetcalf/leaflet-ajax","commit":"1f7c87600efe3fecf782ffdff9d44c8142441204"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 2/23 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.md:0","Info: FSF or OSI recognized license: MIT License: license.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'gh-pages'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: non-200 OK status code: 502 Bad Gateway body: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e502 Bad Gateway\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e502 Bad Gateway\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\"","details":null,"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T11:21:06.289Z","repository_id":5411753,"created_at":"2025-08-17T11:21:06.289Z","updated_at":"2025-08-17T11:21:06.289Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002621,"owners_count":26083425,"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","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-08-01T12:03:17.782Z","updated_at":"2025-10-10T03:36:17.972Z","avatar_url":"https://github.com/calvinmetcalf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"leaflet-ajax\r\n===========\r\n\r\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\r\n\r\n\r\nAllows you to call JSON via an Ajax call with a jsonp fallback.\r\n\r\n```javascript\r\nvar geojsonLayer = new L.GeoJSON.AJAX(\"geojson.json\");\r\n```\r\nfor jsonp add the option \"dataType\" and set it to \"jsonp\"\r\n``` javascript\r\nvar geojsonLayer = L.geoJson.ajax(\"http:webhost.fake/geojson.jsonp\",{dataType:\"jsonp\"});\r\n```\r\nNote that data starts to download when the layer is created NOT when it’s added to the map in order to get a head start.\r\n\r\nYou may pass either a url string or an array of url strings if you want to download multiple things (handy\r\nif your downloading data from an ESRI based thing which will have separate line, point, and poly features).\r\n\r\nAs you see you can also use lower case methods without creating new objects\r\n\r\nFor weirder jsonp you can set \"callbackParam\" for if you need to change the name of the callback parameter to something besides \"callback\", e.g. [Mapquest Nominative Open](http://open.mapquestapi.com/nominatim/) uses \"json_callback\" instead of \"callback\".\r\n\r\nIf you want to be able to load stuff from the file system (with appropriate custom flags set) set local to true.\r\n\r\nIf you want to set headers to the XMLHttpRequest set the 'headers' option equal to an object.\r\n\r\nGives off three events `data:loading`, `data:progress` and `data:loaded`.\r\n\r\n- `data:loading` fires before we start downloading things, note if the constructor is given a url it won't wait to be added to the map\r\nto start downloading the data, but it does do an async wait so you have time to add a listener to it (and so [leaflet.spin](https://github.com/makinacorpus/Leaflet.Spin) will work with it).\r\n- `data:progress` is called each time a file is downloaded and passes the downloaded geojson as event data.\r\n- `data:loaded` is called when all files have downloaded, this is mainly different from `data:progress` when you are downloading multiple things.\r\n\r\nYou can also add a middleware function which is called after you download the data but before you add it to leaflet:\r\n\r\n```javascript\r\nvar geojsonLayer = L.geoJson.ajax(\"route/to/esri.json\",{\r\n    \tmiddleware:function(data){\r\n        \treturn esri2geoOrSomething(json);\r\n    \t}\r\n    });\r\n```\r\n\r\naddUrl does not clear the current layers but adds to the current one,  e.g.:\r\n\r\n```javascript\r\nvar geojsonLayer = L.geoJson.ajax(\"data.json\");\r\ngeojsonLayer.addUrl(\"data2.json\");//we now have 2 layers\r\ngeojsonLayer.refresh();//redownload the most recent layer\r\ngeojsonLayer.refresh(\"new1.json\");//add a new layer replacing whatever is there\r\n```\r\n\r\nlast but now least we can refilter layers without re adding them\r\n\r\n```javascript\r\nvar geojsonLayer = L.geoJson.ajax(\"data.json\");\r\ngeojsonLayer.refilter(function(feature){\r\n    return feature.properties.key === values;\r\n});\r\n```\r\n\r\nBehind the scenes are two new classes L.Util.ajax = function (url) for same origin requests and L.Util.jsonp = function (url,options) cross origin ones. Both return promises, which have an additional abort method that will abort the ajax request.\r\n\r\n```js\r\nL.Util.ajax(\"url/same/origin.xml\").then(function(data){\r\n\tdoStuff(data);\r\n});\r\n//or\r\nL.Util.jsonp(\"http://www.dif.ori/gin\").then(function(data){\r\n\tdoStuff(data);\r\n});\r\n```\r\n\r\nIn related news `L.Util.Promise` is now a constructor for a promise, it takes one argument, a resolver function.\r\n\r\nSome of the jsonp code inspired by/taken from [this interesting looking plugin](https://github.com/stefanocudini/leaflet-search) that I have failed to make heads nor tails of (the plugin, not the jsonp code)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Fleaflet-ajax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalvinmetcalf%2Fleaflet-ajax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalvinmetcalf%2Fleaflet-ajax/lists"}