mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
list notes
This commit is contained in:
parent
0f5ff6ed45
commit
cb90be8ff2
10 changed files with 119 additions and 36 deletions
|
@ -36,10 +36,12 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th>Nom ({{ stats.getPlacesCount() }})</th>
|
||||
<th>Type</th>
|
||||
<th>Adresse ({{ stats.getAvecAdresse() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Site web ({{ stats.getAvecSite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Accessibilité ({{ stats.getAvecAccessibilite() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Note ({{ stats.getAvecNote() }} / {{ stats.getPlacesCount() }})</th>
|
||||
<th>Note ({{ stats.getAvecNote() }} / {{ stats.getPlacesCount() }})</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -48,10 +50,12 @@
|
|||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">
|
||||
<a href="{{ path('app_admin_commerce', {'id': commerce.id}) }}">{{ commerce.name }}</a>
|
||||
</td>
|
||||
<td style="background-color: {{ commerce.mainTag ? 'yellowgreen' : 'transparent' }};">{{ commerce.mainTag }}</td>
|
||||
<td style="background-color: {{ commerce.hasAddress() ? 'yellowgreen' : 'transparent' }};">{{ commerce.address }}</td>
|
||||
<td style="background-color: {{ commerce.hasWebsite() ? 'yellowgreen' : 'transparent' }};">{{ commerce.website }}</td>
|
||||
<td style="background-color: {{ commerce.hasWheelchair() ? 'yellowgreen' : 'transparent' }};">{{ commerce.wheelchair }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.note }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.note }}</td>
|
||||
<td style="background-color: {{ commerce.hasNote() ? 'yellowgreen' : 'transparent' }};">{{ commerce.noteContent }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -88,9 +92,15 @@
|
|||
});
|
||||
|
||||
map.on('load', () => {
|
||||
console.log(data.elements);
|
||||
console.log('map chargé',data.elements);
|
||||
data.elements.forEach(element => {
|
||||
if (element.lat && element.lon) {
|
||||
if(element.tags){
|
||||
|
||||
console.log('element', element.tags['name'] , element);
|
||||
}
|
||||
|
||||
if (element.lat && element.lon && element.tags && element.tags['name']) {
|
||||
|
||||
const el = document.createElement('div');
|
||||
el.className = 'marker';
|
||||
el.style.width = '20px';
|
||||
|
@ -105,10 +115,26 @@
|
|||
}
|
||||
tagstable += '</table>';
|
||||
|
||||
// Créer un élément div pour le texte du nom
|
||||
const nameDiv = document.createElement('div');
|
||||
nameDiv.className = 'marker-name';
|
||||
nameDiv.style.position = 'absolute';
|
||||
nameDiv.style.backgroundColor = 'white';
|
||||
nameDiv.style.padding = '2px 5px';
|
||||
nameDiv.style.borderRadius = '3px';
|
||||
nameDiv.style.fontSize = '12px';
|
||||
nameDiv.style.whiteSpace = 'nowrap';
|
||||
nameDiv.style.transform = 'translate(-50%, -150%)';
|
||||
nameDiv.textContent = element.tags?.name || 'Sans nom';
|
||||
el.appendChild(nameDiv);
|
||||
|
||||
new maplibregl.Marker(el)
|
||||
.setLngLat([element.lon, element.lat])
|
||||
.setPopup(new maplibregl.Popup({ offset: 25 })
|
||||
.setHTML(`<a href="https://openstreetmap.org/${element.type}/${element.id}" target="_blank"><h3>${element.tags?.name || 'Sans nom'}</h3></a> <br> ${tagstable}`))
|
||||
.setHTML(
|
||||
`<a href="/admin/placeType/${element.type}/${element.id}" ><h3>${element.tags?.name || 'Sans nom'}</h3></a> <br><a href="https://openstreetmap.org/${element.type}/${element.id}" target="_blank">OSM</a> ${tagstable}`
|
||||
)
|
||||
)
|
||||
.addTo(map);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue