Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Django and LeafletJS - Interactive Maps, Map Events, and Finding Closest Points with GeoPy

Автор: BugBytes

Загружено: 2023-02-06

Просмотров: 26479

Описание:

📚 Geospatial Python Playlist:    • Geospatial Python  
☕ Buy a coffee: https://ko-fi.com/bugbytes

In this video, we learn how to integrate Leaflet.js maps in a Django application. We will learn:

1. How to plot markers from database data that's been dumped to JSON with Django's json_script template-filter.
2. How to dynamically add markers to a map on the map's click event
3. How to send coordinates to our Django server via AJAX requests and find the closest point to the give coordinates, using GeoPy and the geodesic function
4. How to draw a line between user location and the nearest station with Leaflet's PolyLine
5. How to display a popup on the Leaflet map

📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
00:44 Including leaflet.js in a Django application
05:05 Fetching location data from the database
06:37 Dumping database data to JSON with Django’s json_script template-filter
07:27 Parsing JSON data into JavaScript objects with JSON.parse() function
08:12 Plotting Markers on a Leaflet map
09:30 Performing actions on Leaflet map click event
11:01 Dynamically adding marker on map click event
12:26 Sending AJAX request to Django when map is clicked
14:07 Handing AJAX request on our Django server
15:42 Finding nearest EV station to the user location using GeoPy
19:28 Processing JSON response with JavaScript
20:32 Drawing line between user location and nearest station with Leaflet PolyLine
23:00 Adding Leaflet Popup showing distance to nearest station

☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes

𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://www.bugbytes.io/posts/
👾 Github: https://github.com/bugbytes-io/django...

📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Starter Code: https://github.com/bugbytes-io/django...
LeafletJS Download: https://leafletjs.com/download.html
LeafletJS Quick Start: https://leafletjs.com/examples/quick-...
json_script video:    • Passing Backend Data to JavaScript - json_...  
“How to Safely Pass Data to JavaScript in a Django Template” [Adam Johnson] https://adamj.eu/tech/2022/10/06/how-...

#python #django #gis #mapping #datascience

Django and LeafletJS - Interactive Maps, Map Events, and Finding Closest Points with GeoPy

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Django & HTMX - Dynamic Form Creation and Submission

Django & HTMX - Dynamic Form Creation and Submission

Декораторы Python — наглядное объяснение

Декораторы Python — наглядное объяснение

Я в опасности

Я в опасности

Django-Filter - Filtering Django Querysets, Class-Based Views and REST Framework Integration

Django-Filter - Filtering Django Querysets, Class-Based Views and REST Framework Integration

Django 6.0 - Революция в шаблонах! Как Partials и HTMX чистят ваш код

Django 6.0 - Революция в шаблонах! Как Partials и HTMX чистят ваш код

Django and HTMX #21 - WebSocket Notifications with the HTMX WebSocket Extension and django-channels

Django and HTMX #21 - WebSocket Notifications with the HTMX WebSocket Extension and django-channels

Claude Code: полный гайд по AI-кодингу (хаки, техники и секреты)

Claude Code: полный гайд по AI-кодингу (хаки, техники и секреты)

Kubernetes — Простым Языком на Понятном Примере

Kubernetes — Простым Языком на Понятном Примере

How to use GeoDjango (import GIS shapefile with Python)

How to use GeoDjango (import GIS shapefile with Python)

NotebookLM на максималках: 4 расширения, которые экономят дни!

NotebookLM на максималках: 4 расширения, которые экономят дни!

Pro Django - Tutorial 1 - Project Structure, Poetry, Makefile, and Settings Management

Pro Django - Tutorial 1 - Project Structure, Poetry, Makefile, and Settings Management

Django 6 — частичные шаблоны теперь в Django Core! (идеально для HTMX и Alpine.js!)

Django 6 — частичные шаблоны теперь в Django Core! (идеально для HTMX и Alpine.js!)

ПЕРЕСТАНЬ ПЛАТИТЬ за Cursor AI. Используй эту БЕСПЛАТНУЮ и ЛОКАЛЬНУЮ альтернативу | VSCode+Roo Code

ПЕРЕСТАНЬ ПЛАТИТЬ за Cursor AI. Используй эту БЕСПЛАТНУЮ и ЛОКАЛЬНУЮ альтернативу | VSCode+Roo Code

Анатомия масштабируемого проекта Python (FastAPI)

Анатомия масштабируемого проекта Python (FastAPI)

КАК УСТРОЕН TCP/IP?

КАК УСТРОЕН TCP/IP?

Red Smoke — Deep House Chill Mix 2026 | Night Vibes

Red Smoke — Deep House Chill Mix 2026 | Night Vibes

Картирование текущего местоположения пользователя с помощью Leaflet.js и OpenStreetMap — Учебное ...

Картирование текущего местоположения пользователя с помощью Leaflet.js и OpenStreetMap — Учебное ...

Django and LeafletJS - Dynamic Map Updates with AJAX Polling Requests

Django and LeafletJS - Dynamic Map Updates with AJAX Polling Requests

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

Вся IT-база в ОДНОМ видео: Память, Процессор, Код

django-htmx - Django Extensions for Working with HTMX

django-htmx - Django Extensions for Working with HTMX

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com