mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
adding missing classes in hbs
This commit is contained in:
parent
24c6a7a47b
commit
192e1c3edc
@ -19,8 +19,11 @@
|
|||||||
var map;
|
var map;
|
||||||
|
|
||||||
function loadLeafletMap() {
|
function loadLeafletMap() {
|
||||||
|
console.log("hachind");
|
||||||
var deviceLocationID = "#device-location",
|
var deviceLocationID = "#device-location",
|
||||||
locations = $(deviceLocationID).data("locations"),
|
locations = $(deviceLocationID).data("locations"),
|
||||||
|
location_lat = $(deviceLocationID).data("lat"),
|
||||||
|
location_long = $(deviceLocationID).data("long"),
|
||||||
container = "device-location",
|
container = "device-location",
|
||||||
zoomLevel = 13,
|
zoomLevel = 13,
|
||||||
tileSet = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
tileSet = "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
||||||
@ -46,6 +49,19 @@ function loadLeafletMap() {
|
|||||||
|
|
||||||
$("#map-error").hide();
|
$("#map-error").hide();
|
||||||
$("#device-location").show();
|
$("#device-location").show();
|
||||||
|
} else if (location_long && location_lat) {
|
||||||
|
|
||||||
|
map = L.map(container).setView([location_lat, location_long], zoomLevel);
|
||||||
|
L.tileLayer(tileSet, {attribution: attribution}).addTo(map);
|
||||||
|
|
||||||
|
var m = L.marker([location_lat, location_long], {"opacity": opacVal}).addTo(map).bindPopup("Your device is here");
|
||||||
|
m.on('mouseover', function (e) {
|
||||||
|
this.openPopup();
|
||||||
|
});
|
||||||
|
m.on('mouseout', function (e) {
|
||||||
|
this.closePopup();
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$("#device-location").hide();
|
$("#device-location").hide();
|
||||||
$("#map-error").show();
|
$("#map-error").show();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user