node.js

17 views
Skip to first unread message

Benjamin Werlen

unread,
May 11, 2023, 4:42:39 AM5/11/23
to Leaflet
Hello. Is it possible to use node.js with Leaflet? Thanks:)

Sebastian Styczynski

unread,
May 11, 2023, 12:34:42 PM5/11/23
to Leaflet
It seems like you can! It is explained how to do it in this guide:  GitHub - renelikestacos/Web-Mapping-Leaflet-NodeJS-Tutorials: Web Mapping Tutorials using Leaflet and NodeJS

Bodo Minea

unread,
May 11, 2023, 5:20:18 PM5/11/23
to leafl...@googlegroups.com
Hi there,

It depends on what you want to do. While both Leaflet and NodeJS are Javascript based, Leaflet is mostly a frontend library used to render map tiles, markers and other geographical features, whereas NodeJS is a backend server framework.

You could use these two together in multiple ways:
- integrate Leaflet in your frontend pages, have your NodeJS output GeoJSON which is directly usable on Leaflet, if what you're interested is showing database/dynamic geographical features (lat lng points, shapes, etc.).
- have NodeJS serve custom tiles if you need a specific style or dataset for your background map tiles, eg.: https://github.com/rurseekatze/node-tileserver
- have NodeJS render ready-made images of map segments if you need to use these outside of a standard browser/Electron/etc use-case, eg.: https://www.npmjs.com/package/node-leaflet-image

If you have any questions you should further clarify the scope of your project a bit.

--

---
You received this message because you are subscribed to the Google Groups "Leaflet" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leaflet-js+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leaflet-js/6516e01b-5070-447d-b629-ab67a069e799n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages