Skip to content

Commit

Permalink
add vps
Browse files Browse the repository at this point in the history
  • Loading branch information
PingHuskar committed Dec 6, 2023
1 parent add99b5 commit 46f0556
Show file tree
Hide file tree
Showing 11 changed files with 76,315 additions and 0 deletions.
101 changes: 101 additions & 0 deletions ingress/VPS/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
"use strict";

const searchParam = new URLSearchParams(location.search);
const agentname = `.*${searchParam.get(`agent`) ?? `secretarea`}.*`;
const filter = `${searchParam.get(`filter`) ?? `undone`}`
const banner = `${searchParam.get(`banner`) ?? ``}`;
const showPan = false
const LatLngToArrayString = (ll) => {
return `[${ll.lat.toFixed(5)}, ${ll.lng.toFixed(5)}]`;
};
const iconProps = {
iconSize: [38, 95],
iconAnchor: [22, 94],
popupAnchor: [-3, -76],
shadowSize: [68, 95],
shadowAnchor: [22, 94],
};

var map,
lyrOSM,
mrkCurrentLocation,
popExample,
ctlZoom,
ctlAttribute,
ctlScale,
ctlPan,
ctlZoomslider,
ctlMeasure;

var OpenStreetMap_Mapnik = L.tileLayer(
"https://tile.openstreetmap.org/{z}/{x}/{y}.png",
{
maxZoom: 19,
attribution:
'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
}
);
map = L.map(`mapdiv`, {
center: [13.765981, 100.570261],
zoom: 12,
zoomControl: false,
// dragging:false,
// minZoom:10,
// maxZoom:14
attributionControl: false,
layers: [OpenStreetMap_Mapnik],
});

ctlZoomslider = L.control.zoomslider({ position: "topright" }).addTo(map);
ctlMeasure = L.control.polylineMeasure().addTo(map);
ctlAttribute = L.control.attribution({ position: "bottomleft" }).addTo(map);
ctlAttribute.addAttribution(
`<a href="https://github.com/pinghuskar">Chadin Chaipornpisuth</a>`
);
ctlScale = L.control
.scale({
position: "bottomleft",
metric: false,
maxWidth: 200,
})
.addTo(map);

const AddDonut = (lat, lng, meter) => {
L.donut([lat, lng], {
radius: meter,
innerRadius: 0,
innerRadiusAsPercent: false,
}).addTo(map);
};
var LeafIcon = L.Icon.extend({
options: {
// shadowUrl: 'leaf-shadow.png',
iconSize: [50, 50],
shadowSize: [50, 64],
iconAnchor: [22, 94],
popupAnchor: [-3, -76],
},
});

let delay = 300
let c = []

const readJson500 = (filename) => {
axios.get(`data/${filename}.json`)
.then(res => res.data.pois)
.then((pois) => {
// console.log(pois)
for (const poi of pois) {
if (poi.state != `LIVE`) continue
console.log(poi)
L.marker([poi.lat,poi.lng])
.bindPopup(poi.title)
.bindTooltip(poi.title)
.addTo(map)
}
})
}

for (let i = 1; i < 10; i++) {
readJson500(i)
}
Loading

0 comments on commit 46f0556

Please sign in to comment.