Topic: About drawing line on map details

I draw the line based on Unity's gps coordinate

every update function in unity , receive current gps coordinate and stored in list

end of update I draw the line using AddDrawingElement in Online Maps.

map.AddDrawingElement(new OnlineMapsDrawingLine(line, Color.red, 3f));

but when I use the coordinate for drawing, the line is not smooth. It seems almost zigzag pattern.

I think it is because of coordinate data.

I already used google map route(GoogleMapFindDirection class). but my country did not support route function.... sad

Is there any solution to draw the line very smoothly? (not zigzag) any retouching coordinate data or the line.. and so on ,,,,

Re: About drawing line on map details

Hello.

Unfortunately, I did not understand what zigzag you mean.
I made a simple test script, and it works well.

using System.Collections.Generic;
using UnityEngine;

public class DrawLineInPoints:MonoBehaviour
{
    private List<Vector2> points = new List<Vector2>();

    private void Start()
    {
        OnlineMapsControlBase.instance.OnMapClick += OnMapClick;
    }

    private void OnMapClick()
    {
        Vector2 coords = OnlineMapsControlBase.instance.GetCoords();
        OnlineMaps.instance.AddMarker(coords);
        points.Add(coords);
        if (points.Count == 2) OnlineMaps.instance.AddDrawingElement(new OnlineMapsDrawingLine(points, Color.red, 3));
    }
}

Screenshot attached.

If your country is not working Google Directions API, try to use Open Route Service or HERE Routing API.
http://infinity-code.com/doxygen/online … a1edfc8ee2
http://infinity-code.com/doxygen/online … 25619982bc

Post's attachments

Attachment icon img1.png 1009.6 kb, 289 downloads since 2017-01-11 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: About drawing line on map details

Thanks for the reply

I mean

if I receive coordinate and draw the line on google map

when i walked straight, the line is not straight. it is unsmooth. like snake

Re: About drawing line on map details

Please send a screenshot and a script that causes the problem.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.