How to plot routes in a C # Windows Forms application from latitude and longitude

1
Hello, I would like to know how best to display a route from the latitude and longitude that are in the database in a C # Windows Forms application. I've already searched the web and I've found something similar to what I need, link But I still can not understand much. The code is getting as follows:

using System;
using System.Data;
using System.Windows.Forms;
using System.Diagnostics;
using Microsoft.Win32;

namespace GSD
{
    public class Class1{

        public Class1(){

        }

        public void AbreGoogleMaps(double _lat1, double _long1, double _lat2, double _long2)
        {
            string defaultBrowserPath = GetDefaultBrowserPath();

            try
            {
                Process.Start(defaultBrowserPath, string.Format("http://maps.google.com/maps?saddr={0},{1}&daddr={2},{3}", _lat1, _long1, _lat2, _long2));
            }

            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }

        private static string GetDefaultBrowserPath()
        {
            string key = @"htmlfile\shell\open\command";

            RegistryKey registryKey = Registry.ClassesRoot.OpenSubKey(key, false);

            return ((string)registryKey.GetValue(null, null)).Split('"')[1];
        }    
    }
}
    
asked by anonymous 12.02.2015 / 12:16

1 answer

3

This implementation you've demonstrated may even work, but it opens the user's browser with the mapped route. This way you do not have a desirable control of the implementations and it makes the customization of the maps a bit difficult. There is an Open Source library called GMaps.NET (Great Maps .NET) that implements map creation features on a form, there is also the possibility of using the google API to get the coordinates of the desired route, I believe if you carry out an implementation joining the two technologies, you can do something quite complete and functional, below the links for verification:

link

link

    
12.02.2015 / 15:09