chore: cleanup

This commit is contained in:
Tykayn 2023-03-02 09:53:23 +01:00 committed by tykayn
parent e275e0d7dc
commit 6befa9a53b
6 changed files with 36 additions and 106 deletions

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false

6
app.vue Normal file
View File

@ -0,0 +1,6 @@
<template>
<div>
coucou!
<about></about>
</div>
</template>

2
nuxt.config.ts Normal file
View File

@ -0,0 +1,2 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({})

View File

@ -1,81 +1,18 @@
<template>
<div class="section">
<h1>Restos</h1>
une carte présentant des restaurants sur Leaflet. Demande sur overpass api
<p>
<a :href="requestData">
{{ requestData }}
</a>
</p>
<div v-if="RestosPoints.elements" style="height: 75vh; width: 50vw">
<!-- <l-map v-model="zoom" :zoom="zoom" :center="[BBOX.X, BBOX.Y]">-->
<!-- <l-tile-layer-->
<!-- url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"-->
<!-- ></l-tile-layer>-->
<!-- </l-map>-->
</div>
<ul v-if="RestosPoints.elements">
<span v-for="elem in RestosPoints.elements" class="button is-info marged">
<div v-if="elem.tags">
{{ elem.tags.name }} -
<!-- <div v-if="elem.tags.cuisine">cuisine: {{ elem.tags.cuisine }}</div>-->
</div>
<!-- {{ elem.lat }}-->
<!-- {{ elem.lon }}-->
</span>
<div>
<h2>{{ RestosPoints.elements.length }} Restaurants dans le secteur</h2>
</div>
<li v-for="elem in RestosPoints.elements">
<div v-if="elem.tags">
nom: {{ elem.tags.name }}
<br />
ville: {{ elem.tags['addr:city'] }}
<div v-if="elem.tags.cuisine">cuisine: {{ elem.tags.cuisine }}</div>
</div>
<br />lat:
{{ elem.lat }}
<br />lon: {{ elem.lon }}
</li>
</ul>
<iframe
src="https://www.cipherbliss.com/ou-manger/index.html"
frameborder="0"
width="800"
height="1600"
></iframe>
</div>
</template>
<script>
import { LMap, LMarker, LTileLayer } from '@vue-leaflet/vue-leaflet'
import 'leaflet/dist/leaflet.css'
import RestosPoints from '../mocks/restos_overpass.json'
const BBOX = {
X: 48.6605988,
Y: 2.2420476,
}
const baseApi = 'https://overpass-api.de/api/'
const requestData = `https://overpass-api.de/api/interpreter?data=%2F*%0AThis+has+been+generated+by+the+overpass-turbo+wizard.%0AThe+original+search+was%3A%0A%E2%80%9Crestaurant%E2%80%9D%0A*%2F%0A%5Bout%3Ajson%5D%5Btimeout%3A25%5D%3B%0A%2F%2F+gather+results%0A(%0A++%2F%2F+query+part+for%3A+%E2%80%9Crestaurant%E2%80%9D%0A++node%5B%22amenity%22%3D%22restaurant%22%5D(48.62088169353486%2C2.13134765625%2C48.6817808659474%2C2.312450408935547)%3B%0A++way%5B%22amenity%22%3D%22restaurant%22%5D(48.62088169353486%2C2.13134765625%2C48.6817808659474%2C2.312450408935547)%3B%0A++relation%5B%22amenity%22%3D%22restaurant%22%5D(48.62088169353486%2C2.13134765625%2C48.6817808659474%2C2.312450408935547)%3B%0A)%3B%0A%2F%2F+print+results%0Aout+body%3B%0A%3E%3B%0Aout+skel+qt%3B`
const url = baseApi + requestData
export default {
components: {
LMap,
LTileLayer,
LMarker,
},
data() {
return {
RestosPoints,
BBOX,
iconWidth: 25,
iconHeight: 40,
zoom: 14,
baseApi,
requestData,
requestUrl: url,
}
return {}
},
callOverpass() {},
}
</script>
@ -83,6 +20,7 @@ export default {
.marged {
margin: 0.5em;
}
.button {
padding: 1em;
}

View File

@ -1,18 +0,0 @@
export const state = () => ({
list: [],
});
export const mutations = {
add(state, text) {
state.list.push({
text,
done: false,
});
},
remove(state, { todo }) {
state.list.splice(state.list.indexOf(todo), 1);
},
toggle(state, todo) {
todo.done = !todo.done;
},
};

View File

@ -30,27 +30,27 @@ export const mutations = {
})
},
remove(state, { todo }) {
state.list.splice(state.list.indexOf(todo), 1);
state.list.splice(state.list.indexOf(todo), 1)
},
setFormField(state, { field }) {
state.formConfig[state.formConfig.indexOf(field)] = field;
state.formConfig[state.formConfig.indexOf(field)] = field
},
setFetchedDataOsm(state, { data }) {
state.fetchedData.osm_data = data;
state.fetchedData.osm_data = data
},
setFetchedDataAddok(state, { data }) {
state.fetchedData.addok_data = data;
state.fetchedData.addok_data = data
},
setTag(state, { field }) {
state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field;
state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field
},
setSelectedResult(state, { data }) {
state.selectedResult = data;
state.selectedResult = data
},
setFetching(state, { data }) {
state.isFetching = data;
state.isFetching = data
},
setAllTag(state, { tags }) {
state.formConfig.tags = tags;
state.formConfig.tags = tags
},
}