Help with navigation starting point

Hi Mark

Dear Mappedin Support Team,

I hope you are doing well.

We are currently integrating the Mappedin Web SDK into our project, and we are facing an issue with navigation.

At the moment, when we perform a search and request directions, the navigation always starts from a default or first point instead of a selected or user-defined starting location.

We would like to achieve the following:

  • Allow users to select or define a starting point (“from” location)

  • Use the user’s current position or selected point as the navigation origin

  • Prevent the system from defaulting to the first node

Could you please advise on:

  1. The correct method to set or override the “from” location in the SDK

  2. Whether we should use setUserLocation or pass a custom object into getDirections

  3. Any best practices for handling dynamic starting points (e.g., user click or search result)

If possible, we would appreciate a sample implementation or reference.

Thank you very much for your support.

Cindy

Hi Cindy,

I moved this to a new topic. Please start a new thread for new questions over adding more to a solve thread. It makes things easier to track and reference in the future.

When generating directions, the getDirections method requires both an origin and destination. Your app will need to provide both. The origin could be the user’s location, results of something they searched for or somewhere they clicked on the map. All of these are valid use cases. It comes down to the experience you wish to build.

Our Mappedin JS Wayfinding Guide covers how to get directions using a start and end point with interactive examples. Please have a look at that to begin.

There is no setUserLocation method, where did you see reference to that?