Routing Algorithm Choosing Longer Paths Than Necessary

Hi everyone,

I’m currently working on drawing a map in the Mappedin Editor and have been testing the routing functionality with different POIs. I noticed that in several cases, the routing algorithm selects a longer path instead of the shortest possible one.

For clarification, I’ve attached a screenshot showing an example of this behavior.

Is there a way to adjust the routing settings or prevent this from happening? Any insights would be greatly appreciated!

Thanks in advance.

Hi Markus,

Welcome to the forum! It looks like something has gone wrong during the path generation of your map. Could you share the Map ID with me so I can take a look? Feel free to DM it to me if you’d prefer not to post it publicly.

Mark

Hey Mark,
thanks for the quick reply.

My colleague has send you a DM with the Map ID, since I didn’t see any option to do so from my Account.

Thanks, you may not have that option right away after making an account here.

I’ve received the map ID and am investigating.

Thank you for reporting this. We have resolve the issue that was causing the directions to not use the most efficient route. Please update to Mappedin JS v6.0.1-beta.34 to pick up this fix and let us know if you run into any further issues.

We tried the latest Mappedin JS release. The paths are now drawn better but on Safari and iOS this version is worse than the one we used before. The red floors for the security checks are now sometimes drawn on spaces where they should be black and there seem to be display errors for the red floors. This seems only to happen on Safari and iOS (you can also check on a Desktop PC with Chrome Browser), the WebView is using Safari. You can fix these issues but we will stay on the old version (beta.30).

Can you describe how you are changing the color? Are you using changing the space color, using Shapes or Textures? A code snippet would be helpful here that I could use to reproduce. I tested our examples that change space color and didn’t see this behaviour yet.

This is the code we use to set the floor color to red.

    const spaces = mapData
        .getByType("space")
        .filter((space: any) => space.floor.id === "m_f2786e5df102b3c5");
    for (const space of spaces) {
        const description = space.description.toLowerCase();
        if (description.includes("red")) {
            // Security check
            mapView.updateState(space, {
                color: "#F88E86",
            });
        } else {
            //Floors
            mapView.updateState(space, {
                color: "#00080A",
            });
        }
    }

The beta.30 version does not have this issue, we already reverted back to the old version and it is fine.

Thank you for the example. We’ve found the change that is causing this issue on some maps and will have a fix out soon.

We have just released Mappedin JS v6.0.1-beta.35, which resolves the issue you reported with space visibility on Safari on iOS.

Thank you for the update. We will stay at beta.30 for now, since we had done a code-freeze. In case we will update to the latest version, as suggested by you, I will post an update with the results.