This commit is contained in:
Zeeshaun
2026-03-17 11:09:46 -05:00
parent bd1a9744ad
commit 6e7edcfe1b
332 changed files with 64174 additions and 0 deletions
@@ -0,0 +1,27 @@
import Axios from "axios";
import { ILocationCoordinates } from "./service-types/LocationTypes";
export default class NetworkService {
public static FetchWithJSONP(url: string, JSONPFunctionIdentifier: string, callback: (data: any) => any) {
const windowCallbackNamne = "bingMapLocationCallback";
const jsonPUrl = url;
(window as any)[windowCallbackNamne] = (data: any) => {
delete (window as any)[windowCallbackNamne];
document.body.removeChild(script);
callback(data);
};
var script = document.createElement("script");
script.src = jsonPUrl;
document.body.appendChild(script);
}
public static async FetchLocationData(url: string) {
const result = await Axios.get(url);
const locationResult = result.data as ILocationCoordinates;
return locationResult;
}
}