This commit is contained in:
Azgaar 2020-12-30 12:39:21 +03:00
parent ffc3c980f7
commit 03170abeab
2 changed files with 13 additions and 4 deletions

View file

@ -2414,11 +2414,11 @@
<button id="markerStyle" data-tip="Change marker size and colors" class="icon-brush"></button>
<div id="markerStyleSection" style="display: none">
<i data-tip="Change marker base (pin) style" class="icon-map-pin"></i>:
<input id="markerSize" data-tip="Change marker size" type="range" min=.02 max=20 step=.2 value=1 style="width:12em">
<i data-tip="Change marker base (pin) style" class="icon-map-pin"></i>
<input id="markerSize" data-tip="Change marker size" type="range" min=.01 max=10 step=.1 value=1 style="width:12em">
<input id="markerBaseStroke" data-tip="Change pin stroke color" type="color" value="#ffffff">
<input id="markerBaseFill" data-tip="Change pin fill color" type="color" alue="#000000">
<br><i data-tip="Change marker icon style" class="icon-star"></i>:
<br><i data-tip="Change marker icon style" class="icon-star"></i>
<input id="markerIconStrokeWidth" data-tip="Change icon stroke width" type="range" min=0 max=1 step=.02 value=0 style="width:12em">
<input id="markerIconStroke" data-tip="Change icon stroke color. Ensure icon stroke width is non-zero" type="color" value="#3200ff">
<input id="markerIconFill" data-tip="Change icon fill color" type="color" value="#000000">

View file

@ -203,7 +203,16 @@ function editMarker() {
function changeMarkerSize() {
const id = elSelected.attr("data-id");
document.querySelectorAll("use[data-id='"+id+"']").forEach(e => e.dataset.size = markerSize.value);
document.querySelectorAll("use[data-id='"+id+"']").forEach(e => {
const x = +e.dataset.x, y = +e.dataset.y;
const desired = e.dataset.size = +markerSize.value;
const size = Math.max(desired * 5 + 25 / scale, 1);
e.setAttribute("x", x - size / 2);
e.setAttribute("y", y - size / 2);
e.setAttribute("width", size);
e.setAttribute("height", size);
});
invokeActiveZooming();
}