last day (14 days later) » 

1:04 AM
1
A: Node.js how to pass geojson from mongodb to object I can use in frontend

Jose Hermosilla RodrigoYou can easily create a variable in jade of your passed object: // server.js res.render('something', { something: mogoDBObject }); // Your template.jade script. var myGeoJSONArray = !{something}; // If you're getting problems parsing the array of objects // i.e. "something" becomes some...

 
thank you for your answer! could you point me in a a direction on how do i take lat, lng out from the geojson I get from db?
wow thank you! I am getting to code that will share the result if you wish.
 
You're wellcome! If you're interested about the use of spred operator "..." for destructuring look at here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…
Feel free to share the code! =)
 
this is what I get rendered: var myGeoJSONArray = [object Object],[object Object],...;
 
@toHo look at the edit.
 
thank you! It worked like a charm, now I see last problem. How can I revert lat,lng in here: var marker = new PruneCluster.Marker(...geoJSON.loc.coordinates);
as mongodb stores them in opposite way. all my points are mixed up
I dont know if I should do this, but stackoverflow suggested so I did :)
 
1:14 AM
quite easy
var marker = new PruneCluster.Marker(...geoJSON.loc.coordinates.reverse());
 
wow, you are so good at this!

I just started learning this recently, could you suggest me some good place to learn more about javascript and node.js?
 
I have never used the chat! is the first time!! =)
I think you can find good tutorials in YouTube
and for specific problems you can go StackOverflow
And visiting StackOverflow can help you a lot improving your skills
 
I remember when I was learning pascal only way was yourself, books; it's amazing how you can connect with people now days. I have never used this feature before too.
I try to use StackOverflow as much as I can, so far I was able to create scraper that gets airbnb data daily, just by combining pieces together from SO
 
I wanted to scrappe some page to get weather data of my county and it was so tedious.
What feature you used to do it?
 
1:30 AM
I have found a way to get results from API they use for mobile and written python script to do that and used rabitmq to queue tasks. I am still barely sure how it works as I just put pieces of existing code together.
you are amazing!!!
thank you so much for your explanations
with limit to 1m points:
http://vps84177.vps.ovh.ca:3000/maps
give it like 20s to load :)
its a small box
 

last day (14 days later) »