mirror of
https://github.com/openvk/openvk
synced 2024-12-23 17:12:01 +03:00
Редактирование названия геоточки через интерфейс при создании
This commit is contained in:
parent
5a7c99be74
commit
b565daf827
1 changed files with 7 additions and 2 deletions
|
@ -269,7 +269,7 @@ async function initGeo(tid) {
|
||||||
let marker = {
|
let marker = {
|
||||||
lat: currentMarker._latlng.lat,
|
lat: currentMarker._latlng.lat,
|
||||||
lng: currentMarker._latlng.lng,
|
lng: currentMarker._latlng.lng,
|
||||||
name: currentMarker._popup._content
|
name: $(`#geo-name-input-${tid}`).val() ?? currentMarker._popup._content
|
||||||
};
|
};
|
||||||
$(`#post-buttons${tid} #geo`).val(JSON.stringify(marker));
|
$(`#post-buttons${tid} #geo`).val(JSON.stringify(marker));
|
||||||
$(`#post-buttons${tid} .post-has-geo`).text(`${tr("geotag")}: ${marker.name}`);
|
$(`#post-buttons${tid} .post-has-geo`).text(`${tr("geotag")}: ${marker.name}`);
|
||||||
|
@ -302,7 +302,12 @@ async function initGeo(tid) {
|
||||||
markerLayers.clearLayers();
|
markerLayers.clearLayers();
|
||||||
|
|
||||||
currentMarker = L.marker([lat, lng]).addTo(map);
|
currentMarker = L.marker([lat, lng]).addTo(map);
|
||||||
currentMarker.bindPopup(response?.name ?? response?.display_name).openPopup();
|
|
||||||
|
let name = response?.name ?? response?.display_name ?? tr("geotag");
|
||||||
|
let content = `<span onclick="let name = prompt('Введите название геоточки'); $('#geo-name-input-${tid}').val(name); $(this).text(name);" id="geo-name-${tid}">${name}</span>`;
|
||||||
|
content += `<input type="hidden" id="geo-name-input-${tid}" />`;
|
||||||
|
|
||||||
|
currentMarker.bindPopup(content).openPopup();
|
||||||
markerLayers.addLayer(currentMarker);
|
markerLayers.addLayer(currentMarker);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue