Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
Executable
+13
@@ -0,0 +1,13 @@
|
||||
import { DEBUG } from "./main";
|
||||
|
||||
export default class Asset {
|
||||
public Name: string;
|
||||
public Id: number;
|
||||
|
||||
constructor(Raw: { id: number; designation: string; deviceClass: number }) {
|
||||
this.Name = Raw.designation;
|
||||
this.Id = Raw.id;
|
||||
|
||||
if (DEBUG) console.log(`new Asset() with Id = ${this.Id}`);
|
||||
}
|
||||
}
|
||||
Executable
+69
@@ -0,0 +1,69 @@
|
||||
import { Helpers } from "./Helpers";
|
||||
import { DEBUG } from "./main";
|
||||
|
||||
export default class Building {
|
||||
public Footprint: GeoJSON.Feature | null;
|
||||
public Name: string;
|
||||
public Id: number;
|
||||
public RefPoint: Helpers.Coordinates.Utm;
|
||||
public RotationDegree: number;
|
||||
|
||||
constructor(Raw: {
|
||||
id: number;
|
||||
designation: string;
|
||||
areaId: number;
|
||||
refPoint: {
|
||||
lat: number;
|
||||
lon: number;
|
||||
};
|
||||
street: string;
|
||||
number: string;
|
||||
path: {
|
||||
lat: number;
|
||||
lon: number;
|
||||
}[];
|
||||
pathRelative: {
|
||||
lat: number;
|
||||
lon: number;
|
||||
}[];
|
||||
rotationDegree: number;
|
||||
}) {
|
||||
try {
|
||||
let footprintCoords = [
|
||||
Raw.path.map(p => [
|
||||
Helpers.Calculations.RadToDeg(p.lon),
|
||||
Helpers.Calculations.RadToDeg(p.lat)
|
||||
])
|
||||
];
|
||||
|
||||
footprintCoords[0].push([
|
||||
Helpers.Calculations.RadToDeg(Raw.path[0].lon),
|
||||
Helpers.Calculations.RadToDeg(Raw.path[0].lat)
|
||||
]); // Last point == first point
|
||||
|
||||
this.Footprint = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
name: Raw.designation
|
||||
},
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: footprintCoords
|
||||
}
|
||||
};
|
||||
} catch {
|
||||
this.Footprint = null;
|
||||
}
|
||||
|
||||
this.RefPoint = new Helpers.Coordinates.LatLon(
|
||||
Helpers.Calculations.RadToDeg(Raw.refPoint.lat),
|
||||
Helpers.Calculations.RadToDeg(Raw.refPoint.lon)
|
||||
).ToUtm();
|
||||
|
||||
this.Name = Raw.designation;
|
||||
this.Id = Raw.id;
|
||||
this.RotationDegree = Raw.rotationDegree;
|
||||
|
||||
if (DEBUG) console.log(`new Building() with Id = ${this.Id}`);
|
||||
}
|
||||
}
|
||||
Executable
+242
@@ -0,0 +1,242 @@
|
||||
import { Helpers, _, MOBILE } from "./Helpers";
|
||||
|
||||
export module Functions {
|
||||
|
||||
//#region private
|
||||
async function checkForPort(ip: string): Promise<number> {
|
||||
return new Promise<number>(async (resolve, reject) => {
|
||||
new Helpers.WebSocketRequest(
|
||||
ip,
|
||||
JSON.stringify({
|
||||
type: "servicePortsInformationRequest",
|
||||
uuid: Helpers.GenUuid()
|
||||
})
|
||||
)
|
||||
.GetResponseAsync()
|
||||
.then(response => {
|
||||
for (let p of JSON.parse(response).data[0].services) {
|
||||
if (p.nameAbbrevation === "ism") {
|
||||
return resolve(p.ports[0].number);
|
||||
}
|
||||
}
|
||||
return reject();
|
||||
})
|
||||
.catch(() => {
|
||||
return reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function retrieveDataIp(): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const defaultIp: string = "ws://192.168.133.140";
|
||||
const portToCheck: number = 2080;
|
||||
checkForPort(`${defaultIp}:${portToCheck}`)
|
||||
.then(port => resolve(`${defaultIp}:${port}`))
|
||||
.catch(() => {
|
||||
return reject();
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
async function loadData(ip: string): Promise<any> {
|
||||
return new Promise<any>((resolve, reject) => {
|
||||
new Helpers.WebSocketRequest(
|
||||
ip,
|
||||
JSON.stringify({
|
||||
type: "getEssentials",
|
||||
uuid: Helpers.GenUuid()
|
||||
})
|
||||
)
|
||||
.GetResponseAsync()
|
||||
.then(data => resolve(JSON.parse(data).data))
|
||||
.catch(() => {
|
||||
return reject();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export async function manualLoad(): Promise<any> {
|
||||
return new Promise<any>(async (resolve, reject) => {
|
||||
let data: any;
|
||||
let serverIp: string = "ws://exctds01:2080";
|
||||
serverIp = prompt(
|
||||
"Please enter ip to load data manually:",
|
||||
serverIp
|
||||
) as string;
|
||||
try {
|
||||
data = await loadData(serverIp);
|
||||
} catch {
|
||||
console.error("Unable to load data from " + serverIp);
|
||||
}
|
||||
WebSocketIp = serverIp;
|
||||
return resolve(data);
|
||||
});
|
||||
}
|
||||
|
||||
function storeInCache(key: string, value: any): void {
|
||||
window.localStorage.setItem(key, escape(JSON.stringify(value)));
|
||||
}
|
||||
|
||||
function retrieveFromCache(key: string): any | never {
|
||||
let value = window.localStorage.getItem(key);
|
||||
if (!_(value)) return JSON.parse(unescape(value as string));
|
||||
else throw new Error();
|
||||
}
|
||||
//#endregion
|
||||
|
||||
/**
|
||||
* Tries to load the data automatically from the websocket,
|
||||
* then from cache, then from the user. Always caches the
|
||||
* response.
|
||||
*/
|
||||
export async function GetData(): Promise<any> {
|
||||
return new Promise<any>(async (resolve, reject) => {
|
||||
var lastIp: string;
|
||||
|
||||
try {
|
||||
lastIp = retrieveFromCache("lastIp");
|
||||
} catch {
|
||||
lastIp = "ws://exctds01:2080";
|
||||
}
|
||||
|
||||
var errorState = false;
|
||||
var lastTry: string | null = "";
|
||||
while (_(WebSocketIp)) {
|
||||
try {
|
||||
WebSocketIp = prompt(`${(errorState ? "Failed to connect." : "")}\nEnter IP to load data (usually ws://exctds01:2080)`, (_(lastTry) ? lastIp : lastTry) as string);
|
||||
lastTry = WebSocketIp;
|
||||
if (!WebSocketIp?.includes("ws://") && !WebSocketIp?.includes("WS://")) WebSocketIp = "ws://" + WebSocketIp as string;
|
||||
let data = await loadData(WebSocketIp);
|
||||
if (!_(WebSocketIp)) storeInCache("lastIp", WebSocketIp);
|
||||
return resolve(data);
|
||||
}
|
||||
catch {
|
||||
WebSocketIp = null;
|
||||
errorState = true;
|
||||
}
|
||||
}
|
||||
|
||||
// var data: any;
|
||||
// try {
|
||||
// let serverIp = await retrieveDataIp();
|
||||
// data = await loadData(serverIp);
|
||||
// webSocketIp = serverIp;
|
||||
// } catch {
|
||||
// try {
|
||||
// data = retrieveFromCache("data");
|
||||
// } catch {
|
||||
// data = await manualLoad();
|
||||
// }
|
||||
// } finally {
|
||||
// console.log(data.type);
|
||||
// //if (data.type == "essentials"){
|
||||
// storeInCache("data", data);
|
||||
// return resolve(data);
|
||||
// /*} else {
|
||||
// GetData();
|
||||
// } */
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
export var WebSocketIp: string | null = null;
|
||||
|
||||
export async function GetMountedAssetIp(Id: number): Promise<string> {
|
||||
return new Promise<string>(async (resolve, reject) => {
|
||||
if (_(WebSocketIp)) return reject();
|
||||
try {
|
||||
let ip: string = JSON.parse(
|
||||
await new Helpers.WebSocketRequest(
|
||||
WebSocketIp as string,
|
||||
JSON.stringify({
|
||||
type: "getAssetState",
|
||||
uuid: Helpers.GenUuid(),
|
||||
data: {
|
||||
assetId: Id
|
||||
}
|
||||
})
|
||||
).GetResponseAsync()
|
||||
).data.ipAddr;
|
||||
if (!_(ip)) return resolve(`http://${ip}/`);
|
||||
else return reject();
|
||||
} catch {
|
||||
return reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function MountAsset(AssetId: string, MountingPointId: number): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
if (_(WebSocketIp)) return reject();
|
||||
try {
|
||||
let response: string = JSON.parse(
|
||||
await new Helpers.WebSocketRequest(
|
||||
WebSocketIp as string,
|
||||
JSON.stringify({
|
||||
type: "mount",
|
||||
uuid: Helpers.GenUuid(),
|
||||
data: {
|
||||
mountingPointId: MountingPointId,
|
||||
assetId: +AssetId
|
||||
}
|
||||
})
|
||||
).GetResponseAsync()
|
||||
);
|
||||
console.log(response);
|
||||
if (response) return resolve();
|
||||
else return reject();
|
||||
} catch {
|
||||
return reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function UnmountAsset(MountingPointId: number): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
if (_(WebSocketIp)) return reject();
|
||||
try {
|
||||
let response: string = JSON.parse(
|
||||
await new Helpers.WebSocketRequest(
|
||||
WebSocketIp as string,
|
||||
JSON.stringify({
|
||||
type: "unmountMountingPoint",
|
||||
uuid: Helpers.GenUuid(),
|
||||
data: {
|
||||
mountingPointId: MountingPointId,
|
||||
}
|
||||
})
|
||||
).GetResponseAsync()
|
||||
);
|
||||
if (response) return resolve();
|
||||
else return reject();
|
||||
} catch {
|
||||
return reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export async function GetMountableAssets(AssetTypeIds: number[]): Promise<any[]> {
|
||||
return new Promise<any[]>(async (resolve, reject) => {
|
||||
if (_(WebSocketIp)) return reject();
|
||||
try {
|
||||
let response: any = JSON.parse(
|
||||
await new Helpers.WebSocketRequest(
|
||||
WebSocketIp as string,
|
||||
JSON.stringify({
|
||||
type: "getAssets",
|
||||
uuid: Helpers.GenUuid(),
|
||||
data: {
|
||||
assetTypeId: AssetTypeIds,
|
||||
}
|
||||
})
|
||||
).GetResponseAsync()
|
||||
);
|
||||
if (response) return resolve(response.data);
|
||||
else return reject();
|
||||
} catch {
|
||||
return reject();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Executable
+158
@@ -0,0 +1,158 @@
|
||||
import * as UTM from "utm";
|
||||
import angular from "angular";
|
||||
|
||||
/**
|
||||
* Checks for emptyness
|
||||
* @returns obj == undefined || obj == null || obj == ""
|
||||
*/
|
||||
export function _(obj: any): boolean {
|
||||
return obj == undefined || obj == null || obj == "" || obj == [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves a DOM element
|
||||
* @returns document.querySelector(query)
|
||||
*/
|
||||
export function $(query: string): HTMLElement | null {
|
||||
return document.querySelector(query);
|
||||
}
|
||||
|
||||
export const MOBILE: boolean = /Android/i.test(navigator.userAgent);
|
||||
|
||||
declare global {
|
||||
interface Array<T> {
|
||||
includes(obj: any): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the array includes given element
|
||||
*/
|
||||
Array.prototype.includes = function(obj: any) {
|
||||
return this.find(element => element == obj) != undefined;
|
||||
};
|
||||
|
||||
export module Helpers {
|
||||
export namespace Calculations {
|
||||
export function RadToDeg(rad: number): number {
|
||||
return rad * (180 / Math.PI);
|
||||
}
|
||||
|
||||
export function DegToRad(deg: number): number {
|
||||
return (deg * Math.PI) / 180;
|
||||
}
|
||||
|
||||
export function RotatePoint(
|
||||
point: { x: number; y: number },
|
||||
angleRad: number
|
||||
): { x: number; y: number } {
|
||||
return {
|
||||
x: point.x * Math.cos(angleRad) - point.y * Math.sin(angleRad),
|
||||
y: point.x * Math.sin(angleRad) + point.y * Math.cos(angleRad)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves angular scope
|
||||
*/
|
||||
export function GetScope(): any {
|
||||
return angular.element($("body") as Element).scope() as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* ArAssets-YYYY-MM-DDTHH:mm:ss.sssZ
|
||||
*/
|
||||
export function GenUuid(): string {
|
||||
return `ArAssets-${new Date().toISOString()}`;
|
||||
}
|
||||
|
||||
export class WebSocketRequest {
|
||||
/**
|
||||
* Execute with .GetResponseAsync()
|
||||
*/
|
||||
constructor(private Ip: string, private Request: string) {}
|
||||
|
||||
/**
|
||||
* Resolves into the response of the websocket
|
||||
*/
|
||||
public async GetResponseAsync(): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
try {
|
||||
let ws = new WebSocket(this.Ip);
|
||||
ws.onopen = () => {
|
||||
ws.send(this.Request);
|
||||
};
|
||||
ws.onmessage = response => {
|
||||
ws.close();
|
||||
return resolve(response.data);
|
||||
};
|
||||
ws.onclose = event => {
|
||||
if (event.code > 1000) return reject(event.reason);
|
||||
};
|
||||
ws.onerror = error => {
|
||||
return reject(error);
|
||||
};
|
||||
} catch {
|
||||
return reject(); // Just to be sure
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
export async function GetPositionAsync(): Promise<Coordinates.LatLon> {
|
||||
return new Promise<Coordinates.LatLon>((resolve, reject) => {
|
||||
navigator.geolocation.getCurrentPosition(pos => {
|
||||
resolve(
|
||||
new Coordinates.LatLon(
|
||||
pos.coords.latitude,
|
||||
pos.coords.longitude
|
||||
)
|
||||
);
|
||||
});
|
||||
reject();
|
||||
});
|
||||
}
|
||||
|
||||
export namespace Coordinates {
|
||||
// const utm: UTMLatLng = new UTMLatLng("WGS 84");
|
||||
// const PRECISION: number = 7;
|
||||
|
||||
export class LatLon {
|
||||
constructor(public Lat: number, public Lon: number) {}
|
||||
|
||||
public ToUtm(): Utm {
|
||||
let temp = UTM.fromLatLon(
|
||||
this.Lat,
|
||||
this.Lon
|
||||
);
|
||||
return new Utm(
|
||||
temp.easting,
|
||||
temp.northing,
|
||||
temp.zoneNum,
|
||||
temp.zoneLetter
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class Utm {
|
||||
constructor(
|
||||
public Easting: number,
|
||||
public Northing: number,
|
||||
public ZoneNumber: number,
|
||||
public ZoneLetter: string
|
||||
) {}
|
||||
|
||||
public ToLatLon(): LatLon {
|
||||
let temp = UTM.toLatLon(
|
||||
this.Easting,
|
||||
this.Northing,
|
||||
this.ZoneNumber,
|
||||
this.ZoneLetter
|
||||
);
|
||||
return new LatLon(temp.latitude, temp.longitude);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
import L from "leaflet";
|
||||
import { DEBUG } from "./main";
|
||||
|
||||
export default class Layer {
|
||||
public LeafletLayer: L.LayerGroup = new L.LayerGroup();
|
||||
public Visible: boolean = true;
|
||||
public LayerIds: number[] = [];
|
||||
|
||||
constructor(public Name: string) {
|
||||
if (DEBUG) console.log(`new Layer() with Name = ${this.Name}`);
|
||||
}
|
||||
}
|
||||
Executable
+33
@@ -0,0 +1,33 @@
|
||||
import L from "leaflet";
|
||||
import { DEBUG } from "./main";
|
||||
|
||||
export default class Location extends L.ImageOverlay {
|
||||
public Name: string;
|
||||
|
||||
constructor(Raw: {
|
||||
img: string;
|
||||
name: string;
|
||||
bounds: {
|
||||
min: {
|
||||
lat: number;
|
||||
lon: number;
|
||||
};
|
||||
max: {
|
||||
lat: number;
|
||||
lon: number;
|
||||
};
|
||||
};
|
||||
}) {
|
||||
super(
|
||||
`map/${Raw.img}`,
|
||||
new L.LatLngBounds([
|
||||
[Raw.bounds.min.lat, Raw.bounds.min.lon],
|
||||
[Raw.bounds.max.lat, Raw.bounds.max.lon]
|
||||
])
|
||||
);
|
||||
|
||||
this.Name = Raw.name;
|
||||
|
||||
if (DEBUG) console.log(`new Location() with Name = ${this.Name}`);
|
||||
}
|
||||
}
|
||||
Executable
+174
@@ -0,0 +1,174 @@
|
||||
import L from "leaflet";
|
||||
import Building from "./Building";
|
||||
import { Helpers, _, MOBILE, $ } from "./Helpers";
|
||||
import { Functions } from "./Functions";
|
||||
import { DEBUG } from "./main";
|
||||
import angular from "angular";
|
||||
|
||||
export default class MountingPoint extends L.Marker {
|
||||
public Name: string = "";
|
||||
public Id: number = -1;
|
||||
public SupportedAssets: number[] = [];
|
||||
public Level: number = -1;
|
||||
public MountedAsset: number = -1;
|
||||
|
||||
private constructor() {
|
||||
super(new L.LatLng(0, 0));
|
||||
throw new Error("Use static method MountingPoint.Create() instead.");
|
||||
// Don't use this.
|
||||
// This is just here so you can't use the constructor from
|
||||
// outside the class
|
||||
}
|
||||
|
||||
/**
|
||||
* MountingPoint factory method
|
||||
*/
|
||||
public static async Create(
|
||||
Raw: {
|
||||
id: number;
|
||||
designation: string;
|
||||
tag: string;
|
||||
objectId: number;
|
||||
levelId: number;
|
||||
roomId: number;
|
||||
assetId: number;
|
||||
position3d: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
supportedAssetTypeIds: number[];
|
||||
},
|
||||
Building: Building
|
||||
): Promise<MountingPoint> {
|
||||
return new Promise<MountingPoint>(async resolve => {
|
||||
// Wrong building?
|
||||
if (Building.Id != Raw.objectId) throw new Error("Wrong building");
|
||||
|
||||
let rotatedRelativePosition = Helpers.Calculations.RotatePoint(
|
||||
{
|
||||
x: Raw.position3d.x,
|
||||
y: Raw.position3d.y
|
||||
},
|
||||
Helpers.Calculations.DegToRad(Building.RotationDegree)
|
||||
); // Rotate mp position around building rotation degree
|
||||
|
||||
let temp = Object.create(Building.RefPoint);
|
||||
temp.Easting += rotatedRelativePosition.x;
|
||||
temp.Northing += rotatedRelativePosition.y;
|
||||
let position = temp.ToLatLon();
|
||||
// Add building ref point to mp relative position
|
||||
|
||||
let mounted = Raw.assetId != -1;
|
||||
|
||||
let mp = new L.Marker(new L.LatLng(position.Lat, position.Lon), {
|
||||
icon: new L.Icon({
|
||||
iconUrl: mounted
|
||||
? "img/marker_mounted.png"
|
||||
: "img/marker_default.png",
|
||||
iconSize: [30, 30]
|
||||
})
|
||||
}) as MountingPoint; // Setup Leaflet marker
|
||||
|
||||
mp.Name = _(Raw.tag) ? Raw.designation : Raw.tag;
|
||||
mp.SupportedAssets = Raw.supportedAssetTypeIds || [];
|
||||
mp.Id = Raw.id;
|
||||
mp.Level = Raw.levelId;
|
||||
mp.MountedAsset = Raw.assetId;
|
||||
|
||||
let popup = document.createElement("iframe") as HTMLIFrameElement;
|
||||
popup.src = `./popup.html?mpid=${mp.Id}&wsip=${Functions.WebSocketIp}`;
|
||||
popup.style.width = "100%";
|
||||
popup.style.height = "100%"
|
||||
popup.style.top = "0";
|
||||
popup.style.left = "0";
|
||||
popup.style.border = "none";
|
||||
mp.bindPopup(popup, {className: "mp-popup"});
|
||||
|
||||
if (DEBUG) console.log(`new MountingPoint() with ID = ${mp.Id}`);
|
||||
|
||||
return resolve(mp);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function _moreInfo(info: string) {
|
||||
let popup = open("", Helpers.GenUuid()) as Window;
|
||||
|
||||
// <pre>
|
||||
let display = popup.document.createElement("pre") as HTMLPreElement;
|
||||
display.innerHTML = unescape(info);
|
||||
display.style.fontSize = "15";
|
||||
|
||||
// <button>
|
||||
let finish = popup.document.createElement("button") as HTMLButtonElement;
|
||||
finish.innerHTML = "Done";
|
||||
finish.setAttribute("onclick", "window.close()");
|
||||
|
||||
// build popup
|
||||
popup.document.body.appendChild(popup.document.createElement(
|
||||
"hr"
|
||||
) as HTMLHRElement);
|
||||
popup.document.body.appendChild(display);
|
||||
popup.document.body.appendChild(popup.document.createElement(
|
||||
"hr"
|
||||
) as HTMLHRElement);
|
||||
popup.document.body.appendChild(finish);
|
||||
}
|
||||
|
||||
function _mount(mountingPointId: number): void {
|
||||
let select = ($(`#mp-asset-select-${mountingPointId}`) as HTMLSelectElement);
|
||||
let assetId = select.value;
|
||||
|
||||
let mounted = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.MountedAsset == +assetId));
|
||||
if (!_(mounted)) mounted?.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_remounted.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
|
||||
Functions.MountAsset(assetId, mountingPointId);
|
||||
select.disabled = true;
|
||||
let button = ($(`#mp-asset-button-${mountingPointId}`) as HTMLButtonElement);
|
||||
button.innerText = "Unmount";
|
||||
button.onclick = () => window.MP.Unmount(mountingPointId);
|
||||
|
||||
let mp = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.Id == mountingPointId) as MountingPoint);
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_mounted.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
mp.MountedAsset = +assetId;
|
||||
}
|
||||
|
||||
function _unmount(mountingPointId: number): void {
|
||||
Functions.UnmountAsset(mountingPointId);
|
||||
let select = ($(`#mp-asset-select-${mountingPointId}`) as HTMLSelectElement);
|
||||
select.disabled = false;
|
||||
let button = ($(`#mp-asset-button-${mountingPointId}`) as HTMLButtonElement);
|
||||
button.innerText = "Mount";
|
||||
button.onclick = () => window.MP.Mount(mountingPointId);
|
||||
let mp = ((Helpers.GetScope().objects.mountingPoints as MountingPoint[]).find(mp => mp.Id == mountingPointId) as MountingPoint);
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl:"img/marker_default.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
mp.MountedAsset = -1;
|
||||
}
|
||||
|
||||
//#region
|
||||
declare global {
|
||||
interface Window {
|
||||
MP: {
|
||||
MoreInfo: (info: string) => void,
|
||||
Mount: (id: number) => void,
|
||||
Unmount: (id: number) => void
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
window.MP = window.MP || {
|
||||
MoreInfo: _moreInfo,
|
||||
Mount: _mount,
|
||||
Unmount: _unmount
|
||||
};
|
||||
//#endregion
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
import L, { LatLng } from "leaflet";
|
||||
|
||||
export default class Tracking
|
||||
{
|
||||
map: L.Map;
|
||||
popup = L.popup();
|
||||
msg: string;
|
||||
participant: L.Marker;
|
||||
popupLocation: L.LatLng;
|
||||
popupContent: HTMLElement;
|
||||
|
||||
constructor(input: L.Map, obj: string, marker: L.Marker){
|
||||
this.map = input;
|
||||
var viewPos = new L.LatLng(53.0528064472226, 8.89412999153137);
|
||||
this.msg = obj;
|
||||
this.participant = marker;
|
||||
var runIcon = new L.Icon({
|
||||
iconUrl: 'img/marker-run.png',
|
||||
shadowUrl: 'img/marker-shadow.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, 50],
|
||||
shadowSize: [0, 0]
|
||||
});
|
||||
var participant = new L.Marker(viewPos, {icon: runIcon}).on('click', this.onMarkerClick);
|
||||
this.popupLocation = new LatLng(0,0);
|
||||
this.popupContent = new HTMLElement();
|
||||
participant.addTo(this.map);
|
||||
}
|
||||
|
||||
onMarkerClick()
|
||||
{
|
||||
this.popup
|
||||
.setLatLng(this.popupLocation)
|
||||
.setContent(this.popupContent)
|
||||
.openOn(this.map);
|
||||
}
|
||||
|
||||
start()
|
||||
{
|
||||
console.log('<p class="message">Received: '+this.msg);
|
||||
|
||||
var newjobj = JSON.parse(this.msg);
|
||||
console.log(newjobj);
|
||||
if(newjobj.data.header.equipmentNumber == Number((<HTMLInputElement>document.getElementById("equipmentNumber")).value)){
|
||||
var jsonConv = '{"1": "NaN", "lat": ' + newjobj.data.geoPosition.lat/(Math.PI/180) + ', "lng": ' + newjobj.data.geoPosition.lon/(Math.PI/180) + '}';
|
||||
var convlatlng = JSON.parse(jsonConv);
|
||||
|
||||
this.participant.setLatLng( [convlatlng.lat, convlatlng.lng]);
|
||||
var markerlatlng = convlatlng
|
||||
markerlatlng.lat= convlatlng.lat+0.00002;
|
||||
this.popupLocation = markerlatlng;
|
||||
this.popupContent = document.createElement("<center>EquipmentNr: " + newjobj.data.header.equipmentNumber + "<br>"
|
||||
+ "BuildingID: " + newjobj.data.opsPosition.moutObjectId + "<br>"
|
||||
+ "RoomID: " + newjobj.data.opsPosition.moutRoomId + "</center>");
|
||||
this.popup
|
||||
.setLatLng(this.popupLocation)
|
||||
.setContent(this.popupContent)
|
||||
.openOn(this.map);
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+92
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* This is only used in the mobile app
|
||||
*/
|
||||
|
||||
import { Helpers, $ } from "./Helpers";
|
||||
import MountingPoint from "./MountingPoint";
|
||||
import { DEBUG } from "./main";
|
||||
declare var AR: any; // Wikitude is loaded from html
|
||||
|
||||
var currentPoi: any = undefined;
|
||||
|
||||
function _startAr(mpId: number): void {
|
||||
let $scope = Helpers.GetScope();
|
||||
let mountingPoint: MountingPoint | undefined = undefined;
|
||||
|
||||
for (let mp of $scope.objects.mountingPoints as MountingPoint[]) {
|
||||
if (mp.Id == mpId) {
|
||||
mountingPoint = mp;
|
||||
break;
|
||||
}
|
||||
} // Get correct mounting point
|
||||
|
||||
mountingPoint = mountingPoint as MountingPoint; // Bruh.
|
||||
|
||||
currentPoi = new AR.GeoObject(
|
||||
[
|
||||
new AR.GeoLocation(
|
||||
mountingPoint.getLatLng().lat,
|
||||
mountingPoint.getLatLng().lng
|
||||
)
|
||||
],
|
||||
{
|
||||
drawables: {
|
||||
cam: [
|
||||
new AR.ImageDrawable(
|
||||
new AR.ImageResource("img/armarker.png"),
|
||||
2.5,
|
||||
{ zOrder: 0, opacity: 1 }
|
||||
),
|
||||
new AR.Label(mountingPoint.Name, 1, {
|
||||
zOrder: 1,
|
||||
style: { textColor: "#ffffff" }
|
||||
})
|
||||
],
|
||||
indicator: new AR.ImageDrawable(
|
||||
new AR.ImageResource("img/arindicator.png"),
|
||||
0.1,
|
||||
{
|
||||
enabled: true,
|
||||
verticalAnchor: AR.CONST.VERTICAL_ANCHOR.TOP
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
); // Create AR marker
|
||||
|
||||
$scope.ar.current = mountingPoint.Name;
|
||||
$scope.ar.enabled = true;
|
||||
$scope.$apply();
|
||||
($("body") as HTMLBodyElement).style.backgroundColor = "transparent";
|
||||
}
|
||||
|
||||
function _endAr(): void {
|
||||
let $scope = Helpers.GetScope();
|
||||
|
||||
$scope.ar.current = "";
|
||||
$scope.ar.enabled = false;
|
||||
|
||||
currentPoi.destroy();
|
||||
currentPoi = undefined;
|
||||
|
||||
$scope.$apply();
|
||||
($("body") as HTMLBodyElement).style.backgroundColor = "white";
|
||||
}
|
||||
|
||||
//#region
|
||||
declare global {
|
||||
interface Window {
|
||||
AR: {
|
||||
StartAr: (mpId: number) => void;
|
||||
EndAr: () => void;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
window.AR = window.AR || {
|
||||
StartAr: _startAr,
|
||||
EndAr: _endAr
|
||||
};
|
||||
//#endregion
|
||||
|
||||
if (DEBUG) AR.logger.activateDebugMode();
|
||||
Executable
+724
@@ -0,0 +1,724 @@
|
||||
import angular from "angular";
|
||||
import L, { CircleMarker } from "leaflet";
|
||||
import GeoJSON from "geojson";
|
||||
import * as UTM from "utm";
|
||||
import * as MGRS from "mgrs";
|
||||
import { _, Helpers, $ } from "./Helpers";
|
||||
import { Functions } from "./Functions";
|
||||
import Building from "./Building";
|
||||
import Layer from "./Layer";
|
||||
import Asset from "./Asset";
|
||||
import MountingPoint from "./MountingPoint";
|
||||
import Location from "./Location";
|
||||
//import Tracking from "./Tracking";
|
||||
|
||||
export const DEBUG: boolean = false; // Debug mode
|
||||
//var markerLayer: L.LayerGroup;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
rawLocations: any[];
|
||||
}
|
||||
}
|
||||
|
||||
const NGAPP: angular.IModule = angular.module("main", []);
|
||||
|
||||
NGAPP.controller("ctrl", async ($scope) => {
|
||||
//#region $scope init
|
||||
$scope.html = {
|
||||
disableInput: true, // Hides everything and displays a loading animation
|
||||
mpQuery: "" // Text input for searching a mounting point
|
||||
};
|
||||
|
||||
$scope.objects = {
|
||||
layers: null, // Layer[]
|
||||
assets: {
|
||||
available: null, // Asset[]
|
||||
selected: null // Asset
|
||||
},
|
||||
mountingPoints: null, // MountingPoint[]
|
||||
locations: null // Location[]
|
||||
};
|
||||
|
||||
$scope.functions = {
|
||||
search: null, // function(): (function(mountingPoint: MountingPoint): boolean)
|
||||
updateView: null, // function(): void
|
||||
openPopup: null // function(mountingPoint: MountingPoint): void
|
||||
};
|
||||
|
||||
$scope.ar = {
|
||||
enabled: false, // AR mode enabled when true
|
||||
current: "" // Name of mounting point currently shown in ar
|
||||
};
|
||||
//#endregion
|
||||
|
||||
//#region Map
|
||||
const defaultView: L.LatLngBounds = new L.LatLngBounds([
|
||||
[53.0528064472226, 8.89412999153137],
|
||||
[53.056520842139, 8.90030980110168]
|
||||
]); // Default view centered on Bremen
|
||||
|
||||
const map = new L.Map("map", { attributionControl: false }).fitBounds(
|
||||
defaultView
|
||||
); // Create the map
|
||||
//var markerLayer = L.layerGroup().addTo(map);
|
||||
//#endregion
|
||||
|
||||
const data = await Functions.GetData();
|
||||
|
||||
console.log("Received data.");
|
||||
|
||||
var t0 = performance.now(); // Time measurement
|
||||
|
||||
function loadLocations(): Promise<void> { // Loads the map overlays from map/overlays.js in disgusting fashoin because browsers dont like CORS requests
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
var locationLoader = document.createElement("script");
|
||||
locationLoader.onload = () => {
|
||||
resolve();
|
||||
};
|
||||
locationLoader.src = "map/overlays.js";
|
||||
document.head.appendChild(locationLoader);
|
||||
} catch {
|
||||
reject();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
await loadLocations();
|
||||
var locations: Location[] = window.rawLocations.map((raw: any) => new Location(raw));
|
||||
$scope.objects.locations = locations.filter(l => l.Name != null).sort((a, b) => a.Name.localeCompare(b.Name));
|
||||
for (let location of locations) location.addTo(map); // Add overlays to map
|
||||
map.fitBounds(locations[0].getBounds()); // Center on the first overlay
|
||||
} catch (e) {
|
||||
if (DEBUG) console.error(`Could not load map overlays:\n${JSON.stringify(e)}`);
|
||||
}
|
||||
|
||||
//#region Buildings
|
||||
let buildings = (data.objects as any[]).map(raw => new Building(raw));
|
||||
|
||||
let leafletFootprints = new L.GeoJSON(
|
||||
{
|
||||
type: "FeatureCollection",
|
||||
features: buildings
|
||||
.map(building => building.Footprint)
|
||||
.filter(footprint => footprint != null)
|
||||
} as GeoJSON.FeatureCollection,
|
||||
{
|
||||
onEachFeature: (feature, layer) => {
|
||||
layer.bindPopup(`<h2>${feature.properties.name}</h2>`);
|
||||
}
|
||||
}
|
||||
).addTo(map);
|
||||
//#endregion
|
||||
|
||||
// TEST
|
||||
new L.GeoJSON(JSON.parse("{\"type\":\"FeatureCollection\",\"features\":[\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3708362,25.4564295],[51.370907,25.4556692],[51.3712691,25.4549728],[51.3713635,25.4540774],[51.3715996,25.4534805],[51.3720954,25.4533668],[51.3727959,25.4535445],[51.373331,25.4536795],[51.3728667,25.4579929],[51.3719223,25.457801],[51.3708362,25.4564295]]},\"properties\":{\"landuse\":\"farmland\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3561526,25.4613161],[51.3560137,25.4614027],[51.3559604,25.4614421]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"paved\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3559238,25.4609743],[51.3559784,25.4609225],[51.3560485,25.4608893],[51.3561277,25.4608781],[51.3562163,25.4608942],[51.3562923,25.4609383],[51.3563453,25.4610044],[51.3563622,25.4610487],[51.3563683,25.4610953],[51.3563577,25.461162],[51.3563252,25.4612227],[51.3562738,25.4612716],[51.3562084,25.4613042],[51.3561526,25.4613161],[51.3560736,25.4613125],[51.3560001,25.4612863],[51.3559397,25.4612401],[51.3558989,25.4611789],[51.3558821,25.4611097],[51.3558906,25.4610391],[51.3559238,25.4609743]]},\"properties\":{\"highway\":\"secondary\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.361919,25.4527232],[51.361972,25.4526678],[51.3620402,25.4526281],[51.362118,25.4526074],[51.3621991,25.4526073],[51.3622769,25.4526278],[51.3623452,25.4526673],[51.3623984,25.4527226],[51.3624322,25.4527892],[51.3624374,25.4528216],[51.3624439,25.4528617],[51.3624324,25.4529342],[51.3623988,25.4530008],[51.3623458,25.4530563],[51.3622776,25.4530959],[51.3621998,25.4531167],[51.3621187,25.4531168],[51.3620408,25.4530962],[51.3619725,25.4530567],[51.3619194,25.4530014],[51.3618856,25.4529348],[51.3618739,25.4528623],[51.3618854,25.4527898],[51.361919,25.4527232]]},\"properties\":{\"highway\":\"secondary\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3621998,25.4531167],[51.3620331,25.4532021],[51.3619436,25.4532799],[51.3595372,25.4565367],[51.3590213,25.457236],[51.3564171,25.4607991],[51.3563712,25.4609194],[51.3563453,25.4610044]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"paved\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3561277,25.4608781],[51.3561928,25.4608187],[51.3594409,25.4564154],[51.3618055,25.4531974],[51.3618422,25.4530923],[51.3618856,25.4529348]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"paved\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3625172,25.4524822],[51.3624546,25.452621],[51.3624322,25.4527892]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"asphalt\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3620402,25.4526281],[51.3621609,25.4525617],[51.3622359,25.4525229],[51.3623111,25.4524696],[51.3623768,25.4524176],[51.3626082,25.4521117]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"asphalt\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3558103,25.4613431],[51.3558989,25.4611789]]},\"properties\":{\"lanes\":\"2\",\"oneway\":\"yes\",\"source\":\"Bing\",\"highway\":\"secondary\",\"surface\":\"paved\",\"maxspeed\":\"80\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3622417,25.4513747],[51.3620032,25.4521647],[51.3618883,25.4524545]]},\"properties\":{\"highway\":\"unclassified\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3554808,25.4547014],[51.3555881,25.4545173],[51.3558188,25.4541347],[51.3561085,25.4538949],[51.3564116,25.4536987],[51.3566315,25.4535631],[51.3576534,25.4531296],[51.3585708,25.4526864],[51.3592494,25.4523861],[51.3599333,25.4521512],[51.3600916,25.4520373],[51.3602123,25.4518896],[51.3603812,25.4518678],[51.3606092,25.451955],[51.3608372,25.452093],[51.3610035,25.4521705],[51.3613093,25.4523062],[51.3615292,25.4523764],[51.3617974,25.4524394],[51.3618883,25.4524545],[51.3620013,25.4524733],[51.3621408,25.4524297],[51.3622534,25.4523425],[51.3623634,25.4522069],[51.3624492,25.4520979],[51.3625243,25.4520712],[51.3626082,25.4521117]]},\"properties\":{\"highway\":\"unclassified\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3554687,25.4607021],[51.3556715,25.4608089],[51.3558202,25.460876],[51.3559249,25.4608883],[51.3560485,25.4608893]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"unclassified\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3558906,25.4610391],[51.3557323,25.4609279],[51.3554721,25.4607784]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"unclassified\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3595679,25.4570575],[51.3597591,25.4571769]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3595679,25.4570575],[51.3594665,25.4570422],[51.3594141,25.4570391],[51.3593533,25.4570376],[51.3592942,25.4570514],[51.3592131,25.457088],[51.3591539,25.4571261],[51.3591117,25.457178],[51.3590796,25.45721],[51.3590213,25.457236]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3595372,25.4565367],[51.3595003,25.4566394],[51.3594631,25.4567249],[51.359453,25.456792],[51.3594597,25.4568698],[51.3594885,25.4569476],[51.3595679,25.4570575]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3649666,25.459208],[51.3648188,25.4591195],[51.3640974,25.4586876],[51.3640639,25.4586513],[51.3640653,25.4586089],[51.3640988,25.4585569],[51.3641377,25.4585242],[51.3641967,25.4585181],[51.3643093,25.4585799],[51.3649061,25.458948],[51.3649182,25.458971],[51.3649155,25.4589976],[51.3648188,25.4591195]]},\"properties\":{\"highway\":\"service\",\"service\":\"parking_aisle\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3652883,25.4568522],[51.3652588,25.4568277],[51.3649454,25.4566377],[51.3640425,25.4560903],[51.3640347,25.4560813],[51.3639942,25.4560346],[51.3639419,25.4559426],[51.3639097,25.4558978],[51.3638735,25.4558614],[51.3636368,25.4557101],[51.3635689,25.4556672],[51.3635429,25.4556507],[51.3633531,25.4555296],[51.36327,25.4554764],[51.3632029,25.4554376],[51.3631372,25.4554194],[51.3630621,25.4554279],[51.3630071,25.4554582],[51.362985,25.4554994],[51.362829,25.4557074],[51.3623667,25.456324],[51.3618873,25.4570021],[51.3618685,25.4570566],[51.3618685,25.4571292],[51.3618632,25.4574567],[51.3618605,25.4575547],[51.3618618,25.4582832],[51.3618605,25.4583292],[51.3618726,25.4583668],[51.3618994,25.4584043],[51.3619356,25.4584297],[51.3623785,25.4587005],[51.3634685,25.4593669],[51.3643536,25.4599034],[51.3643952,25.459913],[51.364426,25.4599106],[51.3644595,25.4598937],[51.3649666,25.459208],[51.3652925,25.4587673],[51.3653353,25.4587094]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3654077,25.4587482],[51.365364,25.458807],[51.3645199,25.4599421],[51.3644904,25.4599687],[51.3644287,25.4599845],[51.3643858,25.4599881],[51.3643375,25.4599784],[51.3623275,25.4587653],[51.3618699,25.4584891],[51.3618122,25.4584358],[51.3617827,25.4583873],[51.3617639,25.4583135],[51.3617693,25.4582009],[51.3617773,25.4575547],[51.36178,25.4574567],[51.3617869,25.4571886],[51.3617907,25.4570372],[51.3618097,25.45698],[51.3618135,25.4569682],[51.3618605,25.4569004],[51.361899,25.4568493],[51.3622609,25.4563693],[51.362358,25.4562404],[51.3627811,25.4556761],[51.3629763,25.4554158],[51.3630138,25.4553952],[51.3630648,25.4553734],[51.3631345,25.4553601],[51.3631949,25.4553637],[51.3632673,25.4553892],[51.3633598,25.4554437],[51.3636146,25.4556047],[51.3636831,25.4556475],[51.3639446,25.4557985],[51.3639794,25.455836],[51.3640143,25.455905],[51.3640706,25.4560031],[51.3641068,25.4560418],[51.3653098,25.4567738],[51.3653351,25.4567862]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3627847,25.4575763],[51.3627429,25.4575543],[51.3622025,25.4575545],[51.3618605,25.4575547],[51.3617773,25.4575547],[51.3602659,25.4575555],[51.3601555,25.4575683]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3628351,25.4576526],[51.3627981,25.4576073],[51.3627847,25.4575763],[51.3627754,25.4575549],[51.3627684,25.457499],[51.3627778,25.4574434],[51.3628027,25.4573918],[51.3628416,25.4573478],[51.3628918,25.4573145],[51.3629498,25.4572939],[51.3629713,25.4572918],[51.3630117,25.4572877],[51.3630733,25.4572961],[51.3631304,25.4573186],[51.3631791,25.4573537],[51.3632161,25.457399],[51.3632388,25.4574514],[51.3632457,25.4575073],[51.3632364,25.457563],[51.3632115,25.4576145],[51.3631726,25.4576585],[51.3631224,25.4576918],[51.3630644,25.4577124],[51.3630025,25.4577186],[51.3629409,25.4577102],[51.3628838,25.4576877],[51.3628351,25.4576526]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3602636,25.4574075],[51.3603169,25.4574392],[51.3603799,25.4574598],[51.3604912,25.4574659],[51.3611068,25.4574562],[51.36178,25.4574567],[51.3618632,25.4574567],[51.3623272,25.4574571],[51.3627268,25.4574574],[51.3627778,25.4574434]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3604912,25.456967],[51.360341,25.4571486],[51.3602632,25.4572491],[51.3602486,25.4573108]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.360117,25.4572413],[51.3601948,25.4572128],[51.3603021,25.4571389],[51.3604912,25.456967]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3598408,25.4578303],[51.359881,25.4577371],[51.3599226,25.457639],[51.3599521,25.4575664]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3600647,25.4576051],[51.3599829,25.4576741],[51.3599145,25.457748],[51.3598408,25.4578303]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3597591,25.4571769],[51.3598207,25.4572007],[51.3598971,25.457231],[51.3599615,25.4572503],[51.3600387,25.4572553]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3599038,25.4574622],[51.3598797,25.4573775],[51.3598408,25.4572951],[51.3598005,25.4572237],[51.3597591,25.4571769]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3599038,25.4574622],[51.3599119,25.4574065],[51.3599467,25.4573339],[51.3600057,25.457283],[51.3600387,25.4572553],[51.3600807,25.4572412],[51.360117,25.4572413],[51.3601465,25.4572413],[51.3602056,25.4572652],[51.3602391,25.4572951],[51.3602486,25.4573108],[51.3602592,25.457328],[51.3602699,25.4573823],[51.3602636,25.4574075],[51.3602498,25.4574622],[51.3601962,25.4575397],[51.3601555,25.4575683],[51.3601291,25.457587],[51.3600647,25.4576051],[51.3600031,25.457593],[51.3599521,25.4575664],[51.3599199,25.4575204],[51.3599038,25.4574622]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3661869,25.4586864],[51.3661467,25.458707],[51.3660943,25.458753],[51.3659307,25.4589843],[51.3658972,25.4590109],[51.3658516,25.4590194],[51.365802,25.4590231],[51.3657443,25.4590182],[51.365692,25.4589976],[51.365364,25.458807],[51.3652925,25.4587673],[51.3649973,25.4585762],[51.3649419,25.458555]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3649927,25.4584886],[51.3650429,25.458523],[51.3653353,25.4587094],[51.3654077,25.4587482],[51.3657644,25.4589613],[51.3658033,25.4589686],[51.3658369,25.4589637],[51.365861,25.4589468],[51.3660394,25.4586998],[51.3660689,25.4586743],[51.3661051,25.458661],[51.366148,25.4586598],[51.3661869,25.4586864]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3649544,25.4582856],[51.3649666,25.4583959]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3648853,25.4583616],[51.3649155,25.4583389],[51.3649303,25.4583171],[51.3649544,25.4582856]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3649864,25.4585121],[51.3649593,25.4585454],[51.3649419,25.458555],[51.3649202,25.4585668],[51.364875,25.4585731],[51.3648305,25.4585633],[51.3647936,25.4585389],[51.3647699,25.4585035],[51.364763,25.4584627],[51.3647739,25.4584226],[51.3648009,25.4583893],[51.36484,25.4583679],[51.3648853,25.4583616],[51.3649297,25.4583714],[51.3649666,25.4583959],[51.3649903,25.4584312],[51.3649972,25.458472],[51.3649927,25.4584886],[51.3649864,25.4585121]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3649638,25.4572497],[51.3649454,25.4566377]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3652568,25.457013],[51.3651522,25.4570572],[51.3650939,25.4570832],[51.3650483,25.4571202],[51.3649967,25.4571752],[51.3649705,25.4572225],[51.3649638,25.4572497],[51.3649584,25.4573072],[51.3649544,25.4582856]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3653749,25.4569783],[51.3652568,25.457013]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3652568,25.457013],[51.3652749,25.4569936],[51.365289,25.4569718],[51.3652964,25.4569518],[51.3652957,25.4569367],[51.3652975,25.4569227]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3653653,25.4567723],[51.3653986,25.4567667],[51.3654323,25.4567698],[51.3654637,25.4567813],[51.3654902,25.4568003],[51.3655097,25.4568253],[51.3655206,25.4568543],[51.365522,25.4568849],[51.3655138,25.4569145],[51.3654967,25.4569409],[51.3654721,25.4569619],[51.3654419,25.4569758],[51.3654086,25.4569814],[51.3653749,25.4569783],[51.3653435,25.4569668],[51.365317,25.4569477],[51.3652975,25.4569227],[51.3652866,25.4568938],[51.3652852,25.4568632],[51.3652883,25.4568522],[51.3652934,25.4568335],[51.3653105,25.4568071],[51.3653351,25.4567862],[51.3653653,25.4567723]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3635689,25.4556672],[51.3636146,25.4556047],[51.3642034,25.4548007],[51.3642503,25.4547486],[51.3643,25.4547183],[51.3643804,25.4547038],[51.3644662,25.4547038],[51.3645896,25.4547498],[51.364609,25.4547608],[51.364705,25.4548152],[51.3667917,25.4560939]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3667508,25.4561545],[51.3647137,25.4548988],[51.3645983,25.4548334],[51.3645296,25.4548077],[51.364475,25.4547873],[51.3643891,25.4547873],[51.3643087,25.4548019],[51.3636831,25.4556475],[51.3636368,25.4557101]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3598408,25.4578303],[51.3595668,25.4583097],[51.3594581,25.458461],[51.3590542,25.4590102],[51.3584949,25.459773],[51.3571435,25.4615853],[51.3570054,25.4617853]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3624374,25.4528216],[51.3624988,25.4529322],[51.3625646,25.4530097],[51.362637,25.4530872],[51.3627483,25.4532083]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3627483,25.4532083],[51.362574,25.4531393],[51.3624774,25.453109],[51.3623976,25.453089],[51.3623399,25.4530854],[51.3622776,25.4530959]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.363223,25.4535026],[51.3631211,25.4534529],[51.3627483,25.4532083]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3604912,25.456967],[51.3607407,25.4566752],[51.361416,25.455761],[51.3631211,25.4534529]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3622749,25.4553841],[51.3620898,25.4556314],[51.362071,25.4556338],[51.3620523,25.4556338],[51.3620402,25.4556398],[51.3620254,25.4556556],[51.3618645,25.4558554],[51.3618135,25.4559232]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.362829,25.4557074],[51.3627811,25.4556761],[51.3622749,25.4553841],[51.3620214,25.4552379]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3686103,25.4568858],[51.3669554,25.4558802],[51.3633934,25.4537157],[51.3633411,25.4536963],[51.3632888,25.4536866],[51.3632351,25.4536878],[51.3631801,25.4537011],[51.3631265,25.4537266],[51.3630903,25.4537641],[51.3620214,25.4552379],[51.3618001,25.455543],[51.3617907,25.4555732],[51.3617827,25.4556604],[51.3617907,25.4557997],[51.3618149,25.4558251],[51.3618645,25.4558554]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3645296,25.4548077],[51.364609,25.4547608],[51.3646848,25.4547086],[51.3647452,25.4546977],[51.3647948,25.4547183],[51.3655727,25.4552003],[51.3668682,25.4559825]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3669219,25.4591202],[51.3668143,25.4592625]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3662312,25.4589082],[51.3668143,25.4592625],[51.366906,25.4593182]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3668177,25.4594394],[51.366207,25.4590872],[51.3661775,25.459063],[51.3661721,25.4590025],[51.3661963,25.4589565],[51.3662312,25.4589082],[51.3663304,25.4587711]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3623785,25.4587005],[51.3623275,25.4587653],[51.3619959,25.459235],[51.3619892,25.4592616],[51.362,25.4592943],[51.3620228,25.459319700000003],[51.3653085,25.4613164],[51.3653406,25.4613219],[51.3653842,25.4613213],[51.3654285,25.4613098],[51.3654567,25.4612934],[51.3654949,25.4612547],[51.3668177,25.4594394],[51.366906,25.4593182],[51.3670117,25.4591732],[51.3686062,25.4570142],[51.3686196,25.4569767],[51.368621,25.4569246],[51.3686183,25.4568992],[51.3686103,25.4568858]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3661869,25.4586864],[51.3663304,25.4587711],[51.3669219,25.4591202],[51.3670117,25.4591732]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3612074,25.4569755],[51.361312,25.4569803],[51.3613737,25.4569791],[51.3614045,25.4569694],[51.3614273,25.4569403],[51.3615208,25.4568028]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3613079,25.4572975],[51.3613079,25.4571886],[51.361312,25.4569803]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3617869,25.4571886],[51.3613079,25.4571886]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3610721,25.4565276],[51.3615208,25.4568028],[51.3618097,25.45698]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.361899,25.4568493],[51.3611746,25.4563878]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3617358,25.4559086],[51.3616955,25.4559958],[51.3616714,25.4560067],[51.3616325,25.4560079],[51.3615923,25.4559922],[51.3615547,25.455970400000003],[51.3615319,25.4559631],[51.3615078,25.4559619],[51.3614903,25.4559668],[51.3614742,25.4559789],[51.3611746,25.4563878],[51.3610721,25.4565276],[51.3606401,25.4571171],[51.360624,25.4571583],[51.3606159,25.4571946],[51.3606159,25.4573181]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3622609,25.4563693],[51.3616955,25.4559958]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.361416,25.455761],[51.3616218,25.4558723],[51.3616633,25.4558953],[51.3617022,25.4559074],[51.3617358,25.4559086],[51.3617693,25.4559086],[51.3617881,25.4559111],[51.3618135,25.4559232],[51.362358,25.4562404]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3622025,25.4575545],[51.3622078,25.4579587]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3629675,25.4568882],[51.3624318,25.4568858],[51.3623956,25.4568967],[51.362358,25.4569246],[51.3623352,25.4569597],[51.3623245,25.4570045],[51.3623272,25.4574571]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3632236,25.4565551],[51.3630018,25.4567309],[51.3629803,25.4567551],[51.3629696,25.4567829],[51.3629669,25.4568289],[51.3629675,25.4568882],[51.3629713,25.4572918]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3632494,25.4563906],[51.363211,25.4563627],[51.3631694,25.4563494],[51.3631265,25.4563518],[51.3630849,25.4563676],[51.3629736,25.4564523],[51.3626558,25.45672],[51.3626128,25.4567393],[51.3625257,25.4567417],[51.362173,25.4567309]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3638111,25.4561417],[51.3636777,25.4563409],[51.3636442,25.4563664],[51.3635999,25.4563809],[51.3635369,25.456393]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3635369,25.456393],[51.3634913,25.4564184],[51.3634537,25.4564487],[51.3634195,25.4564962]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3633707,25.4563959],[51.3634242,25.4563979],[51.3634779,25.4563979],[51.3635369,25.456393]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3631997,25.4565235],[51.3631901,25.4564862],[51.3631961,25.4564483],[51.3632168,25.4564149],[51.3632494,25.4563906],[51.3632897,25.4563785],[51.363332,25.4563803],[51.3633707,25.4563959],[51.3634006,25.456423],[51.3634176,25.456458],[51.3634195,25.4564962],[51.3634059,25.4565325],[51.3633788,25.4565619],[51.3633417,25.4565804],[51.3632997,25.4565856],[51.3632585,25.4565768],[51.3632236,25.4565551],[51.3631997,25.4565235]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3638111,25.4561417],[51.3638332,25.4560891],[51.363905,25.4559662],[51.3639097,25.4559426],[51.3639097,25.4558978]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3640347,25.4560813],[51.3640022,25.4560776],[51.3639566,25.4560788],[51.3639097,25.456086],[51.3638614,25.456106],[51.3638111,25.4561417]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3669554,25.4558802],[51.3668682,25.4559825],[51.3667917,25.4560939],[51.3667508,25.4561545],[51.3666561,25.4562856],[51.3665637,25.4564136],[51.3665664,25.4564439]]},\"properties\":{\"highway\":\"unclassified\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3668019,25.4563732],[51.366692,25.4565343]]},\"properties\":{\"highway\":\"service\",\"service\":\"parking_aisle\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.366958,25.4564669],[51.3668199,25.4566582]]},\"properties\":{\"highway\":\"service\",\"service\":\"parking_aisle\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3665664,25.4564439],[51.3665906,25.4564754],[51.366692,25.4565343],[51.3667823,25.4565868],[51.3668038,25.4566073],[51.3668159,25.456634],[51.3668199,25.4566582],[51.3668159,25.456686],[51.3666335,25.4569282],[51.3666335,25.4569609],[51.3666522,25.4569948],[51.3666764,25.4570215],[51.3667019,25.457036],[51.3667367,25.4570433],[51.366785,25.4570421],[51.3668159,25.4570166],[51.3670881,25.4566303],[51.3670921,25.456611],[51.3670894,25.4565855],[51.3670787,25.4565601],[51.3670506,25.4565298],[51.3670237,25.4565093],[51.366958,25.4564669],[51.3668019,25.4563732],[51.3666561,25.4562856]]},\"properties\":{\"highway\":\"service\",\"service\":\"parking_aisle\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3569613,25.4615948],[51.3570097,25.4616044],[51.3570468,25.4616115],[51.3570928,25.461605],[51.3571435,25.4615853]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3570054,25.4617853],[51.3570075,25.4617112],[51.356999,25.4616654],[51.3569832,25.4616255],[51.3569613,25.4615948]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3565924,25.4613734],[51.3569613,25.4615948]]},\"properties\":{\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3563683,25.4610953],[51.3564172,25.4611796],[51.3564703,25.4612454],[51.3565461,25.461322],[51.3565924,25.4613734]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"LineString\",\"coordinates\":[[51.3565924,25.4613734],[51.3565349,25.4613505],[51.3564285,25.46132],[51.3563423,25.4613093],[51.3562084,25.4613042]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3708362,25.4564295],[51.370907,25.4556692],[51.3712691,25.4549728],[51.3713635,25.4540774],[51.3715996,25.4534805],[51.3720954,25.4533668],[51.3727959,25.4535445],[51.373331,25.4536795],[51.3728667,25.4579929],[51.3719223,25.457801],[51.3708362,25.4564295]]]]},\"properties\":{\"landuse\":\"farmland\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3558821,25.4611097],[51.3558906,25.4610391],[51.3559238,25.4609743],[51.3559784,25.4609225],[51.3560485,25.4608893],[51.3561277,25.4608781],[51.3562163,25.4608942],[51.3562923,25.4609383],[51.3563453,25.4610044],[51.3563622,25.4610487],[51.3563683,25.4610953],[51.3563577,25.461162],[51.3563252,25.4612227],[51.3562738,25.4612716],[51.3562084,25.4613042],[51.3561526,25.4613161],[51.3560736,25.4613125],[51.3560001,25.4612863],[51.3559397,25.4612401],[51.3558989,25.4611789],[51.3558821,25.4611097]]]]},\"properties\":{\"highway\":\"secondary\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3618739,25.4528623],[51.3618854,25.4527898],[51.361919,25.4527232],[51.361972,25.4526678],[51.3620402,25.4526281],[51.362118,25.4526074],[51.3621991,25.4526073],[51.3622769,25.4526278],[51.3623452,25.4526673],[51.3623984,25.4527226],[51.3624322,25.4527892],[51.3624374,25.4528216],[51.3624439,25.4528617],[51.3624324,25.4529342],[51.3623988,25.4530008],[51.3623458,25.4530563],[51.3622776,25.4530959],[51.3621998,25.4531167],[51.3621187,25.4531168],[51.3620408,25.4530962],[51.3619725,25.4530567],[51.3619194,25.4530014],[51.3618856,25.4529348],[51.3618739,25.4528623]]]]},\"properties\":{\"highway\":\"secondary\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3627684,25.457499],[51.3627778,25.4574434],[51.3628027,25.4573918],[51.3628416,25.4573478],[51.3628918,25.4573145],[51.3629498,25.4572939],[51.3629713,25.4572918],[51.3630117,25.4572877],[51.3630733,25.4572961],[51.3631304,25.4573186],[51.3631791,25.4573537],[51.3632161,25.457399],[51.3632388,25.4574514],[51.3632457,25.4575073],[51.3632364,25.457563],[51.3632115,25.4576145],[51.3631726,25.4576585],[51.3631224,25.4576918],[51.3630644,25.4577124],[51.3630025,25.4577186],[51.3629409,25.4577102],[51.3628838,25.4576877],[51.3628351,25.4576526],[51.3627981,25.4576073],[51.3627847,25.4575763],[51.3627754,25.4575549],[51.3627684,25.457499]]]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3599038,25.4574622],[51.3599119,25.4574065],[51.3599467,25.4573339],[51.3600057,25.457283],[51.3600387,25.4572553],[51.3600807,25.4572412],[51.360117,25.4572413],[51.3601465,25.4572413],[51.3602056,25.4572652],[51.3602391,25.4572951],[51.3602486,25.4573108],[51.3602592,25.457328],[51.3602699,25.4573823],[51.3602636,25.4574075],[51.3602498,25.4574622],[51.3601962,25.4575397],[51.3601555,25.4575683],[51.3601291,25.457587],[51.3600647,25.4576051],[51.3600031,25.457593],[51.3599521,25.4575664],[51.3599199,25.4575204],[51.3599038,25.4574622]]]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.364763,25.4584627],[51.3647739,25.4584226],[51.3648009,25.4583893],[51.36484,25.4583679],[51.3648853,25.4583616],[51.3649297,25.4583714],[51.3649666,25.4583959],[51.3649903,25.4584312],[51.3649972,25.458472],[51.3649927,25.4584886],[51.3649864,25.4585121],[51.3649593,25.4585454],[51.3649419,25.458555],[51.3649202,25.4585668],[51.364875,25.4585731],[51.3648305,25.4585633],[51.3647936,25.4585389],[51.3647699,25.4585035],[51.364763,25.4584627]]]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3652852,25.4568632],[51.3652883,25.4568522],[51.3652934,25.4568335],[51.3653105,25.4568071],[51.3653351,25.4567862],[51.3653653,25.4567723],[51.3653986,25.4567667],[51.3654323,25.4567698],[51.3654637,25.4567813],[51.3654902,25.4568003],[51.3655097,25.4568253],[51.3655206,25.4568543],[51.365522,25.4568849],[51.3655138,25.4569145],[51.3654967,25.4569409],[51.3654721,25.4569619],[51.3654419,25.4569758],[51.3654086,25.4569814],[51.3653749,25.4569783],[51.3653435,25.4569668],[51.365317,25.4569477],[51.3652975,25.4569227],[51.3652866,25.4568938],[51.3652852,25.4568632]]]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}},\
|
||||
{\"type\":\"Feature\",\"geometry\":{\"type\":\"MultiPolygon\",\"coordinates\":[[[[51.3631901,25.4564862],[51.3631961,25.4564483],[51.3632168,25.4564149],[51.3632494,25.4563906],[51.3632897,25.4563785],[51.363332,25.4563803],[51.3633707,25.4563959],[51.3634006,25.456423],[51.3634176,25.456458],[51.3634195,25.4564962],[51.3634059,25.4565325],[51.3633788,25.4565619],[51.3633417,25.4565804],[51.3632997,25.4565856],[51.3632585,25.4565768],[51.3632236,25.4565551],[51.3631997,25.4565235],[51.3631901,25.4564862]]]]},\"properties\":{\"oneway\":\"yes\",\"highway\":\"service\",\"junction\":\"roundabout\"}}\
|
||||
]}\
|
||||
")).addTo(map);
|
||||
|
||||
//#region Layers
|
||||
let layers: Layer[] = [];
|
||||
|
||||
for (let level of data.levels) {
|
||||
let add = true;
|
||||
|
||||
for (let layer of layers) {
|
||||
if (layer.Name === level.designation) {
|
||||
// Same level name -> same layer
|
||||
|
||||
add = false;
|
||||
layer.LayerIds.push(level.id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (add) {
|
||||
let temp = new Layer(level.designation);
|
||||
temp.LayerIds.push(level.id);
|
||||
layers.push(temp);
|
||||
}
|
||||
}
|
||||
|
||||
for (let layer of layers) layer.LeafletLayer.addTo(map);
|
||||
|
||||
let outdoorLayer = new Layer("outdoor");
|
||||
outdoorLayer.LayerIds = [-1];
|
||||
outdoorLayer.LeafletLayer.addTo(map);
|
||||
|
||||
let footprintLayer = new Layer("buildings");
|
||||
footprintLayer.LeafletLayer = leafletFootprints;
|
||||
footprintLayer.LeafletLayer.addTo(map);
|
||||
|
||||
layers.push(outdoorLayer, footprintLayer);
|
||||
|
||||
$scope.objects.layers = layers;
|
||||
//#endregion
|
||||
|
||||
//#region Assets
|
||||
let assets = (data.assetTypes as any[]).map(raw => new Asset(raw));
|
||||
|
||||
$scope.objects.assets.available = assets;
|
||||
$scope.objects.assets.selected = assets[0];
|
||||
//#endregion
|
||||
|
||||
//#region Mounting points
|
||||
let mountingPoints: MountingPoint[] = [];
|
||||
|
||||
for (let mountingPoint of data.mountingPoints) {
|
||||
for (let building of buildings) {
|
||||
if (building.Id == mountingPoint.objectId) {
|
||||
// Find matching building for each mounting point
|
||||
|
||||
let temp = await MountingPoint.Create(mountingPoint, building);
|
||||
|
||||
mountingPoints.push(temp);
|
||||
|
||||
for (let layer of layers) {
|
||||
if (layer.LayerIds.includes(temp.Level)) {
|
||||
// Add mounting point to correct layer
|
||||
layer.LeafletLayer.addLayer(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (let layer of layers) {
|
||||
layer.LeafletLayer.addTo(map);
|
||||
// Add all layers to the map
|
||||
}
|
||||
|
||||
$scope.objects.mountingPoints = mountingPoints;
|
||||
//#endregion
|
||||
|
||||
console.log("Parsed data.");
|
||||
|
||||
//#region Angular functions
|
||||
/** @function */ $scope.functions.search = () => {
|
||||
return (mountingPoint: MountingPoint) => {
|
||||
/* Correct asset type? */
|
||||
let correctAssetType = false;
|
||||
|
||||
for (let id of mountingPoint.SupportedAssets) {
|
||||
if (id == $scope.objects.assets.selected.Id) {
|
||||
correctAssetType = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Correct layer? */
|
||||
let correctLayer = false;
|
||||
|
||||
for (let layer of layers) {
|
||||
if (layer.LayerIds.includes(mountingPoint.Level)) {
|
||||
correctLayer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* ID or Name matches query? */
|
||||
let query = $scope.html.mpQuery;
|
||||
let foundBySearch = _(query)
|
||||
? true
|
||||
: mountingPoint.Name.includes(query) ||
|
||||
mountingPoint.Id.toString().includes(query);
|
||||
|
||||
return correctAssetType && correctLayer && foundBySearch;
|
||||
};
|
||||
};
|
||||
|
||||
/** @function */ $scope.functions.updateView = () => {
|
||||
for (let layer of layers) {
|
||||
if (layer.Name === "buildings") {
|
||||
if (layer.Visible) leafletFootprints.addTo(map);
|
||||
else leafletFootprints.removeFrom(map);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (let mountingPoint of layer.LeafletLayer.getLayers() as MountingPoint[]) {
|
||||
if (
|
||||
layer.Visible &&
|
||||
mountingPoint.SupportedAssets.includes(
|
||||
$scope.objects.assets.selected.Id
|
||||
)
|
||||
)
|
||||
mountingPoint.addTo(map);
|
||||
else mountingPoint.removeFrom(map);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener("message", event => {
|
||||
switch (event.data.type) {
|
||||
case "mount": {
|
||||
let mp = $scope.objects.mountingPoints.find((mp: MountingPoint) => mp.Id == event.data.mpId) as MountingPoint;
|
||||
mp.MountedAsset = event.data.aId;
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl: "img/marker_mounted.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
break;
|
||||
}
|
||||
case "unmount": {
|
||||
let mp = $scope.objects.mountingPoints.find((mp: MountingPoint) => mp.Id == event.data.mpId) as MountingPoint;
|
||||
mp.MountedAsset = -1;
|
||||
mp.setIcon(new L.Icon({
|
||||
iconUrl: "img/marker_default.png",
|
||||
iconSize: [30, 30]
|
||||
}));
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
$scope.$apply();
|
||||
});
|
||||
|
||||
/** @function */ $scope.functions.openPopup = (
|
||||
mountingPoint: MountingPoint
|
||||
) => {
|
||||
mountingPoint.openPopup();
|
||||
map.panTo(mountingPoint.getLatLng());
|
||||
};
|
||||
|
||||
/** @function */ $scope.functions.goToLocation = (
|
||||
bounds: L.LatLngBounds
|
||||
) => {
|
||||
map.fitBounds(bounds);
|
||||
};
|
||||
|
||||
$scope.tracking = {};
|
||||
|
||||
$scope.tracking.isTracking = false;
|
||||
$scope.tracking.sockets = [];
|
||||
$scope.tracking.marker = null;
|
||||
|
||||
$scope.tracking.equipmentNumber = null;
|
||||
$scope.tracking.tracked = false;
|
||||
$scope.tracking.msg = "";
|
||||
|
||||
/** @function */ $scope.tracking.startTracking = async () => {
|
||||
let wsPos: any = Functions.WebSocketIp?.split(':');
|
||||
wsPos = wsPos[0] + ':' + wsPos[1];
|
||||
$scope.tracking.ports = JSON.parse(await (new Helpers.WebSocketRequest(wsPos + ":7300", JSON.stringify({
|
||||
type: "servicePortsInformationRequest",
|
||||
uuid: Helpers.GenUuid()
|
||||
})).GetResponseAsync())).data.map((e: any) => e.services.find((s: any) => s.name === "ParticipantManagement").ports.find((p: any) => p.typeId == 2).number);
|
||||
// typeId == 2 -> WebSocketPositionsServer
|
||||
|
||||
const onDisconnect = (msg: string) => {
|
||||
$scope.tracking.msg = msg;
|
||||
$scope.tracking.stopTracking();
|
||||
};
|
||||
try {
|
||||
const onOpen = () => {
|
||||
$scope.tracking.tracked = false;
|
||||
$scope.tracking.isTracking = true;
|
||||
$scope.tracking.msg = ""
|
||||
try { $scope.$apply(); } catch {}
|
||||
};
|
||||
const onMessage = (response: MessageEvent) => {
|
||||
if (!$scope.tracking.tracked) {
|
||||
for (let socket of ($scope.tracking.sockets as WebSocket[])) {
|
||||
if (!socket.url.startsWith(response.origin)) {
|
||||
socket.onclose = null;
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let msg = JSON.parse(response.data);
|
||||
if (msg.equipmentNumber != $scope.tracking.equipmentNumber) return;
|
||||
if (!$scope.tracking.tracked) $scope.tracking.marker = new L.Marker(new L.LatLng(0, 0), {icon: new L.Icon({iconUrl: "img/position.png", iconSize: [30,30]})}).addTo(map);
|
||||
let lat = Helpers.Calculations.RadToDeg(msg.lat);
|
||||
let lon = Helpers.Calculations.RadToDeg(msg.lon);
|
||||
($scope.tracking.marker as L.Marker).setLatLng(new L.LatLng(lat, lon));
|
||||
$scope.tracking.alt = `${msg.height}m`;
|
||||
$scope.tracking.lat = `${Helpers.Calculations.RadToDeg(msg.lat)}°`
|
||||
$scope.tracking.lon = `${Helpers.Calculations.RadToDeg(msg.lon)}°`
|
||||
$scope.tracking.tracked = true;
|
||||
try { $scope.$apply(); } catch {}
|
||||
};
|
||||
|
||||
for (let port of $scope.tracking.ports) {
|
||||
let socket = new WebSocket(wsPos + ":" + port);
|
||||
socket.onopen = onOpen;
|
||||
socket.onmessage = onMessage;
|
||||
socket.onerror = () => onDisconnect("Connection error.");
|
||||
socket.onclose = (event: CloseEvent) => onDisconnect(event.code == 1000 ? "Connection closed." : "Connection error.");
|
||||
$scope.tracking.sockets.push(socket);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
onDisconnect("Unexpected error");
|
||||
}
|
||||
try { $scope.$apply(); } catch {}
|
||||
};
|
||||
/** @function */ $scope.tracking.showCurrentPos = () => {
|
||||
map.panTo(($scope.tracking.marker as L.Marker).getLatLng());
|
||||
}
|
||||
/** @function */ $scope.tracking.stopTracking = () => {
|
||||
for (let socket of $scope.tracking.sockets) (socket as WebSocket)?.close();
|
||||
$scope.tracking.sockets = [];
|
||||
($scope.tracking.marker as L.Marker)?.removeFrom(map);
|
||||
$scope.tracking.marker = null;
|
||||
$scope.tracking.alt = null;
|
||||
$scope.tracking.lat = null;
|
||||
$scope.tracking.lon = null;
|
||||
$scope.tracking.tracked = false;
|
||||
$scope.tracking.isTracking = false;
|
||||
try { $scope.$apply(); } catch {}
|
||||
};
|
||||
|
||||
($("#eqNoInput") as HTMLInputElement).onkeydown = ev => {
|
||||
if (ev.which == 13 /* 13 -> Enter */) $("#trackingBtn")?.click();
|
||||
};
|
||||
|
||||
$scope.functions.updateView();
|
||||
$scope.html.disableInput = false;
|
||||
$scope.$apply();
|
||||
|
||||
console.log(`Finished loading in ${performance.now() - t0}ms.`);
|
||||
|
||||
//Tracking
|
||||
// var socket: WebSocket;
|
||||
|
||||
// var markerLatLng: any;
|
||||
// var markerPopupContent = "";
|
||||
|
||||
// var marker = new L.CircleMarker([0,0], {color: "white"}).on('click', function(){L.popup()
|
||||
// .setLatLng(markerLatLng)
|
||||
// .setContent(markerPopupContent)
|
||||
// .openOn(map);});
|
||||
// marker.addTo(map);
|
||||
// marker.bringToFront();
|
||||
|
||||
// class Participant{
|
||||
// eqno: number;
|
||||
// lat: number;
|
||||
// lon: number;
|
||||
// popup: string;
|
||||
// constructor(en: number, lat: number, lon: number, popup:string){
|
||||
// this.eqno = en;
|
||||
// this.lat = lat;
|
||||
// this.lon = lon;
|
||||
// this.popup = popup;
|
||||
// }
|
||||
// }
|
||||
|
||||
// var Participants: { [id: string] : Participant; } = {};
|
||||
|
||||
// var markerLayer: CircleMarker[] = [];
|
||||
|
||||
//Onclick
|
||||
// var connectButton = <HTMLElement>document.getElementById("connectWls");
|
||||
// connectButton.addEventListener("click", connectTracking);
|
||||
|
||||
// function connectTracking(){
|
||||
// try
|
||||
// {
|
||||
// var ip = (<HTMLInputElement>document.getElementById("ipaddresse")).value;
|
||||
// var host = "ws://" + ip;
|
||||
// console.log(host);
|
||||
// socket = new WebSocket(host);
|
||||
// socket.onopen = function(){
|
||||
// var connectStr = <HTMLElement>document.getElementById("Serverconnect")
|
||||
// console.log("onopen: connect state:" +socket.readyState);
|
||||
// connectStr.innerHTML = "Server: connected";
|
||||
// connectStr.style.color = "green";
|
||||
|
||||
// }
|
||||
// var markPos: L.CircleMarker;
|
||||
// var allParticipants: Participant[] = [];
|
||||
|
||||
// socket.onmessage = (msg) => {
|
||||
// console.log(msg);
|
||||
// var positionReport = JSON.parse(msg.data);
|
||||
// console.log(positionReport.data.header.equipmentNumber);
|
||||
// var convPosReport = JSON.parse('{"1": "NaN", "lat": ' + Helpers.Calculations.RadToDeg(positionReport.data.geoPosition.lat) + ', "lng": ' + Helpers.Calculations.RadToDeg(positionReport.data.geoPosition.lon) + '}');
|
||||
// if ((<HTMLInputElement>document.getElementById("trackAll")).checked){
|
||||
// for (var i = 0; i < markerLayer.length; i++){
|
||||
// markerLayer[i].remove();
|
||||
// console.log("[MT]marker" + i + "removed");
|
||||
// }
|
||||
// markerLayer = [];
|
||||
// console.log([convPosReport.lat, convPosReport.lng]);
|
||||
// allParticipants.push({eqno: positionReport.data.header.equipmentNumber, lat: convPosReport.lat, lon: convPosReport.lng, popup: "<center>EquipmentNr: " + positionReport.data.header.equipmentNumber + "<br>"
|
||||
// + "BuildingID: " + positionReport.data.opsPosition.moutObjectId + "<br>"
|
||||
// + "RoomID: " + positionReport.data.opsPosition.moutRoomId + "</center>"});
|
||||
|
||||
// console.log(Participants[positionReport.data.header.equipmentNumber]);
|
||||
|
||||
// for(var i = 0; i < allParticipants.length; i++){
|
||||
// markerLatLng = convPosReport;
|
||||
// markPos = new L.CircleMarker([allParticipants[i].lat, allParticipants[i].lon], {color: "red"})
|
||||
// .bindPopup(L.popup()
|
||||
// .setLatLng(markerLatLng)
|
||||
// .setContent(allParticipants[i].popup)
|
||||
// .openOn(map))
|
||||
// .addTo(map)
|
||||
// .bringToFront();
|
||||
// markerLayer.push(markPos);
|
||||
// console.log("EquipNo: " + allParticipants[i].eqno + "Position" + allParticipants[i].lat, allParticipants[i].lon);
|
||||
// }
|
||||
// console.log(marker.getLatLng());
|
||||
// } else {
|
||||
// markerLatLng = convPosReport;
|
||||
// if(positionReport.data.header.equipmentNumber == (<HTMLInputElement>document.getElementById("equipmentNumber")).value){
|
||||
// for (var i = 0; i < markerLayer.length; i++){
|
||||
// markerLayer[i].remove();
|
||||
// console.log("[ST]marker" + i + "removed");
|
||||
// }
|
||||
// markerLayer = [];
|
||||
// console.log([convPosReport.lat, convPosReport.lng]);
|
||||
|
||||
// var participant = new Participant(positionReport.data.header.equipmentNumber, convPosReport.lat, convPosReport.lng, "<center>EquipmentNr: " + positionReport.data.header.equipmentNumber + "<br>"
|
||||
// + "BuildingID: " + positionReport.data.opsPosition.moutObjectId + "<br>"
|
||||
// + "RoomID: " + positionReport.data.opsPosition.moutRoomId + "</center>");
|
||||
// markPos = new L.CircleMarker([participant.lat, participant.lon], {color: "red"})
|
||||
// .bindPopup(L.popup()
|
||||
// .setLatLng(markerLatLng)
|
||||
// .setContent(participant.popup)
|
||||
// .openOn(map))
|
||||
// .addTo(map)
|
||||
// .bringToFront();
|
||||
// markerLayer.push(markPos);
|
||||
// markerLatLng = convPosReport;
|
||||
// markerPopupContent = "<center>EquipmentNr: " + positionReport.data.header.equipmentNumber + "<br>"
|
||||
// + "BuildingID: " + positionReport.data.opsPosition.moutObjectId + "<br>"
|
||||
// + "RoomID: " + positionReport.data.opsPosition.moutRoomId + "</center>"
|
||||
|
||||
// L.popup()
|
||||
// .setLatLng(markerLatLng)
|
||||
// .setContent(markerPopupContent)
|
||||
// .openOn(map)
|
||||
|
||||
// console.log(marker.getLatLng());
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// socket.onclose = function(){
|
||||
// for(let key in Participants){
|
||||
// console.log(Participants[key]);
|
||||
// }
|
||||
// var connectStr = <HTMLElement>document.getElementById("Serverconnect")
|
||||
// console.log("onopen: connect state:" +socket.readyState);
|
||||
// connectStr.innerHTML = "Server: disconnected";
|
||||
// connectStr.style.color = "red";
|
||||
// };
|
||||
// } catch (exception) {
|
||||
// console.error(exception);
|
||||
// }
|
||||
// }
|
||||
|
||||
// //onclick
|
||||
// var disconnectButton = <HTMLElement>document.getElementById("disconnectWls");
|
||||
// disconnectButton.addEventListener("click", disconnectTracking);
|
||||
|
||||
// function disconnectTracking(){
|
||||
// socket.close();
|
||||
// }
|
||||
// //EndTracking
|
||||
|
||||
// //Custom Input
|
||||
// var customTrackBtn = <HTMLElement>document.getElementById("trackCI");
|
||||
// customTrackBtn.addEventListener("click", customTrack);
|
||||
|
||||
// var datatypeSelection = <HTMLElement>document.getElementById("datatype");
|
||||
// datatypeSelection.addEventListener("change", switchDatatypes);
|
||||
|
||||
// var connectManual = <HTMLElement>document.getElementById("connectFootprintbtn");
|
||||
// connectManual.addEventListener("click", connectToFootprint);
|
||||
|
||||
// function connectToFootprint(){
|
||||
// Functions.manualLoad();
|
||||
// }
|
||||
|
||||
// function switchDatatypes(){
|
||||
// (<HTMLInputElement>document.getElementById("field1")).value = "";
|
||||
// (<HTMLInputElement>document.getElementById("field2")).value = "";
|
||||
// (<HTMLInputElement>document.getElementById("field3")).value = "";
|
||||
// (<HTMLInputElement>document.getElementById("field4")).value = "";
|
||||
|
||||
// switch ((<HTMLInputElement>document.getElementById("datatype")).value){
|
||||
// case "UTM":
|
||||
// (<HTMLElement>document.getElementById("field1")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field1")).placeholder = "Easting";
|
||||
// (<HTMLElement>document.getElementById("field2")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field2")).placeholder = "Northing";
|
||||
// (<HTMLElement>document.getElementById("field3")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field3")).placeholder = "Zonenumber";
|
||||
// (<HTMLElement>document.getElementById("field4")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field4")).placeholder = "Zoneletter";
|
||||
// break;
|
||||
// case "MGRS":
|
||||
// (<HTMLElement>document.getElementById("field1")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field1")).placeholder = "Gridzone";
|
||||
// (<HTMLElement>document.getElementById("field2")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field2")).placeholder = "Square ID";
|
||||
// (<HTMLElement>document.getElementById("field3")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field3")).placeholder = "East-West Position";
|
||||
// (<HTMLElement>document.getElementById("field4")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field4")).placeholder = "North-South Position";
|
||||
// break;
|
||||
// default:
|
||||
// (<HTMLElement>document.getElementById("field1")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field1")).placeholder = "Longitude";
|
||||
// (<HTMLElement>document.getElementById("field2")).style.display = "";
|
||||
// (<HTMLInputElement>document.getElementById("field2")).placeholder = "Latitude";
|
||||
// (<HTMLElement>document.getElementById("field3")).style.display = "none";
|
||||
// (<HTMLElement>document.getElementById("field4")).style.display = "none";
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// function customTrack(){
|
||||
// var markerCoords = JSON.parse('{"lat": 0, "lon": 0}');
|
||||
// switch ((<HTMLInputElement>document.getElementById("datatype")).value){
|
||||
// case "UTM":
|
||||
// var customCoordinates = UTM.toLatLon(parseFloat((<HTMLInputElement>document.getElementById("field1")).value),
|
||||
// parseFloat((<HTMLInputElement>document.getElementById("field2")).value),
|
||||
// parseFloat((<HTMLInputElement>document.getElementById("field3")).value),
|
||||
// (<HTMLInputElement>document.getElementById("field4")).value);
|
||||
|
||||
// markerCoords.lat = customCoordinates.latitude;
|
||||
// markerCoords.lon = customCoordinates.longitude;
|
||||
// console.log(markerCoords);
|
||||
// break;
|
||||
// case "MGRS":
|
||||
// var mgrsStr = (<HTMLInputElement>document.getElementById("field1")).value
|
||||
// +""+ (<HTMLInputElement>document.getElementById("field2")).value
|
||||
// +""+ (<HTMLInputElement>document.getElementById("field3")).value
|
||||
// +""+ (<HTMLInputElement>document.getElementById("field4")).value;
|
||||
// var output = MGRS.toPoint(mgrsStr);
|
||||
// console.log(output);
|
||||
// var outputStr: string = "" + output;
|
||||
// var splitStr = outputStr.split(",");
|
||||
// var customCoordinates = {
|
||||
// latitude: parseFloat(splitStr[1]),
|
||||
// longitude: parseFloat(splitStr[0]),
|
||||
// };
|
||||
// markerCoords.lat = customCoordinates.latitude;
|
||||
// markerCoords.lon = customCoordinates.longitude;
|
||||
// console.log(markerCoords);
|
||||
// break;
|
||||
// default:
|
||||
// markerCoords.lat = parseFloat((<HTMLInputElement>document.getElementById("field2")).value);
|
||||
// markerCoords.lon = parseFloat(((<HTMLInputElement>document.getElementById("field1")).value));
|
||||
// break;
|
||||
// }
|
||||
// marker.setLatLng(markerCoords);
|
||||
|
||||
// markerLatLng = markerCoords;
|
||||
// markerPopupContent = "<center>Custom Marker <br>"
|
||||
// + "Latitude: " + markerCoords.lat + "<br>"
|
||||
// + "Longitude: " + markerCoords.lon + "</center>"
|
||||
|
||||
// L.popup()
|
||||
// .setLatLng(markerLatLng)
|
||||
// .setContent(markerPopupContent)
|
||||
// .openOn(map)
|
||||
// }
|
||||
|
||||
// map.on("click", onMapClick);
|
||||
|
||||
// function onMapClick(event: any){
|
||||
// (<HTMLInputElement>document.getElementById("datatype")).value = "LongLat";
|
||||
// switchDatatypes();
|
||||
// (<HTMLInputElement>document.getElementById("field1")).value = event.latlng.lng.toString();
|
||||
// (<HTMLInputElement>document.getElementById("field2")).value = event.latlng.lat.toString();
|
||||
// customTrack();
|
||||
// }
|
||||
});
|
||||
Reference in new issue
Block a user