Skip to content

Commit

Permalink
DBApp url redirected to opendem
Browse files Browse the repository at this point in the history
  • Loading branch information
gorkemkurban committed Nov 26, 2024
1 parent 8e8ea15 commit d3f70f0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DBApp/script.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
document.addEventListener('DOMContentLoaded', () => {
const jsonUrl = '../Apps/Data/denkmaeler.json'; // JSON dosyanızın URL'sini buraya ekleyin
const jsonUrl = 'https://opendem.info/cgi-bin/getDenkmal.py'; // JSON dosyanızın URL'sini buraya ekleyin
let data = [];
let sortOrder = {
denkmallistennummer: 'asc',
Expand All @@ -8,13 +8,21 @@ document.addEventListener('DOMContentLoaded', () => {
};

fetch(jsonUrl)
.then(response => response.json())
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.json();
})
.then(json => {
data = json.features;
// İlk başta "denkmallistennummer" değerine göre sıralama
data.sort((a, b) => sortByDenkmallistennummer(a, b, 'asc'));
populateCategories(data);
displayResults(data);
})
.catch(error => {
console.error('Veri alınırken bir hata oluştu:', error);
});

document.getElementById('search-button').addEventListener('click', () => {
Expand Down

0 comments on commit d3f70f0

Please sign in to comment.