Commit bc67da58 authored by Andres Käver's avatar Andres Käver

clear map on gpssession change

parent c4c89202
Pipeline #837 passed with stages
in 1 minute and 20 seconds
......@@ -37,7 +37,7 @@ export class BaseService<TEntity> {
// happy case
if (response.ok) {
const data = (await response.json()) as TEntity[];
console.log(data);
// console.log(data);
return {
statusCode: response.status,
data: data
......@@ -68,7 +68,7 @@ export class BaseService<TEntity> {
// happy case
if (response.ok) {
const data = (await response.json()) as TEntity;
console.log(data);
// console.log(data);
return {
statusCode: response.status,
data: data
......
......@@ -21,7 +21,7 @@ export class CultureService extends BaseService<ICulture> {
// happy case
if (response.ok) {
const data = (await response.json()) as ICulture[];
console.log(data);
// console.log(data);
return {
statusCode: response.status,
data: data
......
......@@ -22,7 +22,7 @@ export class GpsLocationService extends BaseService<IGpsLocation> {
// happy case
if (response.ok) {
const data = (await response.json()) as IGpsLocation[];
console.log(data);
// console.log(data);
return {
statusCode: response.status,
data: data
......
......@@ -75,7 +75,7 @@ export function getColorCodedPolylines(locations: IGpsLocation[], minPace: numbe
}
console.log(result);
//console.log(result);
return result;
}
......
......@@ -189,7 +189,24 @@ export class HomeIndex {
}
}
clearMap(): void {
for (const i in (this.map as any)._layers) {
// clear paths and icons
if((this.map as any)._layers[i]._path != undefined || (this.map as any)._layers[i]._icon != undefined) {
try {
this.map.removeLayer((this.map as any)._layers[i]);
}
catch(e) {
log.error("problem with " + e + (this.map as any)._layers[i]);
}
} else {
log.debug((this.map as any)._layers[i]);
}
}
}
visualizeSession(): void {
this.clearMap();
const iconWp = L.icon({
iconUrl: '/marker-icon-wp.png',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment