Skip to content

Commit 9474652

Browse files
committed
print update
1 parent 5fb8417 commit 9474652

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

Diff for: js/print.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,16 @@ var bfl_options = {
125125
L.Control.betterFileLayer(bfl_options).addTo(map);
126126

127127
map.on("bfl:layerloaded", (ev) => {
128-
console.log("Your file was read successfully!! Event: ", ev);
128+
// console.log("Your file was read successfully!! Event: ", ev);
129+
let color = $(`#color`).val();
130+
let weight = parseFloat($(`#weight`).val());
129131
shapeLayer.eachLayer(r => {
130132
r.setStyle({
131133
opacity: $('#slider2').val()/100,
132134
fillOpacity: $('#slider1').val()/100,
135+
color: color,
136+
fillColor: color,
137+
weight:weight
133138
});
134139
});
135140
});
@@ -209,10 +214,10 @@ function changeDimensions(reset=false, preset=false) {
209214
}
210215

211216
function changeColor() {
212-
var color = $(`#color`).val();
213-
217+
let color = $(`#color`).val();
218+
let weight = parseFloat($(`#weight`).val());
214219
shapeLayer.eachLayer(r => {
215-
r.setStyle({ color: color, fillColor: color });
220+
r.setStyle({ color: color, fillColor: color, weight:weight });
216221
});
217222

218223
}

Diff for: print.html

+11-6
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,17 @@
7575
.preset_select {
7676
height: 2.5rem;
7777
}
78+
79+
.narrow50 {
80+
width: 50px;
81+
}
7882
</style>
7983
</head>
8084
<body>
81-
<div class="container-fluid no-print">
85+
<div class="container-fluid no-print mt-5">
8286
<div class="row">
8387
<div class="col-md-4">
84-
<h3>Map Printer</h3>
88+
<h1>Map Printer</h1>
8589
<div class="card card-body mb-4">
8690
<ul>
8791
<li>Drag-drop a shape file (preferably .geojson format) onto this map to display its border.</li>
@@ -99,7 +103,7 @@ <h3>Map Printer</h3>
99103
</div>
100104
<div class="col-md-5">
101105

102-
<h3>Customize the map</h3>
106+
<h3>Print page size</h3>
103107
<p class="mb-2">Change page dimensions: <small>can make it big!</small></p>
104108
<p class="mb-2">Width:<input class="width narrow90" size="5" value="1000" type="number" min="100" max="100000" step="10"> px,
105109
Height:<input class="height narrow90" size="5" value="1450" type="number" min="100" max="100000" step="10"> px
@@ -131,9 +135,10 @@ <h3>Customize the map</h3>
131135
</p>
132136
<p>Page status: <span id="tileStatus"></span></p>
133137

134-
<p>Change color: <input id="color" value="black" size="8">
135-
&nbsp;&nbsp;&nbsp;&nbsp;
136-
<button onclick="changeColor()" class="btn btn-info">Apply</button>
138+
<h3>Shape</h3>
139+
<p>Color: <input id="color" value="black" size="4">
140+
&nbsp;Border size: <input id="weight" value="4" class="narrow50" type="number">
141+
&nbsp;<button onclick="changeColor()" class="btn btn-outline-success">Apply</button>
137142
</p>
138143

139144
<br>

0 commit comments

Comments
 (0)