p4n + wallets
This commit is contained in:
parent
c253cae4d0
commit
e53d7c70d3
|
@ -277,6 +277,16 @@ for UMAP in ${unique_combined[@]}; do
|
||||||
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
|
## GET 100KM GCHANGE ADS ( https://data.gchange.fr )
|
||||||
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
|
${MY_PATH}/../tools/gchange_get_50km_around_LAT_LON_ads.sh ${LAT} ${LON} > ~/.zen/tmp/${MOATS}/${UMAP}/gchange50.json
|
||||||
|
|
||||||
|
## GET WALLETS
|
||||||
|
echo "* GET WALLETS https://g1-stats.axiom-team.fr/data/geoloc-members.json"
|
||||||
|
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json ]] && touch ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json
|
||||||
|
[[ ! -s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ]] \
|
||||||
|
&& curl -s "https://g1-stats.axiom-team.fr/data/geoloc-members.json" -o ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json \
|
||||||
|
&& [[ $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json) -gt $(stat -c %s ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json) ]] \
|
||||||
|
&& mv ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json ~/.zen/tmp/${MOATS}/${UMAP}/wallets.json \
|
||||||
|
&& echo "UPDATED WALLETS" \
|
||||||
|
|| rm ~/.zen/tmp/${MOATS}/${UMAP}/fetch.json
|
||||||
|
|
||||||
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
|
echo "MAKING _index.p4n.html with ./templates/P4N/index.html"
|
||||||
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
|
## CREATE INDEX LOADING JSONs ON OPENSTREETMAP
|
||||||
cat ${MY_PATH}/../templates/P4N/index.html \
|
cat ${MY_PATH}/../templates/P4N/index.html \
|
||||||
|
|
|
@ -46,33 +46,70 @@ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
attribution: '© OpenStreetMap contributors'
|
attribution: '© OpenStreetMap contributors'
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
|
|
||||||
// Fetch JSON data
|
// Fetch wallets data
|
||||||
axios.get('./p4n.json')
|
axios.get('./wallets.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const places = response.data;
|
const places = response.data;
|
||||||
|
|
||||||
// Iterate through places and add markers to the map
|
// Initialize Leaflet map
|
||||||
|
const map = L.map('map').setView([0, 0], 2); // Set initial view and zoom level
|
||||||
|
|
||||||
|
// Add a tile layer to the map (you can choose your preferred tile layer)
|
||||||
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
|
attribution: '© OpenStreetMap contributors'
|
||||||
|
}).addTo(map);
|
||||||
|
|
||||||
|
// Iterate through JSON
|
||||||
places.forEach(place => {
|
places.forEach(place => {
|
||||||
const { lat, lng, title_short, description, images, services, activities } = place;
|
const { geoPoint, title, description, socials } = place;
|
||||||
const marker = L.marker([lat, lng]).addTo(map);
|
const { lat, lon } = geoPoint;
|
||||||
// Create a popup content
|
|
||||||
const popupContent = `
|
|
||||||
<b>${title_short}</b><br>
|
|
||||||
${description}<br>
|
|
||||||
<b>Services:</b> ${services.join(', ')}<br>
|
|
||||||
<b>Activities:</b> ${activities.join(', ')}<br>
|
|
||||||
<a href="#" onclick="goToLocation(${lat}, ${lng})">Zoom In</a>
|
|
||||||
`;
|
|
||||||
|
|
||||||
// Bind popup to the marker
|
// Create a marker on the map
|
||||||
marker.bindPopup(popupContent);
|
const marker = L.marker([lat, lon]).addTo(map);
|
||||||
|
|
||||||
|
// Create a popup content
|
||||||
|
const popupContent = `
|
||||||
|
<b>${title}</b><br>
|
||||||
|
${description}<br>
|
||||||
|
<a href="${socials[0].url}" target="_blank">Visit Website</a>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Bind popup to the marker
|
||||||
|
marker.bindPopup(popupContent);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('Error fetching JSON data:', error);
|
console.error('Error fetching JSON data:', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Fetch p4n data
|
||||||
|
axios.get('./p4n.json')
|
||||||
|
.then(response => {
|
||||||
|
const p4nPlaces = response.data;
|
||||||
|
|
||||||
|
// Iterate through p4n data
|
||||||
|
p4nPlaces.forEach(place => {
|
||||||
|
const { lat, lng, title_short, description, services, activities } = place;
|
||||||
|
const marker = L.marker([lat, lng]).addTo(map);
|
||||||
|
|
||||||
|
// Create a popup content
|
||||||
|
const popupContent = `
|
||||||
|
<b>${title_short}</b><br>
|
||||||
|
${description}<br>
|
||||||
|
<b>Services:</b> ${services.join(', ')}<br>
|
||||||
|
<b>Activities:</b> ${activities.join(', ')}<br>
|
||||||
|
<a href="#" onclick="goToLocation(${lat}, ${lng})">Zoom In</a>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Bind popup to the marker
|
||||||
|
marker.bindPopup(popupContent);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching p4n JSON data:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function goToLocation(lat, lng) {
|
function goToLocation(lat, lng) {
|
||||||
// Switch to ArcGIS World Imagery basemap
|
// Switch to ArcGIS World Imagery basemap
|
||||||
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
||||||
|
@ -86,20 +123,22 @@ axios.get('./p4n.json')
|
||||||
// Fetch JSON data for rolling text
|
// Fetch JSON data for rolling text
|
||||||
axios.get('gchange50.json')
|
axios.get('gchange50.json')
|
||||||
.then(response => {
|
.then(response => {
|
||||||
|
const ids = response.data.hits.hits.map(hit => hit._id);
|
||||||
|
//
|
||||||
const titles = response.data.hits.hits.map(hit => hit._source.title);
|
const titles = response.data.hits.hits.map(hit => hit._source.title);
|
||||||
displayRollingText(titles);
|
displayRollingText(titles, ids);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('Error fetching rolling text JSON data:', error);
|
console.error('Error fetching rolling text JSON data:', error);
|
||||||
});
|
});
|
||||||
|
|
||||||
function displayRollingText(titles) {
|
function displayRollingText(titles, ids) {
|
||||||
const rollingTextContainer = document.getElementById('rollingText');
|
const rollingTextContainer = document.getElementById('rollingText');
|
||||||
let currentIndex = 0;
|
let currentIndex = 0;
|
||||||
|
|
||||||
function updateText() {
|
function updateText() {
|
||||||
rollingTextContainer.textContent = titles[currentIndex];
|
rollingTextContainer.innerHTML = `<a href="https://data.gchange.fr/market/record/${ids[currentIndex]}/_share">${titles[currentIndex]}</a>`;
|
||||||
currentIndex = (currentIndex + 1) % titles.length;
|
currentIndex = (currentIndex + 1) % titles.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval(updateText, 3000); // Change text every 3 seconds (adjust as needed)
|
setInterval(updateText, 3000); // Change text every 3 seconds (adjust as needed)
|
||||||
|
|
|
@ -488,7 +488,7 @@ if [[ $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## https://git.p2p.legal/qo-op/OSM2IPFS
|
## https://git.p2p.legal/qo-op/OSM2IPFS
|
||||||
EARTHCID="/ipfs/QmYGS24WxVbsmmQfqWohXhXQZiwSmNswhTtSj9msVWKkNh"
|
EARTHCID="/ipfs/QmUY7FAEnfrXPb3MdnH7EzQMHsdk7gNSkiZ9irnphTa4ct"
|
||||||
FLIPPERCID="${EARTHCID}/coinflip" ### EASTER EGG
|
FLIPPERCID="${EARTHCID}/coinflip" ### EASTER EGG
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
|
|
Loading…
Reference in New Issue