QC2C
Quick Coordinates To Country (QC2C)
வெளியானவை
- பதிப்பு
- 1.0.1
- உரிமம்
- MIT
- தொழில்நுட்பத் தொகுப்பு
- TypeScriptPython
GPS ஆயத்தொலைவுகளை நாட்டு குறியீடாக மாற்றும் வேகமான, இணையம் தேவையில்லாத முறை!
எடுத்துக்காட்டு
$ npm i qc2cimport { coordinatesToCountry } from "qc2c";
import { LatLng } from "leaflet";
const coordinates: LatLng = new LatLng(48.8566, 2.3522); // Paris
coordinatesToCountry(
coordinates,
{
manifest: "https://www.levialabs.net/assets/qc2c/world_sectors.json",
sectors: "https://www.levialabs.net/assets/qc2c",
})
.then((countryCode: string | null) => {
if (countryCode) {
console.log("Country code:", countryCode); // FR
} else {
console.log("No country found for these coordinates");
}
})
.catch((error) => {
console.error("Error fetching country:", error);
});