Map path Draw looks improper when I try to draw the route from user Current location to multiple product under Grocery/Warehouse use cases

Hi,

Using MappedIn Android & iOS SDK when we try to draw the path from current user location to Multiple/Single Product use case we some time see the path drawing looks incomplete.

Issue is reported on the Map - (MapId-6a66e0ecb28dd9000bb2e109)

Attached Issue Screenshot:

Code Snippet Used to Draw Path is given below:

Used following Code to get the Directions Information for Single and Multiple product Path drawing from User Coordinate target to List Of Navigation targets.

mapView.mapData.getDirectionsMultiDestination(startTarget, destinationTargets) { result ->
            if (requestId != activeRequestId) return@getDirectionsMultiDestination

            val directions = result.getOrNull()
            if (directions.isNullOrEmpty()) {
                clearRoute()
                onRouteReady(false)
                return@getDirectionsMultiDestination
            }

            routeStopNames = visitedStops.drop(1).map { it.first }
            drawRouteOnMap(directions, onRouteReady, animateDrawing)
        }

Once we have the direction information from above Code we start Drawing the Map via following Code Snippet:

mapView.navigation.draw(
            directions, NavigationOptions(
                animatePathDrawing = animateDrawing,
                pathOptions = AddPathOptions(
                    color = BrainMapColors.ROUTE_PATH_COLOR,
                    accentColor = BrainMapColors.ROUTE_ACCENT_COLOR,
                    displayArrowsOnPath = false,
                    animateArrowsOnPath = false,
                    width = Width.Value(0.3)
                ), createMarkers = NavigationOptions.CreateMarkers.withDefaults(
                    departure = false, destination = false, connection = true
                ), inactivePathOptions = AddPathOptions(
                    width = Width.Value(0.3)
                )
            )
        ) {
            it.onFailure {
                onRouteReady(false)
            }
            it.onSuccess { onRouteReady(true) }
        }

What type of objects are you using for the startTarget and destinationTargets? If using coordinates, note that Mappedin will make use of a the navigational node closest to the coordinates, which would be close but may not be at that exact point.

Navigation gets drawn by connecting a series of nodes that make up the navigation graph. These are auto generated when the map is saved.

Hi,

We plot the map from User Coordinate to Multiple Location Profile/Map Object Coordinates.

Hi,

We plot the map from User Coordinate to Multiple Location Profile/Map Object Coordinates.

From Navigation target is Prepared by using following code Snippet NavigationTarget.CoordinateTarget(coordinate)

To will have the List of Navigation Target created using Map object via following code snippet NavigationTarget.MapObjectTarget(mapObject)

As given in the Post, we first get the direction Details using mapView.mapData.getDirectionsMultiDestination APIs and After success response we clear the existing route via mapView.navigation.clear and then we call mapView.mapData.draw to start drawing the updated Path.

This flow will continue to be called when user Adds/removes any product for walking path.

When this flow executed multiple times, we see the Path draw break and user start moving we can sometimes see the path draw break issue gets updated and fixed automatically.

Thanks & Regards,

Gowtham S

I haven’t been able to reproduce a path not redrawing using Mappedin SDK for Android v6.9.0. What version are you running? Is the icon your own custom placement or is a the destination marker from directions? Could you provide a video and/or small example project that reproduces what you are seeing?

I am getting following error to upload the issue reproduction video.

Could you please confirm whether my community post is visible only to the people involved in the discussion, or if it is accessible to all users/public within the community?

I would like to understand the visibility settings before sharing additional information on the thread.

Can you please enable me to upload the files in the attachment?

Thanks & Regards,

Gowtham S

I’ve increased your access level so you should be able to attach videos now. Anything posted here will be public. Feel free to DM me the private assets and continue the public discussion in this thread.


Hi Mark,

The issue happens after path draw between blue dot and multiple destinations and we mark each item as picked one by one and then when user moves toward the last destination, path gets updated with broken path and readjust it when user reaches near the destination

Attached the issue reproduction video using the latest MappedIn SDK v6.9.0

Since we have restriction at org level and cannot be able to share the code snippet, I would request you to try using the Map ID shared in this ticket in which the Path we draw between destinations exhibits this issue.

Thank you for the video, it was super helpful. I’ve been able to reproduce this behaviour and have made a fix. This will be included in the next SDK release, which should happen this week.

Hi Mark,

This issue is fixed in the latest SDK. Thanks for your help.