mirror of
https://github.com/crawlerop/lpads
synced 2026-08-13 22:12:32 +07:00
New features
This commit is contained in:
parent
2b842e84df
commit
bf4e79bd47
2 changed files with 11 additions and 2 deletions
|
|
@ -31,7 +31,8 @@
|
|||
<button id="save" type="button">Save</button>
|
||||
<button id="add" type="button">Add</button>
|
||||
<button id="remove" type="button">Remove</button>
|
||||
<button id="update" type="button">Update</button>
|
||||
<button id="update" type="button">Update</button>
|
||||
<button id="reload" type="button">Refresh</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ var selData = null;
|
|||
var index = null;
|
||||
var pins = [];
|
||||
var repdata = [];
|
||||
var dist = 1;
|
||||
|
||||
L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
|
||||
maxZoom: 21,
|
||||
|
|
@ -82,9 +83,12 @@ function loadMarker(data) {
|
|||
|
||||
up = new URLSearchParams(window.location.search)
|
||||
function start() {
|
||||
if (up.get('dist')) {
|
||||
dist = parseFloat(up.get('dist'))
|
||||
}
|
||||
if (up.get('lat') && up.get('lng')) {
|
||||
mymap.setView([parseFloat(up.get('lat')), parseFloat(up.get('lng'))], 14)
|
||||
xhr.open("GET", "https://api.allorigins.win/raw?url=" + encodeURIComponent(lpadURL.replace("(dist)", 4000).replace("(long)", up.get("lng")).replace("(lat)", up.get("lat"))))
|
||||
xhr.open("GET", "https://api.allorigins.win/raw?url=" + encodeURIComponent(lpadURL.replace("(dist)", dist).replace("(long)", up.get("lng")).replace("(lat)", up.get("lat"))))
|
||||
xhr.onreadystatechange = function() {
|
||||
if (this.readyState == 4) {
|
||||
out = xhr.responseText.replace(")]}'\n", "")
|
||||
|
|
@ -124,6 +128,10 @@ document.getElementById("remove").onclick = function() {
|
|||
}
|
||||
}
|
||||
|
||||
document.getElementById("reload").onclick = function() {
|
||||
location.reload()
|
||||
}
|
||||
|
||||
setInterval(() => {
|
||||
if (selData != null) {
|
||||
selData.adName = document.getElementById("place").value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue