I am currently working on a project using Mappedin Plus, and I need to implement a distance estimation feature similar to the get distance(): number method shown in the attached screenshot. The goal is to display the total distance of a navigation path in meters.
As this is a critical part of our functionality and we’re working under tight deadlines, I would appreciate any guidance you can provide on how to implement this using Mappedin Plus. Specifically, I’d like to know whether this capability is available directly through the SDK, or if there’s a recommended method for calculating path distance manually.
What are you trying to get the distance of? If it’s the walking path between two locations, you can use the MapData.getDistance() method to do this. This method works very similar to MapData.getDirections(), which you can read about in the Mappedin JS Wayfinding Guide.
If you are looking for the straight line distance between two points, that is also possible to calculate programmatically or manually. When viewing the map in the Mappedin Viewer, you can right click to get the latitude and longitude of that point. Right click the second point to get the other coordinates and then paste them into an online distance calculator. This can also be done using Mappedin JS if you’d like to build an app to do this.
Let me know if you need more information or if this doesn’t match what you are trying to measure.
Unfortunately, sir, I am using the embedded version of Mappedin via an iframe, which might not be compatible with the getDistance function since it is part of the SDK. Is there any way to stick with the embedded version and still use an alternative method?
At the moment, I don’t have the time to learn the SDK, and I’m not very familiar with advanced coding concepts as I’m still a student. I’m using this project for my thesis.
Could you please help me, sir? If yes, I can share my code for more context. I’m sorry if it’s a bit messy, but any help or suggestions would mean a lot to me.
In that case you will need to use Mappedin JS instead of Mappedin Viewer. We do have an example that is close to what you are looking for. You could fork the Codesandbox in this section of the Wayfinding Guide and use your own map. Turn-by-Turn Directions
Use this this form to request a free one month upgrade to Mappedin Pro so you can generate your own API key and secret to use Mappedin JS with your own map. Contact Mappedin
We don’t have a business email, so we’re unable to fill out the “Contact Sales” form. We only use a Gmail account. Could you possibly help upgrade our Mappedin account into Pro?
Our account name is Purpose Project, and the email we use is (redacted).