Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WalidAissa committed Apr 6, 2024
1 parent 713cf47 commit 57a52c3
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 24 deletions.
11 changes: 11 additions & 0 deletions angular_ui_app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions angular_ui_app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@angular/router": "^16.2.0",
"bootstrap": "^5.3.1",
"leaflet": "^1.9.4",
"leaflet-rotatedmarker": "^0.2.0",
"roslib": "^1.4.1",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
Expand Down
8 changes: 4 additions & 4 deletions angular_ui_app/src/app/map/map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ export class MapComponent implements AfterViewInit{
private initMap(): void {
this.map = L.map('map', {
crs: L.CRS.Simple,
minZoom: 19,
maxZoom: 19
minZoom: 18,
maxZoom: 18

});
}

ngAfterViewInit(): void {
this.initMap();
this.markerService.makeDebrisMarkers(this.map);
this.markerService.makeAreas(this.map);
this.markerService.makeObjectiveMarkers(this.map);
this.markerService.makeDebrisAreas(this.map);
this.markerService.makeRoverMarker(this.map);
this.markerService.makeControlStationMarker(this.map);
}
Expand Down
18 changes: 8 additions & 10 deletions angular_ui_app/src/app/marker.service.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import * as L from 'leaflet';
import {MapComponent} from './map/map.component';

import 'leaflet-rotatedmarker';
@Injectable({
providedIn: 'root'
})
export class MarkerService {
debris: string = '/assets/debris-markers.geojson';
areas: string = '/assets/map-areas.geojson';
debris: string = '/assets/obstacle-markers.geojson';
areas: string = '/assets/debris-areas.geojson';
private gps_data: number[] = [45.506003790, -73.57566751708];
private prev_gps_data: number[] = [45.506103790, -73.57566751708];
private control_station: number[] = [45.5056037902832, -73.57576751708984];
private blueIcon: L.Icon;
private redIcon: L.Icon;
private blackIcon: L.Icon;

constructor(private http: HttpClient) {
this.blueIcon = new L.Icon({
iconUrl: 'assets/map-pins/blue-map-pin.png',
iconUrl: 'assets/map-pins/direction-arrow.png',
iconSize: [41, 41],
iconAnchor: [12, 41],
popupAnchor: [1, -34],
shadowUrl: 'assets/map-pins/marker-shadow.png',
shadowAnchor: [5, 42]
popupAnchor: [1, -34]
});

this.redIcon = new L.Icon({
Expand All @@ -44,7 +42,7 @@ export class MarkerService {
});
}

makeDebrisMarkers(map: L.Map): void {
makeObjectiveMarkers(map: L.Map): void {
this.http.get(this.debris).subscribe((res: any) => {
for (const c of res.features) {
const lon = c.geometry.coordinates[1];
Expand All @@ -55,7 +53,7 @@ export class MarkerService {
});
};

makeAreas(map: L.Map): void {
makeDebrisAreas(map: L.Map): void {
this.http.get(this.areas).subscribe((res: any) => {
for (const c of res.features) {
const lon = c.geometry.coordinates[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"size": 40
},
"properties": {
"name": "obstacle 1"
"name": "debris 1"
}
},
{
Expand All @@ -20,18 +20,18 @@
"size": 20
},
"properties": {
"name": "obstacle2"
"name": "debris 2"
}
},
{
"type": "Feature",
"geometry": {
"type": "Circle",
"coordinates": [45.50590297241211, -73.57531247558594],
"size": 5
"size": 10
},
"properties": {
"name": "obstacle3"
"name": "debris 3"
}
},
{
Expand All @@ -42,7 +42,7 @@
"size": 30
},
"properties": {
"name": "obstacle4"
"name": "debris 4"
}
}
]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"coordinates": [45.50590297241211, -73.57591247558594]
},
"properties": {
"name": "debris1"
"name": "obstacle1"
}
},
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [45.50539779663086, -73.5755615234375]
"coordinates": [45.50519779663086, -73.5755615234375]
},
"properties": {
"name": "debris2"
"name": "obstacle2"
}
},
{
Expand All @@ -28,7 +28,7 @@
"coordinates": [45.50568771362305, -73.5759506225586]
},
"properties": {
"name": "debris3"
"name": "obstacle3"
}
},
{
Expand All @@ -38,7 +38,7 @@
"coordinates": [45.50548771362305, -73.5756506225586]
},
"properties": {
"name": "debris4"
"name": "obstacle4"
}
}
]
Expand Down

0 comments on commit 57a52c3

Please sign in to comment.