Updated marker and measurement colors to be red

This commit is contained in:
Zakary Timson 2019-08-23 14:57:56 -04:00
parent 400cdf95e8
commit b14b6e3bd3
2 changed files with 4 additions and 3 deletions

View File

@ -93,6 +93,7 @@ export class MapService {
} }
newMarker(latlng: LatLng, opts: any={}) { newMarker(latlng: LatLng, opts: any={}) {
if(!opts.icon) opts.icon = L.icon({iconUrl: '/assets/images/marker.png', iconSize: [40, 55], iconAnchor: [20, 55]});
let marker = L.marker(latlng, opts).addTo(this.map); let marker = L.marker(latlng, opts).addTo(this.map);
this.markers.push(marker); this.markers.push(marker);
marker.on('click', () => { marker.on('click', () => {
@ -105,10 +106,10 @@ export class MapService {
} }
newMeasurement(latlng1: LatLng, latlng2: LatLng) { newMeasurement(latlng1: LatLng, latlng2: LatLng) {
let line = L.polyline([latlng1, latlng2], {weight: 5}).addTo(this.map); let line = L.polyline([latlng1, latlng2], {color: '#d82b00', weight: 5}).addTo(this.map);
let decoration = L.polylineDecorator(line, {patterns: [ let decoration = L.polylineDecorator(line, {patterns: [
{offset: '100%', repeat: 0, symbol: L.Symbol.arrowHead({pixelSize: 15, polygon: false, headAngle: 180, pathOptions: {stroke: true}})}, {offset: '100%', repeat: 0, symbol: L.Symbol.arrowHead({pixelSize: 15, polygon: false, headAngle: 180, pathOptions: {color: '#d82b00', stroke: true}})},
{offset: '-100%', repeat: 0, symbol: L.Symbol.arrowHead({pixelSize: 15, polygon: false, headAngle: 180, pathOptions: {stroke: true}})} {offset: '-100%', repeat: 0, symbol: L.Symbol.arrowHead({pixelSize: 15, polygon: false, headAngle: 180, pathOptions: {color: '#d82b00', stroke: true}})}
]}).addTo(this.map); ]}).addTo(this.map);
this.measurements.push({line: line, decoration: decoration}); this.measurements.push({line: line, decoration: decoration});
let distance = distanceInM(latlng1.lat, latlng1.lng, latlng2.lat, latlng2.lng); let distance = distanceInM(latlng1.lat, latlng1.lng, latlng2.lat, latlng2.lng);

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB