Update map app (location, migrations and templates)
This commit is contained in:
29
apps/map/templates/map/index.html
Normal file
29
apps/map/templates/map/index.html
Normal file
@ -0,0 +1,29 @@
|
||||
{% load i18n %}
|
||||
{% load leaflet_tags %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% trans "Ojuso Platform Map" %}</title>
|
||||
{% leaflet_js %}
|
||||
{% leaflet_css %}
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ojuso Platform Map</h1>
|
||||
{% leaflet_map "main" callback="main_app_init" %}
|
||||
<script src="https://code.jquery.com/jquery-3.2.1.min.js"
|
||||
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
|
||||
crossorigin="anonymous">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function main_app_init(map, options) {
|
||||
var dataurl = '{% url "data" %}';
|
||||
// Download GeoJSON
|
||||
$.getJSON(dataurl, function (data) {
|
||||
L.geoJson(data).addTo(map);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user