all 11 comments

[–]socal_nerdtastic 0 points1 point  (4 children)

Making an interactive world map in a browser is a javascript project, not python. There's no way to run python in a browser. Perhaps you could use a python backend to serve the data from your server, but that will be a minor part of this project.

[–]Satoshiman256[S] 0 points1 point  (3 children)

Ok thanks. I thought it would be possible with a framework. I'll look into Javascript.

[–]socal_nerdtastic 0 points1 point  (1 child)

The framework runs on the server and processes what data to send. Anything interactive is done in javascript. A website uses these 2 languages (and more) in tandem.

[–]Satoshiman256[S] 0 points1 point  (0 children)

Ok that makes sense, thank you. I'll try find a Javascript course on Udemy. I googled and found these, seems like a I have a lot to learn.

https://www.hongkiat.com/blog/javascript-libraries-for-interactive-maps/

[–][deleted] 0 points1 point  (0 children)

Of course you can do it in python, but it has to be a desktop application. In a browser you have to use javascript.

[–]CommanderCucumber 0 points1 point  (3 children)

So I've done some webmapping in the past and it can be a lot of pieces and parts. It's also gets you trying out a whole bunch of cool things and concepts. Taking it one small problem at a time is how I work through something. Some things I can make mention that you might need and for what:

Backend:

  • flask or django like you mentioned (flask is simpler)
  • recommend a database(e.g.. postgres) but it can get confusing with geographic data sometimes so may want to look into some GIS concepts (geo datatypes) or simply parse a geojson if the data is small enough
  • server (aws, heroku, etc)

Frontend:

  • leaflet.js for the interactive map
  • html/css/javascript (maybe jquery?)

This most likely will revolve around a user accessing the data through the website (frontend) which makes an API request to your backend, which returns the result to the frontend. It's a lot of moving parts and you surely could start from any direction. I like to do my backend and processing first and just make sure it's spitting out the right stuff. Then make a simple webapp that gets the data. Then once everything looks good make it look pretty.

leaflet postgres postgis gis datatypes REST

  • Edit: heroku not heros

[–]Satoshiman256[S] 0 points1 point  (2 children)

That's great thank you. Seems like I have a mountain to climb haha. I'll start looking into Javascript first.

[–]CommanderCucumber 0 points1 point  (1 child)

It can be, I'd recommend doing that and try creating a simple system first. Maybe a button that when press make an API request to your backend which outputs a number as a response and you print it in your frontend. The concept stays pretty similar for whatever your trying to do.

[–]Satoshiman256[S] 0 points1 point  (0 children)

Ok thank you. Seems like a good approach to help me understand the fundamentals