4 Replies - 433 Views - Last Post: 06 November 2019 - 04:27 PM Rate Topic: -----

#1 kiri96   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-November 19

Google maps api and google directions api with node.js project

Posted 05 November 2019 - 04:40 AM

I am developing an app to android, which purpose is get directions to a certain clicked marker (point) in the map.
So, I am using the Google Maps API with node.js, and I have the data from the points stored in a MongoDB.
I've been serching but I can't find anything that solves what I want to do.

I want now to get those points coordinates from the data base object and then use the coordinates to when I click a marker (a point), then appears a infowindow with a button saying "go to location" and when I click this button I will have the directions from the point where I am to the clicked marker. I don't know if I explained myself clearly, but let me know.

If you could help, that would be great, I am in a bit of a hurry with this because I have a deadline and I am a little bit new to Node.js.

Is This A Good Question/Topic? 0
  • +

Replies To: Google maps api and google directions api with node.js project

#2 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6829
  • View blog
  • Posts: 28,311
  • Joined: 12-December 12

Re: Google maps api and google directions api with node.js project

Posted 05 November 2019 - 05:23 AM

What progress have you made so far and what code do you have to demonstrate where you have got to? Your question currently is too broad and lacks details.
Was This Post Helpful? 0
  • +
  • -

#3 kiri96   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-November 19

Re: Google maps api and google directions api with node.js project

Posted 06 November 2019 - 02:12 AM

View Postandrewsw, on 05 November 2019 - 05:23 AM, said:

What progress have you made so far and what code do you have to demonstrate where you have got to? Your question currently is too broad and lacks details.


well... I have the map and the markers (points), which info is stored in mongodb and have a infowindow when the marker is clicked with a button saying go to location.
Was This Post Helpful? 0
  • +
  • -

#4 andrewsw   User is offline

  • never lube your breaks
  • member icon

Reputation: 6829
  • View blog
  • Posts: 28,311
  • Joined: 12-December 12

Re: Google maps api and google directions api with node.js project

Posted 06 November 2019 - 03:01 AM

Remember that we aren't sitting with you at your computer, the only information we have to go on is what you have provided so far above.

Please provide a clear question, with appropriate information and details. In particular, some code.
Was This Post Helpful? 0
  • +
  • -

#5 kiri96   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-November 19

Re: Google maps api and google directions api with node.js project

Posted 06 November 2019 - 04:27 PM

View Postandrewsw, on 06 November 2019 - 03:01 AM, said:

Remember that we aren't sitting with you at your computer, the only information we have to go on is what you have provided so far above.

Please provide a clear question, with appropriate information and details. In particular, some code.


I have this for the directions part I want, that is a big project so I can't put everything here, but this is what I have for the functionality I want to build with Google maps and directions api in Node.js

const googleMapsClient                                        = require('@google/maps').createClient({
        key: 'AIzaSyBjO3XLWFH7yOM1bm5H8cWQf_-_8iqqvKE',
        Promise: Promise
        });


function getDirections(source, destination) {
    return googleMapsClient.directions({
        origin: 'Town Hall, Sydney, NSW',
        destination: 'Parramatta, NSW',
      })
      .asPromise()
      .then((result) => {
          return result.json;
      });
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1