1.5 Mapping Geolocation with Leaflet.js - Working with Data and APIs in JavaScript

Поділитися
Вставка
  • Опубліковано 10 січ 2025

КОМЕНТАРІ • 188

  • @jeslela
    @jeslela 2 роки тому +36

    One thing I love about these videos is just watching your workflow and seeing how you use and read documentation. It's like there's a mentor by my side showing me how to navigate this confusing world of self taught programming. Thanks

  • @RicoMinovo
    @RicoMinovo 4 роки тому +12

    If you watch it at 1.5x he is even more excited to teach programming. Thanks!

  • @tonym_123
    @tonym_123 5 років тому +10

    incredible, how do you make this look so easy? like seriously, i would spend hours just to make half of what you did here. you are truly an inspiration

  • @prernasharma3439
    @prernasharma3439 5 років тому +33

    Loving this series so much. Thank you so much for making JS fun.

  • @ShujathHussain0
    @ShujathHussain0 5 років тому +8

    After so many series and lectures. i just love the energy & clarity of your every explanation

  • @Matt-tn2on
    @Matt-tn2on 3 роки тому

    Man I have no words. Daniel Shiffman, you are simply the best!

  • @fastlearner9993
    @fastlearner9993 2 роки тому

    your TEACHING style is one of a kind !!!!!

  • @RicoGalassi
    @RicoGalassi 5 років тому +16

    Love this series. Been teaching me so much! Very excited for the last one! And definitely please show how to center the space station while the map moves around it so the ISS is stationary. Can you definitely also show how the page can update with the new lat and lon without refreshing?
    Love your videos!!

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +5

      It's all coming in the subsequent videos and you can find the exercise solutions here: github.com/CodingTrain/Intro-to-Data-APIs-JS/

  • @julietosunde9475
    @julietosunde9475 3 роки тому +4

    You are awesome!! this has helped with a project I have been struggling with for days now. Thanks

    • @vishalchauhan9832
      @vishalchauhan9832 3 роки тому

      @Juliet Osunde on which project you are working.

    • @naveennani1772
      @naveennani1772 2 роки тому

      It helps me too . 🙂 But we can't share anything about our project as it's against our company policies 🥴

  • @ishantchahar901
    @ishantchahar901 4 роки тому +2

    I am in love with ur enthusiasm bruh. You are really awesome!

  • @coffeecoder9458
    @coffeecoder9458 4 роки тому +3

    This is one of the coolest tutorials ever. This guy has some serious teaching chops. SUBSCRIBED!!!

  • @EduardoLima-pi7fl
    @EduardoLima-pi7fl 5 років тому +1

    Yours videos are just awesome! I hope more people can appreciate your work. Greetings from Brazil!

  • @digigoliath
    @digigoliath 5 років тому +7

    Magical! Thanks for transporting us to another world.

  • @alimajidian1974
    @alimajidian1974 3 роки тому

    Hello from IRAN, you helped me so much, thank you !

  • @gakhappy
    @gakhappy 4 роки тому

    wow!! you are a real teacher. you are my inspiration for coding

  • @MrUgleh
    @MrUgleh 5 років тому

    Although I have no need to watch this series because this kind of stuff is my bread and butter, I still do because I love watching your videos, and you never know what you will learn. There is always room for improvement. With that said, I think an addition to this "Working with Data" series you could show how to cache data that doesn't need to be repeatedly fetched from the source. Just an idea but picking up from this video, you could grab all the countries latlong via restcountries.eu, which also uses no authentication, and then create a marker that displays their population or something, or using Charts.js create a bubble map that involves area, population, exc.

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Ah, thank you for this feedback! A great tip! Feel free to keep commenting with more feedback as I release future videos.

  • @goldenpigcoin8028
    @goldenpigcoin8028 4 роки тому +1

    Love your videos! You are very enthusiastic!

  • @shinej11
    @shinej11 4 роки тому +1

    Thank you very much. I love your presentation style. Apart from the topic of the video, which is always undoubtedly great, I learn a new way of doing things.

  • @SaikatMaiti
    @SaikatMaiti 5 років тому +3

    Just waiting for this session from you! 🤗

  • @im2godly750
    @im2godly750 2 роки тому

    Thank you so much. You are a great teacher. I know it’s not necessary, but I actually feel comfortable learning with you. I’ll definitely subscribe and check out the rest of your vids! ❤

  • @SimPwear84
    @SimPwear84 5 років тому +1

    Great series! It helped me tremendously on my project. Thank you o much, wish I could like this x1000 times.

  • @Pierstoval
    @Pierstoval 5 років тому +12

    One of my favourite JS libraries, it's really awesome and clean :D ♥

  • @pollyjesterscodingworld4673
    @pollyjesterscodingworld4673 5 років тому +2

    This is a really good series. Thanks a lot. If you want more rainbows in your VS Code, I'd recommend the imo useful extension indent-rainbow.

  • @bienenlapera
    @bienenlapera 11 місяців тому

    Thanks for the clarification on merkator's map . It's really important that! I'm from Argentine, It is as long as Europe! Buenos Aires as long as Spain

  • @SYNAPSEdwl
    @SYNAPSEdwl 5 років тому +2

    Great presentation! All the best!

  • @SimonTiger
    @SimonTiger 5 років тому +1

    0:14-0:16 In case anyone hasn't noticed, that was Dan from waaay in the future. That's why his voice was a little bit different.
    Because, I've actually watched how he recorded this, and he just said "dom" incorrectly. For some reason, that bothered him!

  • @margharetify
    @margharetify 3 роки тому

    Love your energy! Thank you for the super clear explanation!

  • @enivaldobonelli
    @enivaldobonelli 5 років тому +5

    Beautifull lecture. Thanks a lot, Daniel!

  • @cybersamurai99
    @cybersamurai99 Рік тому

    Thank you Im glad I found your channel.
    If anyone is having issus with marker.SetView not working, try using the following method marker.setLatLng( [lat,long ] )

  • @rotrose7531
    @rotrose7531 4 роки тому

    Thank you very much. These tutorials are god-sent!

  • @hannahejimoforchiamaka3333
    @hannahejimoforchiamaka3333 3 роки тому

    I'm loving this already

  • @mariusbrinzaru8137
    @mariusbrinzaru8137 5 років тому +1

    A great tutorial sir it was a pleasure to watch!

  • @Dadaadad268
    @Dadaadad268 4 роки тому +2

    Where did the tileUrl come from? I know you explained it a bit, but can that url be found in documentation anywhere?

  • @MiladAKareem
    @MiladAKareem 5 років тому +1

    Very useful video.
    Thanks for all you share with us.

  • @matissjudins6272
    @matissjudins6272 2 роки тому

    thank you man, i made more progress in 1 day than in a week with fetch()

  • @DrMxy
    @DrMxy 5 років тому +3

    Great stuff! Just a small correction: {s} = subdomain @ 7:35

  • @digigoliath
    @digigoliath 5 років тому

    Revisiting this video. Hey, coding is FUN!!

  • @kasta867
    @kasta867 4 роки тому

    Amazing tutorial, just what I was looking for!

  • @celtspeaksgoth7251
    @celtspeaksgoth7251 Рік тому

    Fantastic. Enthusiastic, great legible code, a sense of direction,

  • @lunes-1
    @lunes-1 3 роки тому +1

    Great video,keep it up!⏺⏹⏺

  • @nigusukassahun
    @nigusukassahun 5 років тому +2

    The marker doesn't pin to the map accurately when you insert your own icon, like it normally does when using its default icon.

  • @pastorhudson
    @pastorhudson 5 років тому +1

    Dude! I love your teaching style. You’re killing it! I love the setup too. Green screen? How do you know where to point? Do you have a monitor like the weather man? It looks fantastic. I teach for a living and this is one of the best coding style lessons I’ve seen.

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Yes green screen and monitor! More here: ua-cam.com/video/sqkwHUyV-YY/v-deo.html

  • @treestrax1072
    @treestrax1072 5 років тому +1

    how did you figure out the appropriate values for iconAnchor?

  • @RugShadow
    @RugShadow 3 роки тому +1

    Hey! Your videos are absolutely great, and coding along with them each in order has taught me so much!
    There's one thing in this video that has me absolutely stumped right now and I'm surprised I don't see anyone else mentioning it in the comments- when I paste in the attribution URL, the URL itself has quotes in it, which JS then treats as the end of the string! How and why is it not doing that for you?

  • @angelamilton5134
    @angelamilton5134 2 роки тому

    Lovely presentation and explanantions

  • @thaiscorreia9072
    @thaiscorreia9072 4 роки тому

    You're a life savior!

  • @johnhodgkiss9882
    @johnhodgkiss9882 5 років тому +1

    Great video. How would you click on the target to open another window or perform a function related to that marker?

  • @neutronstar77
    @neutronstar77 2 роки тому

    Thank you very much for upload this video, it is very useful!

  • @marchino3577
    @marchino3577 5 років тому +1

    using leaflet how do I get the set of coordinates of a place sought through the search box and highlight its borders

  • @gloubiboulgazeblob
    @gloubiboulgazeblob 5 років тому +1

    Nice. Maybe giving it a try with Openlayers ? Doesn't it offers you more possibilities ?

  • @prashanthkumar5987
    @prashanthkumar5987 5 років тому +2

    Awesome dan🤩

  • @AndreaVitiani
    @AndreaVitiani 5 років тому +1

    great video as always!!

  • @rahulnirfarake5355
    @rahulnirfarake5355 2 роки тому

    Hello,
    Can you please suggest a library for angular by which we can show different colour on each lat-long point.
    Thanks

  • @farahtasneem
    @farahtasneem 5 років тому +1

    Thanks for the video! Do you know how I can make an ordered Leaflet slider showing features by year?

  • @gauravshetty6944
    @gauravshetty6944 5 років тому +1

    can you make a video showing this same project using processing.

  • @t_apk4477
    @t_apk4477 4 роки тому

    Great Tutorial. Please suggest to restrict the tile to only 1 rather than many more when u r zoom out, please reply

  • @cristiiancu4814
    @cristiiancu4814 3 роки тому

    Can i make a button,i want to click on a maker for example and it should go to another link,like a building description or something?

  • @Any_key404
    @Any_key404 5 років тому +2

    Dan, VSCode has Emmet built in so you can all kinds of HTML stuff really quickly, like making divs or setting up a boilerplate page.
    Is this something you normally don’t use or is it jus out of scope and confusing for people browsing your videos to see you do something like .name and a line of code magically appears?

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Oh, I should look into this more, thank you!!

  • @jeansylvestre9270
    @jeansylvestre9270 3 роки тому

    You're a genius !

  • @hongvicodes
    @hongvicodes 5 років тому +1

    Hey nice video and great presentation, period.
    But how can you preview your work on VSC ? I was wondering about this for weeks.
    Thanks in advance.

  • @andresmontoya7852
    @andresmontoya7852 5 років тому +1

    Thanks! Might you make a project with the following option:
    If I type "Colombia, Bogota" on a input, the library you used can change that text to lat and long? That would be awesome!

    • @EricWilliamsCG
      @EricWilliamsCG 5 років тому +2

      I recently set up a site that works with Leaflet and Algolia Places that does that. Algolia Places gives you real time update as you type addresses with latitude longitude, leaflet can then update the maps with new data how ever fast you allow it to.

    • @andresmontoya7852
      @andresmontoya7852 5 років тому

      @@EricWilliamsCG Great! Can you pass me any example you have? Thanks!

  • @koszar2005
    @koszar2005 3 роки тому

    HI, can we give the coordinates from the navigation instead of the ISS ? I tried do this, but console log bugs "map container is already initialized" :/

  • @KosherWithoutBorders
    @KosherWithoutBorders 5 років тому +1

    Thanks for the video! How can I make China's map show up in English characters?

  • @promisemaluleke5690
    @promisemaluleke5690 3 роки тому

    How do you convert address to latitude and longitude in javascript? when using the leaflet maps?

  • @Choedron
    @Choedron 2 роки тому

    I am trying to use this to show current location of a SPOT tracker. Problem is, the JSON file contains several latitudes and longitudes - this does not work. It is also possible to retrieve the latest position - but as an XML. I have tried this, with the above script. But that does not work either. Is there any way to retrieve the data from an XML file instead? (Mind you I am not that experienced with geolocation).

  • @MrMaraxli
    @MrMaraxli 4 роки тому +1

    i really like how you teaching and explaining. i just start learning javascript and i wanna know do you have javasript tutorial videos like about everything. thank you so much

  • @mapkbalaji
    @mapkbalaji 3 роки тому

    Hi, I'm able to use p5.js + mappa. But, couldn't achieve using Leaflet + p5.js. As a basic, I need to draw a basic eclipse on the current location on the Leaflet map. I don't want to use mappa.

  • @geoffreynyamongo4619
    @geoffreynyamongo4619 2 роки тому

    This is a wonderful tutorial. Can you PLEASE help me come up with a simple example of how to develop a Data-Driven Leaflet Interactive Choropleth Map?

    I wish to fetch my data from MySQL table. Instead of reading from the *.js file in the application folder, can we generate a GeoJSON string from the MySQL table? Please reply. I have been struggling with this,

  • @matheuscardoso1
    @matheuscardoso1 4 роки тому

    Normally I would have three files inside a code. An html, an styles in css and one script in js. In order to use the leaflet library, however, I cannot import two different script files into one html document. How do I do that? I want to keep my code clean, and have still those three separated files for each thing.

  • @ceciliaferraz9248
    @ceciliaferraz9248 3 роки тому

    I love your videos, I'd like to know if there is a way to chance the icons from the features to images (png), I use the qgis2web plugin to generate the html file, but the icons I set on Qgis aren't working on the html. Can you help me?

  • @asm7575
    @asm7575 3 роки тому

    that was helpful thank you.
    can you make a video about searching marker leaflets that i added on my map ?

  • @rafiel767
    @rafiel767 3 роки тому

    Love the videos! I am wondering though... Some data seems to be changing but you still used const, instead of let. Why is that and how is the code still able to work?

  • @RiccardoCosenza
    @RiccardoCosenza 4 роки тому

    how could I do if I wanted to track a group of satellites (for example) doing the same update job with setInterval?

  • @codeitdear1904
    @codeitdear1904 5 років тому

    Not working.
    Can u help? The where the ISS at? map is showing for development purposes only water mark

  • @FxbyyMC
    @FxbyyMC 4 роки тому

    Hey great video. Is it possible that when I click on the map, the coordinates are displayed or copied from there?

  • @Purplejacket
    @Purplejacket 5 років тому +1

    How did you know the syntax for titleUrl? I couldn't find it documented anywhere.

    • @treestrax1072
      @treestrax1072 5 років тому

      likewise. Any luck ?

    • @treestrax1072
      @treestrax1072 5 років тому +1

      leafletjs.com/reference-1.6.0.html#tilelayer
      unless you didn't find, it's here in Raster Layers/TileLayer

  • @boultifnidhal2600
    @boultifnidhal2600 2 роки тому

    I wish that flat earthers were smart enough to love coding and watch this video.

  • @davidplowie4670
    @davidplowie4670 5 років тому +2

    Im not sure this is meant to actually be available yet.... doesnt show on the channel and its unlisted!

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      I'm working on this full series incrementally and releasing them when I'm sure the video is final. But happy for people to find the draft videos in the playlist in advance and comment!

    • @davidplowie4670
      @davidplowie4670 5 років тому +1

      @@TheCodingTrain as long as you know buddy :)

  • @ankitkumar-ih8qo
    @ankitkumar-ih8qo 4 роки тому

    hey.!
    I want to display current location of me, then what should I do to implement. Can you give me suugestion ?

  • @shmihshmih4287
    @shmihshmih4287 4 роки тому

    Great video! Thanks!

  • @Pierstoval
    @Pierstoval 5 років тому

    At 7:35 you say that {x} and {y} are for latitude and longitude, but that's actually false.
    There's a special equation/calculation system that determines the tiles numbers, based on width+height of the global map + the current zoom level, so x and y will not actually reveal latitude nor longitude :)

    • @TheCodingTrain
      @TheCodingTrain  5 років тому

      Oh, this is a great point, thank you for this feedback! I need to keep a list of corrections somewhere.

  • @josephridge3646
    @josephridge3646 3 роки тому

    hey there good people, just an add on this, if you are using vue3 the icon/ marker might not appear hence , according to the documentation at this point in time, you will have to add :
    import { Icon } from 'leaflet';
    delete Icon.Default.prototype._getIconUrl;
    Icon.Default.mergeOptions({
    iconRetinaUrl: require('leaflet/dist/images/marker-icon-2x.png'),
    iconUrl: require('leaflet/dist/images/marker-icon.png'),
    shadowUrl: require('leaflet/dist/images/marker-shadow.png'),
    });
    to your main.js file and voila your marker appears!
    happy "mapping"

  • @KirillKlimov_lds
    @KirillKlimov_lds 2 роки тому

    How to create track for the ISS locator on the map?

  • @cesaremannino2774
    @cesaremannino2774 3 роки тому

    You`re a legend!

  • @gratefulNow.
    @gratefulNow. 3 роки тому

    Does this program updates the location of ISS as time goes by?

  • @Just_An_Idea_For_Consideration
    @Just_An_Idea_For_Consideration 3 роки тому

    what is the development software which you are using on the screen (software to edit and execute the code)?

  • @Brcko4s
    @Brcko4s 4 роки тому

    how do I find the previous video with coordinates?

  • @usamamajid9697
    @usamamajid9697 4 роки тому +1

    How to use them in react js

  • @adrianwalker9917
    @adrianwalker9917 3 роки тому

    IF your *MAP outline DOESN'T SHOW* one problem could be that where you put it ( ) is below the line where you defined it (const mymap = L.map('mapid').setView([51.505, -0.09], 13); ). I always thought you'd want to define it first and the place it but that's not the case here.

  • @dhanalakshmi5341
    @dhanalakshmi5341 4 роки тому

    How to add right click to the marker or cluster data?

  • @noobdaaviacao
    @noobdaaviacao 4 роки тому

    could make a video how to put Polyline with the coordinates

  • @vahidsediqi5638
    @vahidsediqi5638 3 роки тому

    I would love to learn Nodejs or Reactjs from you!

  • @furiousjanush5776
    @furiousjanush5776 3 роки тому

    Great job!

  • @SWIMGEAR_BR
    @SWIMGEAR_BR 5 років тому

    Can u teach how to get a Leaflet Popup Content? For example: You have a marker and when you click its give a link, I need to learn how to get all links from all markers

    • @SWIMGEAR_BR
      @SWIMGEAR_BR 5 років тому

      I need like a bulk of coordinates, can u help me?

  • @joshiadvait8
    @joshiadvait8 5 років тому +1

    How to work with OAuth 2 in js for GitHub , Spotify,etc logins???

    • @ryanboldi9586
      @ryanboldi9586 5 років тому

      Put them inside a config file and add that file to the gitignore.

  • @lipslide101
    @lipslide101 5 років тому +1

    Hey man nice video! I would like to suggest you using npm instead of good old vanilla import into html because that's rarely used in the real world for real applications. Everyone uses things like npm and webpack which is a really essential tool. I think it would be a good idea to always use that even if it's just for good practice and not really necesary :)

    • @darkceptor44
      @darkceptor44 5 років тому +1

      I personally don't mind, I'm too lazy to create even more projects on my hard-drive so I prefer using online services like codepen.io and repl.it to host simple CSS/JS code, and I already had to change my code a little bit because there's no async and await on browser JS so using NPM and other Node libraries would make it harder for me to keep using it on browser.
      Btw when I do use Node/NPM I prefer Gulp not Webpack, it's JavaScript style and not JSON style, 100% recommend it.

    • @TheCodingTrain
      @TheCodingTrain  5 років тому +1

      Ah, good point, I should add to this series to cover this.

    • @IceMetalPunk
      @IceMetalPunk 5 років тому +2

      NPM is good for Node projects, but when making a fully client-based application, there's not much need for it. To be honest, the reason things like Webpack/Babel/etc. seem to still be used for client-side applications is just for compatibility reasons, but if your application doesn't need to support old browsers (*cough* IE *cough*) then most modern browsers will be just fine with vanilla ES6 features.

    • @EricWilliamsCG
      @EricWilliamsCG 5 років тому +1

      Have to agree with DarkCeptor and IceMetalPunk. I use vanilla often in real world apps. NPM is just another link in the chain to keep working.

    • @lipslide101
      @lipslide101 5 років тому +1

      I just find that me and my colleagues always have been using npm for the frontend of our projects, just to keep things clean. But yeah it was just a suggestion :)

  • @santiagocastro6701
    @santiagocastro6701 5 років тому

    after putting everything, nothing works is there a problem that i don't see?

  • @shariquekhanoriginal
    @shariquekhanoriginal 3 роки тому

    It says Map container not found. Why? I had follow all the steps.

  • @Alex4n3r
    @Alex4n3r 5 років тому +1

    Is there an API for #JCB excavator locations? :D

  • @justindo5491
    @justindo5491 2 роки тому

    I'm trying to convert the inline leaflet script into an external javascript file, but it doesn't work when I do that. Is there something I'm missing?

    • @fastlearner9993
      @fastlearner9993 2 роки тому

      i tried the same thing didnt work lol, based on the leaflet.js documentation i believe the css and script links/src needs to be within the head html. let me know if you found a solution

    • @justindo5491
      @justindo5491 2 роки тому

      @@fastlearner9993 Sup bro, so I actually did find a solution. I moved the external script where usually I would declare it in the head. I moved it all the way to the bottom of my html doc and that somehow fixed it. Let me know if it fixed it for you too!

    • @fastlearner9993
      @fastlearner9993 2 роки тому

      @@justindo5491 lol i tried that first but i just looked back and i made an error with script tag .. thanks bro