Re-implement location marker
Click to centre, right-click to dismiss.
This commit is contained in:
@@ -122,6 +122,9 @@ overviewer.util = {
|
|||||||
// Set the background colour
|
// Set the background colour
|
||||||
document.getElementById("mcmap").style.backgroundColor = ovconf.bgcolor;
|
document.getElementById("mcmap").style.backgroundColor = ovconf.bgcolor;
|
||||||
|
|
||||||
|
if (overviewer.collections.locationMarker) {
|
||||||
|
overviewer.collections.locationMarker.remove();
|
||||||
|
}
|
||||||
// Remove old spawn marker, add new one
|
// Remove old spawn marker, add new one
|
||||||
if (overviewer.collections.spawnMarker) {
|
if (overviewer.collections.spawnMarker) {
|
||||||
overviewer.collections.spawnMarker.remove();
|
overviewer.collections.spawnMarker.remove();
|
||||||
@@ -677,10 +680,22 @@ overviewer.util = {
|
|||||||
|
|
||||||
overviewer.map.setView(latlngcoords, zoom);
|
overviewer.map.setView(latlngcoords, zoom);
|
||||||
|
|
||||||
|
if (ovconf.showlocationmarker) {
|
||||||
// TODO re-add this
|
/// TODO: Retina Icon
|
||||||
//var locationmarker = new overviewer.views.LocationIconView();
|
var locationIcon = L.icon({
|
||||||
//locationmarker.render();
|
iconUrl: overviewerConfig.CONST.image.queryMarker,
|
||||||
|
});
|
||||||
|
var locationm = L.marker(latlngcoords, { icon: locationIcon,
|
||||||
|
title: "Linked location"});
|
||||||
|
overviewer.collections.locationMarker = locationm
|
||||||
|
overviewer.collections.locationMarker.on('contextmenu', function(ev) {
|
||||||
|
overviewer.collections.locationMarker.remove();
|
||||||
|
});
|
||||||
|
overviewer.collections.locationMarker.on('click', function(ev) {
|
||||||
|
overviewer.map.setView(ev.latlng);
|
||||||
|
});
|
||||||
|
overviewer.collections.locationMarker.addTo(overviewer.map);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Generate a function to get the path to a tile at a particular location
|
* Generate a function to get the path to a tile at a particular location
|
||||||
|
|||||||
Reference in New Issue
Block a user