0

web: fix marker icon position

Shoutouts to 14mRh4X0r for finding the right CSS properties that
work for centering the marker icons.

Fixes #1481.
This commit is contained in:
Nicolas F
2018-11-18 09:10:54 +01:00
parent e867221d8e
commit 2918637539
2 changed files with 10 additions and 2 deletions

View File

@@ -334,7 +334,8 @@ overviewer.util = {
for (var mkidx = 0; mkidx < markers[obj.path].length; mkidx++) {
var marker_group = new L.layerGroup();
var marker_entry = markers[obj.path][mkidx];
var icon = L.icon({iconUrl: marker_entry.icon});
var icon = L.icon({iconUrl: marker_entry.icon,
className: "ov-marker"});
console.log("marker group:", marker_entry.displayName, marker_entry.groupName);
for (var dbidx = 0; dbidx < markersDB[marker_entry.groupName].raw.length; dbidx++) {
@@ -342,7 +343,8 @@ overviewer.util = {
var latlng = overviewer.util.fromWorldToLatLng(db.x, db.y, db.z, obj);
var m_icon;
if (db.icon != undefined) {
m_icon = L.icon({iconUrl: db.icon});
m_icon = L.icon({iconUrl: db.icon,
className: "ov-marker"});
} else {
m_icon = icon;
}

View File

@@ -173,3 +173,9 @@ div.worldcontrol select {
padding: 0 5px;
color: #333;
}
.ov-marker {
position:relative;
margin-left:-50%;
margin-top:-50%;
}