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