• Почему Leaflet не хочет работать внутри блока content и прекрасно работает вне блока?

    @Petmaster Автор вопроса
    Прошу прощения, не было компа под рукой.

    Код шаблона: "basic.html"
    <!DOCTYPE html>
    <html>
    {% load bootstrap4 %}
    {% load static %}
    {% load leaflet_tags %}
    	<head>
    	{% leaflet_js %}
    	{% leaflet_css %}
    		<meta http-equiv="Content-Type"
    		content="text/html; charset=utf-8">
    		<meta name="viewport"
    		content="wigth=device-width, initial-scale=1, shrink-to-fit=no">
    		<title>{% block title %}Главная{% endblock %}</title>
    		{% bootstrap_css %}
    		<link rel="stylesheet" type="text/css"
    		href="{% static 'work/style.css' %}">
    		{% bootstrap_javascript jquery='slim' %}
    		<style type="text/css">
    			#gis{width: 70%; height: 800px;}
    		</style>
    		<link rel="stylesheet" href="{% static 'dist/leaflet.groupedlayercontrol.css' %}" />
    		<script type="text/javascript" src="{% static 'dist/leaflet.groupedlayercontrol.js' %}"></script>
    		<script type="text/javascript" src="{% static 'dist/leaflet.ajax.js' %}"></script>
    	</head>
    	<body class="container-fluid">
    		<header class="mb-4">
    			<h1 class="display-1 text-center">Имя сайта &quot;бла бла&quot;</h1>			
    		</header>
    		<div class="row">
    			<ul class="col nav justify-content-end border">
    				<li class="nav-item"><a class="nav-link"
    				href="#">Регистрация</a></li>
    				<li class="nav-item dropdown">
    				<a class="nav-link dropdown-toggle"
    				data-toggle="dropdown" href="#"
    				role="button" aria-haspopup="true"
    				aria-expanded="false">Профиль</a>
    				<div class="dropdown-menu">
    				<a class="dropdown-item" href="#">Мои карты</a>
    				<a class="dropdown-item" href="#">Изменить личные данные</a>
    				<a class="dropdown-item" href="#">Изменить пароль></a>
    				<div class="dropdown-divider"></div>
    				<a class="dropdown-item" href="#">Выйти</a>
    				<div class="dropdown-divider"></div>
    				<a class="dropdown-item" href="#">Удалить</a>
    				</div>
    				</li>
    				<li class="nav-item"><a class="nav-link" href="#">Вход<a/></li>
    			</ul>
    		</div>
    		<div class="row">
    			<nav class="col-md-auto nav flex-column border">
    				<a class="nav-link root"
    				href="{% url 'work:index' %}">Главная</a>	
    				<span class="nav-link root font-weight-bold">
    				Меню 1</span>
    				<a class="nav-link" href="#">Пункт 1</a>
    				<a class="nav-link" href="{% url 'work:basemap' %}">Пункт 2</a>
    				<span class="nav-link root font-weight-bold">
    				Меню 2</span>
    				<a class="nav-link" href="#">Пункт 1</a>
    				<a class="nav-link" href="#">Пункт 2</a>
    				<a class="nav-link root" href="#">
    				О сайте</a>
    			</nav>
    			<section class="col border py-2">
    				{% bootstrap_messages %}
    				{% block content %}{% endblock %}
    			</section>
    		</div>
    		<footer class="mt-3">
    			<p class="text-right font-italic">&copy; Моя компания</p>
    		</footer>
    	</body>
    </html>


    Код содержимого:
    {% extends "layout/basic.html" %}
    
    {% block title %}Карты{% endblock %}
    {% block content %}
    				<script type="text/javascript">		
    			function our_layers(map,options){
    				var osm = L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',{
    					maxZoom: 19,
    					attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
    					});
    				var OpenTopoMap = L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
    					maxZoom: 17,
    					attribution: 'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
    				});
    				
    				var datasets = new L.GeoJSON.AJAX("{% url 'datab' %}",{		
    								
    				});
    				
    				var datasets2 = new L.GeoJSON.AJAX("{% url 'data' %}",{						
    				
    				});	
    				
    				datasets.addTo(map);
    				datasets2.addTo(map);				
    		
    		
    			var baseLayers = {
    				"Base": osm,
    				"OpenTopoMap": OpenTopoMap
    				}
    				
    			var groupedOverlays = {
    				"Слои": {
    				"Слой 1": datasets,
    				"Слой 2": datasets2
    				}				
    			};
    		
    			L.control.groupedLayers(baseLayers, groupedOverlays).addTo(map);
    			
    			}), addTo(map);
    			
    		}				
    </script>		
    		 {% leaflet_map "gis" callback="window.our_layers" %}
    		 
    {% endblock %}


    Текст ошибки:

    Invalid block tag on line 240: 'leaflet_map', expected 'endblock'. Did you forget to register or load this tag?

    237
    238 }
    239
    240 {% leaflet_map "gis" callback="window.our_layers" %}
    241 {% endblock %}
    242