Skip to content
Snippets Groups Projects
Verified Commit 81d7cc7f authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Externalise script for map.

parent e9c6de94
No related branches found
No related tags found
No related merge requests found
function map_init(map, options) {
$.getJSON(geojson, function (data) {
L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.popupContent);
}
}).addTo(map);
});
}
{% extends "ticdesk_org/base.html" %}
{% load bootstrap3 i18n leaflet_tags %}
{% load bootstrap3 i18n leaflet_tags staticfiles %}
{% block person_content %}
<h2>{{ Karte }}</h2>
{% leaflet_map "map" callback="map_init" %}
<script type="text/javascript">
function map_init(map, options) {
var dataurl = '{{ geojson }}';
$.getJSON(dataurl, function (data) {
L.geoJson(data, {
onEachFeature: function (feature, layer) {
layer.bindPopup(feature.properties.popupContent);
}
}).addTo(map);
});
}
</script>
<script type="text/javascript">var geojson = '{{ geojson }}';</script>
<script type="text/javascript" src="{% static 'ticdesk_org/map.js' %}"></script>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment