Skip to content

Commit

Permalink
Fetch local json file (refs #59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sefux committed Jan 19, 2022
1 parent 408a58a commit ded873f
Show file tree
Hide file tree
Showing 3 changed files with 1,112 additions and 5 deletions.
17 changes: 12 additions & 5 deletions components/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,19 @@ export default {
// this.$router.push('/')
this.data_url = this.default_data_url
}
console.log(this.data_url)
// check local content
var dataobj_temp = await this.$content(this.localDataUrl).fetch();
this.dataobj = dataobj_temp[0];
this.dataobj = await axios.get(this.data_url).then(response =>
response.data
)
console.log('fetch... success')
console.log('fetch LOCAL...')
console.log(this.dataobj)
if(this.dataobj == {} && (this.dataobj.map || this.dataobj.layer)) {
this.dataobj = await axios.get(this.data_url).then(response =>
response.data
)
console.log('fetch REMOTE... ')
console.log(this.dataobj)
}
// check if its a map
if ( this.dataobj.map ) {
Expand Down
Loading

0 comments on commit ded873f

Please sign in to comment.