Maps always show Tooltip
This commit is contained in:
parent
273d98f3ad
commit
04a21d3eb2
@ -28,6 +28,7 @@ switch ($action) {
|
|||||||
'name' => $customer->fullname,
|
'name' => $customer->fullname,
|
||||||
'balance' => $customer->balance,
|
'balance' => $customer->balance,
|
||||||
'address' => $customer->address,
|
'address' => $customer->address,
|
||||||
|
'direction' => $customer->coordinates,
|
||||||
'info' => Lang::T("Username") . ": " . $customer->username . " - " . Lang::T("Full Name") . ": " . $customer->fullname . " - " . Lang::T("Email") . ": " . $customer->email . " - " . Lang::T("Phone") . ": " . $customer->phonenumber . " - " . Lang::T("Service Type") . ": " . $customer->service_type,
|
'info' => Lang::T("Username") . ": " . $customer->username . " - " . Lang::T("Full Name") . ": " . $customer->fullname . " - " . Lang::T("Email") . ": " . $customer->email . " - " . Lang::T("Phone") . ": " . $customer->phonenumber . " - " . Lang::T("Service Type") . ": " . $customer->service_type,
|
||||||
'coordinates' => '[' . $customer->coordinates . ']',
|
'coordinates' => '[' . $customer->coordinates . ']',
|
||||||
];
|
];
|
||||||
|
@ -34,21 +34,22 @@
|
|||||||
var name = customer.id;
|
var name = customer.id;
|
||||||
var name = customer.name;
|
var name = customer.name;
|
||||||
var info = customer.info;
|
var info = customer.info;
|
||||||
|
var direction = customer.direction;
|
||||||
var coordinates = customer.coordinates;
|
var coordinates = customer.coordinates;
|
||||||
var balance = customer.balance;
|
var balance = customer.balance;
|
||||||
var address = customer.address;
|
var address = customer.address;
|
||||||
|
|
||||||
// Create a popup for the marker
|
// Create a popup for the marker
|
||||||
var popupContent = "<strong>Customer Name</strong>: " + name + "<br>" +
|
var popupContent = "<strong>Name</strong>: " + name + "<br>" +
|
||||||
"<strong>Customer Info</strong>: " + info + "<br>" +
|
"<strong>Info</strong>: " + info + "<br>" +
|
||||||
"<strong>Customer Balance</strong>: " + balance + "<br>" +
|
"<strong>Balance</strong>: " + balance + "<br>" +
|
||||||
"<strong>Address</strong>: " + address + "<br>" +
|
"<strong>Address</strong>: " + address + "<br>" +
|
||||||
"<strong>Coordinates</strong>: " + coordinates + "<br>" +
|
"<a href='{/literal}{$_url}{literal}customers/view/"+ customer.id +"'>More Info</a> • " +
|
||||||
"<a href='{/literal}{$_url}{literal}customers/view/"+ customer.id +"'>More Info</a><br>";
|
"<a href='https://www.google.com/maps/dir//" + direction + "' target='maps'>Get Direction</a><br>";
|
||||||
|
|
||||||
// Add marker to map
|
// Add marker to map
|
||||||
var marker = L.marker(JSON.parse(coordinates)).addTo(group);
|
var marker = L.marker(JSON.parse(coordinates)).addTo(group);
|
||||||
marker.bindTooltip(name).bindPopup(popupContent);
|
marker.bindTooltip(name, { permanent: true }).bindPopup(popupContent);
|
||||||
});
|
});
|
||||||
|
|
||||||
map.fitBounds(group.getBounds());
|
map.fitBounds(group.getBounds());
|
||||||
|
@ -37,9 +37,14 @@
|
|||||||
onclick="this.select()">
|
onclick="this.select()">
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
|
{if $d['coordinates']}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Coordinates')}</b> <span class="pull-right">{$d['coordinates']}</span>
|
<b>{Lang::T('Coordinates')}</b> <span class="pull-right">
|
||||||
|
<a href="https://www.google.com/maps/dir//{$d['coordinates']}/" target="_blank">Get
|
||||||
|
Directions</a>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
|
{/if}
|
||||||
<!--Customers Attributes view start -->
|
<!--Customers Attributes view start -->
|
||||||
{if $customFields}
|
{if $customFields}
|
||||||
{foreach $customFields as $customField}
|
{foreach $customFields as $customField}
|
||||||
@ -110,8 +115,7 @@
|
|||||||
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
|
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Expires On')} <span
|
{Lang::T('Expires On')} <span class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
|
||||||
class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
|
|
||||||
$package['time'])}</span>
|
$package['time'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user