Django-leaflet trying to load a bunch of js files from a non-existent static/src directory

83 views Asked by At

I'm using Django-leaflet in my project. When loading a page it's trying to load a bunch of js files from a static/src directory.

static/src/core...

static/src/geometry...

static/src/control...

static/src/layer...

and others

I don't know why it is trying to load these files. I don't see anything in the documentation about why I should have a static/src directory.

I have a working page that loads a leaflet map, adds layer control, adds markers, and functions. However I am running into errors when adding new functionality. I'm not sure if these missing js files are causing it. To isolate what was trying to load these files I made a barebones page that all it does is loads leaflet_tags and leaflet_js which results in attempting to load all these js files.

{% load leaflet_tags %}

<head>
    {% leaflet_js %}
</head>

Any help would be appreciated.

1

There are 1 answers

0
Juan Ma On

My workaround for now is just ignore the {% leaflet_js %} and import it manually like:

<script src="https://unpkg.com/[email protected]/dist/leaflet.js" crossorigin=""></script>

I know that seems I waste of using django-leaflet but the {% leaflet_map "main" %} tags is still useful to me.