diff --git a/apis_core/apis_entities/static/js/E53_Place_detail_map.js b/apis_core/apis_entities/static/js/E53_Place_detail_map.js new file mode 100644 index 000000000..60ca9bc4c --- /dev/null +++ b/apis_core/apis_entities/static/js/E53_Place_detail_map.js @@ -0,0 +1,13 @@ +document.addEventListener('DOMContentLoaded', function() { + mapel = document.getElementById("map"); + if (mapel) { + var markercontent = mapel.innerHTML; + var map = L.map('map').setView([mapel.dataset.latitude, mapel.dataset.longitude], 13); + + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' + }).addTo(map); + + L.marker([mapel.dataset.latitude, mapel.dataset.longitude]).addTo(map).bindPopup(markercontent).openPopup(); + } +}); diff --git a/apis_core/apis_entities/templates/apis_core/apis_entities/e53_place_detail.html b/apis_core/apis_entities/templates/apis_core/apis_entities/e53_place_detail.html new file mode 100644 index 000000000..a21a43409 --- /dev/null +++ b/apis_core/apis_entities/templates/apis_core/apis_entities/e53_place_detail.html @@ -0,0 +1,24 @@ +{% extends "apis_core/apis_entities/abstractentity_detail.html" %} +{% load static %} + +{% block scripts %} + {{ block.super }} + +{% endblock %} + +{% block col-zero %} +
{{ object }} | + {% endif %} +