Questions tagged [django-leaflet]

38 questions
2
votes
2 answers

How to add more than one django-leaflet map in a view?

I was able to show a map on a single page using django-leaflet. In another page, I am trying to show two (or more) maps in page but I couldn't figure out how. For showing map in a single page:
{% leaflet_map "main"…
Musa Biralo
  • 479
  • 1
  • 5
  • 16
1
vote
2 answers

Django leaflet marker icon doesn't appear on Heroku

I have deployed my Django app to Heroku but when I want to fill the location field, the marker icon doesn't appear even though I have used whitenoise to serve the static files. It is working locally though. This is the Here's how I set my…
Agung
  • 133
  • 10
1
vote
0 answers

How to set leaflet map layer selected as default

In my Django app I have a leaflet map with two layers "active_event_layer" and "inactive_event_layer". I can select which layer I want to see in the top right menu. But when the page is loaded no layer is selected by default, so in order to see a…
Ernesto Ruiz
  • 736
  • 9
  • 31
1
vote
1 answer

How to add event to LeafletWidget in django-leaflet?

In my django app I have a Worker model with a name and location (Point). Using django-leflet LeafletWidget I can create a Form where the user can set a location (marker to that worker). Is it possible to add an event to the widget, so, every time…
Ernesto Ruiz
  • 736
  • 9
  • 31
1
vote
0 answers

How to add markers and send the locations to postgres/postgis database in django-leaflet

I added a django-leaflet map to display place markers. I couldn't display the markers as click events and send these to postgres/postgis database. I used django-leaflet forms to input the data. I wonder how I could display the place markers as well…
Kaleab Woldemariam
  • 2,567
  • 4
  • 22
  • 43
1
vote
2 answers

Display multiple polygon on Django admin

I have a model with a gis_models.GeometryField. class MyModel(django.db.models): area = gis_models.GeometryField(null=True, blank=True) I'm displaying this model on Django admin but i'm using https://github.com/makinacorpus/django-leaflet…
abubakr
  • 11
  • 3
1
vote
3 answers

Issue with Geodjango OGR failure - GDAL Exception

I have made it to which the model in django is built, but once adding data and clicking save my app crash i get GDAL exception - OGR Failure, and it highlights in the crash page " {{ field.field }}" as the reason for the error. here's screen…
kiwis
  • 65
  • 1
  • 9
1
vote
0 answers

Passing leaflet map object to a event

i am using leaflet to display map in django template. i give latitude, longitude and radius and filter results based on that and try to add marker to map. how ever i couldnt create map markers since i dont know how to pass map object to event and…
Ashok
  • 976
  • 3
  • 15
  • 32
1
vote
0 answers

problems in constructing webmap using django leaflet with the data in database

I have done my leaflet program using django-leaflet but the map is not displaying anything in output Here is the code models.py from django.db import models from django.contrib.gis.db import models as gismodels class MushroomSpot(gismodels.Model): …
0
votes
0 answers

How to set bounds to combination of two point features in leaflet

I am creating an app with django, geodjango and Leaflet, I am also using django-geojson and django-leaflet. I manage to insert on a map two features that contain points. But i am getting problems setting the bounds for that map. Since I am adding…
Ernesto Ruiz
  • 736
  • 9
  • 31
0
votes
0 answers

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

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…
kysevenle
  • 63
  • 1
  • 6
0
votes
1 answer

Django admin inline conditioned on model field values

I'm trying to show one of three different child model inlines for a parent model, based on a selected field value within the parent model. I have tried every solution that pops up from various google searches but nothing seems to work. First a…
fishdata
  • 113
  • 6
0
votes
1 answer

Django-leaflet: map getBounds returning [object Object]

I am using django-leaflet to display a map in a template, where the goal is to only display the coordinates of the visible area of the map when the user moves the map. For this I'm using the getBounds() method, but the function only returns [Object…
Rafael Sá
  • 21
  • 4
0
votes
1 answer

Django Leaflet: Add form fields for latitude and longitude

I am using the django-leaflet package to display the map in the django admin for a PointField. However, I wanted to put fields so that it would be possible to write the latitude and longitude, as an alternative to selecting the point on the map. How…
Rafael Sá
  • 21
  • 4
0
votes
0 answers

How to get a reference to the already loaded leaflet map in Djano's admin page using Django-leaflet

I'm trying to add markers to the leaflet map loaded in Django's admin pages with data retrieved from an ajax call. However I cannot get a reference to the map that I can use in my template used to override the Django admin template. If I load the…
kysevenle
  • 63
  • 1
  • 6
1
2 3