Add name to rider label. #424
This commit is contained in:
parent
a432def97b
commit
fdce6c02a4
2 changed files with 17 additions and 6 deletions
|
|
@ -147,7 +147,7 @@ class DashboardMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
putMarkerWithLabel(id, lat, lng, markers, icon, layer_group, popup_url) {
|
putMarkerWithLabel(id, name, lat, lng, markers, icon, layer_group, popup_url) {
|
||||||
var my = this;
|
var my = this;
|
||||||
// existing marker
|
// existing marker
|
||||||
if (markers.hasOwnProperty(id)) {
|
if (markers.hasOwnProperty(id)) {
|
||||||
|
|
@ -162,7 +162,10 @@ class DashboardMap {
|
||||||
{ icon: icon }
|
{ icon: icon }
|
||||||
);
|
);
|
||||||
|
|
||||||
markers[id].bindTooltip(id,
|
var marker_label = id + ' - ' + name;
|
||||||
|
console.log(marker_label);
|
||||||
|
|
||||||
|
markers[id].bindTooltip(marker_label,
|
||||||
{
|
{
|
||||||
permanent: true,
|
permanent: true,
|
||||||
direction: 'right'
|
direction: 'right'
|
||||||
|
|
@ -228,9 +231,10 @@ class DashboardMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
putRiderAvailableMarker(id, lat, lng) {
|
putRiderAvailableMarker(id, name, lat, lng) {
|
||||||
this.putMarkerWithLabel(
|
this.putMarkerWithLabel(
|
||||||
id,
|
id,
|
||||||
|
name,
|
||||||
lat,
|
lat,
|
||||||
lng,
|
lng,
|
||||||
this.rider_markers,
|
this.rider_markers,
|
||||||
|
|
@ -240,9 +244,10 @@ class DashboardMap {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
putRiderActiveJOMarker(id, lat, lng) {
|
putRiderActiveJOMarker(id, name, lat, lng) {
|
||||||
this.putMarkerWithLabel(
|
this.putMarkerWithLabel(
|
||||||
id,
|
id,
|
||||||
|
name,
|
||||||
lat,
|
lat,
|
||||||
lng,
|
lng,
|
||||||
this.rider_markers,
|
this.rider_markers,
|
||||||
|
|
@ -298,11 +303,12 @@ class DashboardMap {
|
||||||
$.each(riders, function(id, data) {
|
$.each(riders, function(id, data) {
|
||||||
var lat = data.latitude;
|
var lat = data.latitude;
|
||||||
var lng = data.longitude;
|
var lng = data.longitude;
|
||||||
|
var name = data.name;
|
||||||
|
|
||||||
if (data.has_jo)
|
if (data.has_jo)
|
||||||
my.putRiderActiveJOMarker(id, lat, lng);
|
my.putRiderActiveJOMarker(id, name, lat, lng);
|
||||||
else
|
else
|
||||||
my.putRiderAvailableMarker(id, lat, lng);
|
my.putRiderAvailableMarker(id, name, lat, lng);
|
||||||
});
|
});
|
||||||
|
|
||||||
// console.log(rider_markers);
|
// console.log(rider_markers);
|
||||||
|
|
|
||||||
|
|
@ -58,11 +58,16 @@ class HomeController extends Controller
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get full name of rider
|
||||||
|
$name = $rider->getFullName();
|
||||||
|
$riders[$rider_id]['name'] = $name;
|
||||||
|
|
||||||
$jo = $rider->getActiveJobOrder();
|
$jo = $rider->getActiveJobOrder();
|
||||||
if ($jo == null)
|
if ($jo == null)
|
||||||
$riders[$rider_id]['has_jo'] = false;
|
$riders[$rider_id]['has_jo'] = false;
|
||||||
else
|
else
|
||||||
$riders[$rider_id]['has_jo'] = true;
|
$riders[$rider_id]['has_jo'] = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// get active JOs and check transaction origin for TransactionOrigin::MOBILE_APP
|
// get active JOs and check transaction origin for TransactionOrigin::MOBILE_APP
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue