๐ปhttps://github.com/CodingTrain/Intro-to-Data-APIs-JS
Before diving into communication between client and server (GET and POST requests), let’s look at the Geolocation Web API with navigator.geolocation. This data will be sent to the server and stored in a database in upcoming videos.
๐ Web API Navigator: https://developer.mozilla.org/en-US/docs/Web/API/Navigator
๐ฅ NEXT LESSON: https://youtu.be/Kw5tC5nQMRY
๐ฅ PREVIOUS LESSON: https://youtu.be/wxbQP1LMZsw
๐ฅ FULL COURSE: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6YxDKpFzf_2D84p0cyk4T7X
๐ Website: http://thecodingtrain.com/
๐ Patreon: https://patreon.com/codingtrain
๐ Store: https://www.designbyhumans.com/shop/codingtrain/
๐ Books: https://www.amazon.com/shop/thecodingtrain
๐ฅ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA
๐ p5.js: https://p5js.org
๐ Processing: https://processing.org
Welcome to Working with Data and APIs in Javascript!
This course is for aspiring developers who want to learn how to work with data in web applications. How do you retrieve, collect, and store data?
We are now in Module #2! In our previous module, we focused on client-side JavaScript. We now will learn the basics of server-side programming with Node.
๐ Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct
Original source
46 responses to “2.2 Geolocation Web API – Working with Data and APIs in JavaScript”
is geolocation is dangerous??
I have checked and checked my code so many times, I am getting this error message and the lat and lon are not displaying on the page 'Unable to set property 'textContent' of undefined or null reference'. This happens when I add in the…..
'document.getElementById('latitude').textContent = lat;
document.getElementById('Longitude').textContent = lon;'
I also notice that the object position does not display in the console, which I left the 'consol.log' open so I can see if it is registering in there at all. It seems by adding the 'document.get….ETC…' this causes some kind of issue?
Anyone know of a way to connect the geolocation to a movie database? It's for a group project we're doing and we want to know how we can display film locations of those movies.
Great videos, thank for share yours
knowledge with us. Saludos desde Honduras
YOU LIVE ON WAVERLY PLACE I KNEW YOU WERE A GOD DAMNED WIZARD!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
wait, i am so confused, i mean i jsut setup a node server? and if i use require in my js it says it undefined. All the people say, that u need a node server?? like i just did that? or is there something i am not getting?
wait what? I have not found this guy till now? Is it me or youtube that sucks
[Violation] Only request geolocation information in response to a user gesture. ——> I get this error message when geolocating. anyone?
what if geolocation is not available????? please reply
I'm having an issue. After running my code through node, I get an error saying that navigator is not defined. I have tried importing a navigator module into my node modules folder. Am I missing something? I've been successful with pulling up the geolocation prompt whilst working solely offline and not utilizing any kind of localhost server. Help would be appreciated, thank you!
why did you use text content instead of innerHTML? is there a reason for that?
Ur the best from ๐ฉ๐ฟ
For those you still don't get it.
Node's js code runs on node.exe on server computer. That server computer has some html, css, js files somewhere in its storage. The server program(Node with your index.js) waits for request data from the network(most likely from the internet). You can tell Node what to do with certain requests in your index.js
You can make servers with other programs and programming languages as well.
client's js code are some of the files that Node gives out to the user's browser when they need it. It doesn't run in your node or server computer. It's just a text file. Which is requested by the user along with html and css files.
this man just gonna dox himself, aight
A nice module to add in future videos will be "nodemon" so you won't have to restart the server every now and then! Spectacular content and explanation! +1 Sub!
This is great. I love your lesson. Thanks a lot
is there any way to do the same for motion sensors.(accelerometer , gyroscope).
You are my hero Sir. Much respect for your amazing way of teaching.
You are a gifted talented instructor. Thank you so much!
This is a nice video, very excited but am curious about your name
geolocation isn't working for me but it's also not console logging the error. Is this happening to anyone else?
Thanks in a million!
This has been one of your most brilliant videos! Congrats! Years ago I used to hang out at NYU CS dept (w/ Ken Perlin, is he still around?) Hello Waverly Place!
i need to get information from a data lake through an api rest but the problem is that i have to passe a token for each request in order to get the infos
The work he does is absolutely amazing! I'm so grateful this exists.
Super awesome video! Learned a lot as a beginner! Thanks for all the fun and knowledge you are emitting! fo (let stuff of ['bunch of stuff you can try – suggested by Daniel]'){
timeTakes(stuff) = 5+ hours
};
But so worth it!
What's a good way to test things on mobile when developing locally?
For me, the most grateful things that I found in your channel is that you explained the long process in the beginning and then you explained the more effective way to write the code. It really helps me to understand it and be creative in the future. Thanks!
I've used it two years ago on mobile and it worked better than Google maps ๐. It worked even on a Nokia phone
Daniel: 9:28
NSA: hold my tracker
Hey Dan!! Love your videos, for anyone else watching and wants to see some more arts-based use of Processing (or dissimilar to Dan's coding style in that he explains everything and I don't lol) check out my channel!
Thx for the videos <3
ะัััะพ
geolocation doesnโt work for me 100% of the time, it sometimes times out before it can retrieve my location, and even after multiple refreshes, it still keeps timing out
Thanks for good knowledge video
mr Daniel pls we need the video for mobile phone any mobile how mobile phone connect to data for wich is PC pls we need that
sir i need the video how to to bypass itunes using java
Great stuff! You've made working with Node seem a whole lot less scary. I'm really looking forward to the next installments!ย
You got me off my behind, installing Node.js, the express package, and messing with a node server.
Note: when I ran in Safari on my iMac, it would not allow me to use geolocation even though I was using localhost:3000.
I ran on Chrome like you did, and what was weirder here was that it never asked for my permission to use Geolocation… it just worked! Somehow, I don't think that is supposed to happen!
FYI: Info on GPS/geolocation on non-mobile devices: https://www.quora.com/Do-all-laptops-have-G-P-S
CONFIRMED!
Daniel Shiffman IS a wizard of Waverly Place
https guys
Note: warn about Geolocation API requires secure origins and trusted certificates in order to run. As you use "localhost" literally, is treated as secure origin. So as you are able to run your server from "localhost", you can test the feature. But, some dev environments uses fixed IPs, and therefore they're not able to run geolocation API.
By the way, what about find euclidean – pythagorean distances for closest locations, 3D to cartesian (elevation), Haversine, etc for reverse geo, specially when not third party APIs or map abstractions need to be used (didactic purposes).
Thanks, great job. Gracias, gran trabajo.
9:40 Dan wants to know your location
How can someone be this good at being good.
Hey , you are doing just amazing ! upload more videos like this
Does getCurrentPosition() need to be passed an anonymous function or can you make a function elsewhere and pass it that to keep things modular?
I guess I can fire up my laptop and find out.
Thank you
I have always been more focused on back-end and low-level stuff but have been curious about the basics of web development. I'm very excited to see a series with your level of polish and teaching ability. Can't wait to see this continue!