#25 Icons flickering when using ssl
This commit is contained in:
parent
51689abb64
commit
a1b669cd68
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 21 KiB |
@ -30,7 +30,7 @@ function parseAjaxLoc() {
|
|||||||
className: 'pos-marker',
|
className: 'pos-marker',
|
||||||
iconSize: [56, 80],
|
iconSize: [56, 80],
|
||||||
iconAnchor: [0, 80],
|
iconAnchor: [0, 80],
|
||||||
html: '<object data="'+positionItem['Icon']+'" type="image/svg+xml" style="height:80px; width:56px;"></object>'
|
html: '<img src="' + positionItem['Icon'] + '" height="80" width="56" />'
|
||||||
});
|
});
|
||||||
marker = L.marker([positionItem['Latitude'], positionItem['Longitude']], { 'title': positionItem['Name'], 'icon': myIcon });
|
marker = L.marker([positionItem['Latitude'], positionItem['Longitude']], { 'title': positionItem['Name'], 'icon': myIcon });
|
||||||
}
|
}
|
||||||
@ -43,16 +43,16 @@ function parseAjaxLoc() {
|
|||||||
className: 'pos-marker',
|
className: 'pos-marker',
|
||||||
iconSize: [56, 80],
|
iconSize: [56, 80],
|
||||||
iconAnchor: [0, 80],
|
iconAnchor: [0, 80],
|
||||||
html: '<object data="' + positionItem['Icon'] + '" type="image/svg+xml" style="height:80px; width:56px;"></object>'
|
html: '<img src="' + positionItem['Icon'] + '" height="80" width="56" />'
|
||||||
}));
|
}));
|
||||||
} else if (markers[key]._icon.children[0].hasAttribute("data")) {
|
} else if (markers[key]._icon.children[0].hasAttribute("src")) {
|
||||||
var old = markers[key]._icon.children[0]["data"].substring(markers[key]._icon.children[0]["data"].indexOf("/", 7) + 1);
|
var old = markers[key]._icon.children[0]["src"].substring(markers[key]._icon.children[0]["src"].indexOf("/", 7) + 1);
|
||||||
if (old !== positionItem['Icon']) {
|
if (old !== positionItem['Icon']) {
|
||||||
markers[key]._icon.children[0]["data"] = positionItem['Icon'];
|
markers[key]._icon.children[0]["src"] = positionItem['Icon'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (markers[key]._icon.children.length === 1 && markers[key]._icon.children[0].hasAttribute("data")) {
|
if (markers[key]._icon.children.length === 1 && markers[key]._icon.children[0].hasAttribute("src")) {
|
||||||
markers[key].removeFrom(mymap);
|
markers[key].removeFrom(mymap);
|
||||||
markers[key] = L.marker([positionItem['Latitude'], positionItem['Longitude']], { 'title': positionItem['Name'] }).addTo(mymap).on("click", showMarkerInfo, key);
|
markers[key] = L.marker([positionItem['Latitude'], positionItem['Longitude']], { 'title': positionItem['Name'] }).addTo(mymap).on("click", showMarkerInfo, key);
|
||||||
}
|
}
|
||||||
|
@ -96,16 +96,16 @@ function updateOverviewElement(positionItem, id) {
|
|||||||
document.getElementById("overview-update-id-" + id).innerText = "Letzte Werte: vor " + timeCalculation(positionItem["Recievedtime"], "difftext");
|
document.getElementById("overview-update-id-" + id).innerText = "Letzte Werte: vor " + timeCalculation(positionItem["Recievedtime"], "difftext");
|
||||||
if (positionItem['Icon'] === null) {
|
if (positionItem['Icon'] === null) {
|
||||||
var icon = document.getElementById("overview-icon-id-" + id);
|
var icon = document.getElementById("overview-icon-id-" + id);
|
||||||
if (icon.children[0].hasAttribute("data")) {
|
if (icon.children[0].hasAttribute("rel")) {
|
||||||
document.getElementById("overview-icon-id-" + id).innerHTML = "<img src =\"icons/marker/map-marker.png\">";
|
document.getElementById("overview-icon-id-" + id).innerHTML = "<img src =\"icons/marker/map-marker.png\">";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (document.getElementById("overview-icon-id-" + id).children[0].hasAttribute("data")) {
|
if (document.getElementById("overview-icon-id-" + id).children[0].hasAttribute("src")) {
|
||||||
if (document.getElementById("overview-icon-id-" + id).children[0]["data"].substring(document.getElementById("overview-icon-id-" + id).children[0]["data"].indexOf("/", 7) + 1) !== positionItem['Icon'] + "&marker-bg=hidden") {
|
if (document.getElementById("overview-icon-id-" + id).children[0]["src"].substring(document.getElementById("overview-icon-id-" + id).children[0]["src"].indexOf("/", 7) + 1) !== positionItem['Icon'] + "&marker-bg=hidden") {
|
||||||
document.getElementById("overview-icon-id-" + id).children[0]["data"] = positionItem['Icon'] + "&marker-bg=hidden";
|
document.getElementById("overview-icon-id-" + id).children[0]["src"] = positionItem['Icon'] + "&marker-bg=hidden";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("overview-icon-id-" + id).innerHTML = "<object data=\"" + positionItem['Icon'] + "&marker-bg=hidden" + "\" type=\"image/svg+xml\"></object>";
|
document.getElementById("overview-icon-id-" + id).innerHTML = "<img src=\"" + positionItem['Icon'] + "&marker-bg=hidden" + "\" rel='svg'/>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,9 +117,9 @@ function createOverviewElement(positionItem, id) {
|
|||||||
divItem.setAttribute("rel", id);
|
divItem.setAttribute("rel", id);
|
||||||
divItem.innerHTML = "<span class=\"color\" id=\"overview-color-id-" + id + "\"></span>";
|
divItem.innerHTML = "<span class=\"color\" id=\"overview-color-id-" + id + "\"></span>";
|
||||||
if (positionItem['Icon'] !== null) {
|
if (positionItem['Icon'] !== null) {
|
||||||
divItem.innerHTML += "<span class=\"icon\" id=\"overview-icon-id-" + id + "\"><object data=\"" + positionItem['Icon'] + "&marker-bg=hidden" + "\" type=\"image/svg+xml\"></object></span>";
|
divItem.innerHTML += "<span class=\"icon\" id=\"overview-icon-id-" + id + "\"><img src=\"" + positionItem['Icon'] + "&marker-bg=hidden" + "\" rel='svg'/></span>";
|
||||||
} else {
|
} else {
|
||||||
divItem.innerHTML += "<span class=\"icon\" id=\"overview-icon-id-" + id + "\"><img src=\"icons/marker/map-marker.png\"></span>";
|
divItem.innerHTML += "<span class=\"icon\" id=\"overview-icon-id-" + id + "\"><img src=\"icons/marker/map-marker.png\" /></span>";
|
||||||
}
|
}
|
||||||
divItem.innerHTML += "<div class=\"line1\">" +
|
divItem.innerHTML += "<div class=\"line1\">" +
|
||||||
"<span class=\"name\" id=\"overview-name-id-" + id + "\"></span>" +
|
"<span class=\"name\" id=\"overview-name-id-" + id + "\"></span>" +
|
||||||
|
Loading…
Reference in New Issue
Block a user