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> <template>
<div class="section"> <div class="section">
<h1>Restos</h1> <iframe
src="https://www.cipherbliss.com/ou-manger/index.html"
une carte présentant des restaurants sur Leaflet. Demande sur overpass api frameborder="0"
width="800"
<p> height="1600"
<a :href="requestData"> ></iframe>
{{ 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>
</div> </div>
</template> </template>
<script> <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 { export default {
components: {
LMap,
LTileLayer,
LMarker,
},
data() { data() {
return { return {}
RestosPoints,
BBOX,
iconWidth: 25,
iconHeight: 40,
zoom: 14,
baseApi,
requestData,
requestUrl: url,
}
}, },
callOverpass() {},
} }
</script> </script>
@ -83,6 +20,7 @@ export default {
.marged { .marged {
margin: 0.5em; margin: 0.5em;
} }
.button { .button {
padding: 1em; 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

@ -2,20 +2,20 @@
* see VueX docs * see VueX docs
*/ */
export const state = () => ({ export const state = () => ({
counter : 0, counter: 0,
isFetching : false, isFetching: false,
searchInput : 'librairie interlignes', searchInput: 'librairie interlignes',
selectedResult: null, selectedResult: null,
fetchedData : { fetchedData: {
osm_data : '', osm_data: '',
addok_data: '', addok_data: '',
}, },
list : [], list: [],
formConfig : { formConfig: {
name : '', name: '',
delivery: false, delivery: false,
hours : ['a', 'b'], hours: ['a', 'b'],
tags : [], tags: [],
}, },
}) })
@ -30,27 +30,27 @@ export const mutations = {
}) })
}, },
remove(state, { todo }) { remove(state, { todo }) {
state.list.splice(state.list.indexOf(todo), 1); state.list.splice(state.list.indexOf(todo), 1)
}, },
setFormField(state, { field }) { setFormField(state, { field }) {
state.formConfig[state.formConfig.indexOf(field)] = field; state.formConfig[state.formConfig.indexOf(field)] = field
}, },
setFetchedDataOsm(state, { data }) { setFetchedDataOsm(state, { data }) {
state.fetchedData.osm_data = data; state.fetchedData.osm_data = data
}, },
setFetchedDataAddok(state, { data }) { setFetchedDataAddok(state, { data }) {
state.fetchedData.addok_data = data; state.fetchedData.addok_data = data
}, },
setTag(state, { field }) { setTag(state, { field }) {
state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field; state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field
}, },
setSelectedResult(state, { data }) { setSelectedResult(state, { data }) {
state.selectedResult = data; state.selectedResult = data
}, },
setFetching(state, { data }) { setFetching(state, { data }) {
state.isFetching = data; state.isFetching = data
}, },
setAllTag(state, { tags }) { setAllTag(state, { tags }) {
state.formConfig.tags = tags; state.formConfig.tags = tags
}, },
} }