// common mistake is to copy&paste latitude and longitude into the 'lat' search box
function maybeSplitLatitude(e) {
- var coords_split = e.target.value.split(',');
+ var coords_split = e.target.value.split(/,|%2C/);
if (coords_split.length === 2) {
document.querySelector('input[name=lat]').value = L.Util.trim(coords_split[0]);
document.querySelector('input[name=lon]').value = L.Util.trim(coords_split[1]);
class="form-control form-control-sm d-inline"
placeholder="latitude"
pattern="^-?\d+(\.\d+)?$"
+ autofocus
bind:value={lat}
on:change={maybeSplitLatitude} />
</div>