mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-05-26 01:07:49 +02:00
dockerize
This commit is contained in:
@@ -1,14 +1,44 @@
|
||||
import axios from "axios";
|
||||
|
||||
export interface BoundingBox {
|
||||
export interface BoundingBoxLiteral {
|
||||
minLat: number;
|
||||
maxLat: number;
|
||||
minLng: number;
|
||||
maxLng: number;
|
||||
}
|
||||
|
||||
export class BoundingBox implements BoundingBoxLiteral {
|
||||
minLat: number;
|
||||
maxLat: number;
|
||||
minLng: number;
|
||||
maxLng: number;
|
||||
|
||||
constructor({minLat, maxLat, minLng, maxLng}: BoundingBoxLiteral) {
|
||||
this.minLat = minLat;
|
||||
this.maxLat = maxLat;
|
||||
this.minLng = minLng;
|
||||
this.maxLng = maxLng;
|
||||
}
|
||||
|
||||
updateFromOther(boundingBoxLiteral: BoundingBoxLiteral) {
|
||||
this.minLat = boundingBoxLiteral.minLat;
|
||||
this.maxLat = boundingBoxLiteral.maxLat;
|
||||
this.minLng = boundingBoxLiteral.minLng;
|
||||
this.maxLng = boundingBoxLiteral.maxLng;
|
||||
}
|
||||
|
||||
isSubsetOf(other: BoundingBoxLiteral) {
|
||||
return (
|
||||
this.minLat >= other.minLat &&
|
||||
this.maxLat <= other.maxLat &&
|
||||
this.minLng >= other.minLng &&
|
||||
this.maxLng <= other.maxLng
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const apiService = axios.create({
|
||||
baseURL: "http://localhost:8080",
|
||||
baseURL: window.location.hostname === "localhost" ? "http://localhost:8080/api" : "/api",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user