-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
add99b5
commit 46f0556
Showing
11 changed files
with
76,315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
'© <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) | ||
} |
Oops, something went wrong.