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> { ...@@ -37,7 +37,7 @@ export class BaseService<TEntity> {
// happy case // happy case
if (response.ok) { if (response.ok) {
const data = (await response.json()) as TEntity[]; const data = (await response.json()) as TEntity[];
console.log(data); // console.log(data);
return { return {
statusCode: response.status, statusCode: response.status,
data: data data: data
...@@ -68,7 +68,7 @@ export class BaseService<TEntity> { ...@@ -68,7 +68,7 @@ export class BaseService<TEntity> {
// happy case // happy case
if (response.ok) { if (response.ok) {
const data = (await response.json()) as TEntity; const data = (await response.json()) as TEntity;
console.log(data); // console.log(data);
return { return {
statusCode: response.status, statusCode: response.status,
data: data data: data
......
...@@ -21,7 +21,7 @@ export class CultureService extends BaseService<ICulture> { ...@@ -21,7 +21,7 @@ export class CultureService extends BaseService<ICulture> {
// happy case // happy case
if (response.ok) { if (response.ok) {
const data = (await response.json()) as ICulture[]; const data = (await response.json()) as ICulture[];
console.log(data); // console.log(data);
return { return {
statusCode: response.status, statusCode: response.status,
data: data data: data
......
...@@ -22,7 +22,7 @@ export class GpsLocationService extends BaseService<IGpsLocation> { ...@@ -22,7 +22,7 @@ export class GpsLocationService extends BaseService<IGpsLocation> {
// happy case // happy case
if (response.ok) { if (response.ok) {
const data = (await response.json()) as IGpsLocation[]; const data = (await response.json()) as IGpsLocation[];
console.log(data); // console.log(data);
return { return {
statusCode: response.status, statusCode: response.status,
data: data data: data
......
...@@ -75,7 +75,7 @@ export function getColorCodedPolylines(locations: IGpsLocation[], minPace: numbe ...@@ -75,7 +75,7 @@ export function getColorCodedPolylines(locations: IGpsLocation[], minPace: numbe
} }
console.log(result); //console.log(result);
return result; return result;
} }
......
...@@ -189,7 +189,24 @@ export class HomeIndex { ...@@ -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 { visualizeSession(): void {
this.clearMap();
const iconWp = L.icon({ const iconWp = L.icon({
iconUrl: '/marker-icon-wp.png', 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