Ejemplo n.º 1
0
    private OnlineMapsOpenRouteService(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref, bool noMotorways, bool noTollways, Vector2[] via)
    {
        _status = OnlineMapsQueryStatus.downloading;

        StringBuilder url = new StringBuilder("http://openls.geog.uni-heidelberg.de/route?");

        url.Append("start=").Append(start.x).Append(",").Append(start.y);
        url.Append("&end=").Append(end.x).Append(",").Append(end.y);

        url.Append("&via=");
        if (via != null && via.Length > 0)
        {
            for (int i = 0; i < via.Length; i++)
            {
                url.Append(via[i].x).Append(",").Append(via[i].y);
                if (i < via.Length - 1)
                {
                    url.Append(" ");
                }
            }
        }

        url.Append("&lang=").Append(lang);
        url.Append("&distunit=KM&routepref=").Append(Enum.GetName(typeof(OnlineMapsOpenRouteServicePref), pref));
        url.Append("&weighting=Shortest");
        url.Append("&avoidAreas=&useTMC=false&noMotorways=").Append(noMotorways);
        url.Append("&noTollways=").Append(noTollways).Append("&noUnpavedroads=false&noSteps=false&noFerries=false&instructions=true");

        Debug.Log(url.ToString());

        www = OnlineMapsUtils.GetWWW(url);
    }
 private OnlineMapsOpenRouteService(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref, bool noMotorways, bool noTollways, Vector2[] via)
 {
     _status = OnlineMapsQueryStatus.downloading;
     string url = "https://openls.geog.uni-heidelberg.de/testing2015/route?Start={0}&End={1}&Via={2}&lang={3}&distunit=KM&routepref={4}&avoidAreas=&useTMC=false&noMotorways={5}&noTollways={6}&instructions=true";
     string viaStr = "";
     if (via != null && via.Length > 0)
     {
         string[] vias = new string[via.Length];
         for (int i = 0; i < via.Length; i++) vias[i] = via[i].x + "," + via[i].y;
         viaStr = string.Join(" ", vias);
     }
     url = string.Format(url, start.x + "," + start.y, end.x + "," + end.y, viaStr, lang, Enum.GetName(typeof(OnlineMapsOpenRouteServicePref), pref), noMotorways, noTollways);
     www = OnlineMapsUtils.GetWWW(url);
 }
Ejemplo n.º 3
0
    private OnlineMapsOpenRouteService(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref, bool noMotorways, bool noTollways, Vector2[] via)
    {
        _status = OnlineMapsQueryStatus.downloading;
        string url    = "https://openls.geog.uni-heidelberg.de/testing2015/route?Start={0}&End={1}&Via={2}&lang={3}&distunit=KM&routepref={4}&avoidAreas=&useTMC=false&noMotorways={5}&noTollways={6}&instructions=true";
        string viaStr = "";

        if (via != null && via.Length > 0)
        {
            string[] vias = new string[via.Length];
            for (int i = 0; i < via.Length; i++)
            {
                vias[i] = via[i].x + "," + via[i].y;
            }
            viaStr = string.Join(" ", vias);
        }
        url = string.Format(url, start.x + "," + start.y, end.x + "," + end.y, viaStr, lang, Enum.GetName(typeof(OnlineMapsOpenRouteServicePref), pref), noMotorways, noTollways);
        www = OnlineMapsUtils.GetWWW(url);
    }
Ejemplo n.º 4
0
    /// <summary>
    /// Creates a new request for a route search.
    /// </summary>
    /// <param name="start">Coordinates of the route begins.</param>
    /// <param name="end">Coordinates of the route ends.</param>
    /// <param name="lang">Language of intructions.</param>
    /// <param name="pref">The preference of the routing.</param>
    /// <param name="noMotorways">No Motorways.</param>
    /// <param name="noTollways">No Tollways.</param>
    /// <param name="via">Coordinates of the via positions.</param>
    /// <returns>Query instance.</returns>
    public static OnlineMapsOpenRouteService Find(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref = OnlineMapsOpenRouteServicePref.Fastest, bool noMotorways = false, bool noTollways = false, Vector2[] via = null)
    {
        OnlineMapsOpenRouteService query = new OnlineMapsOpenRouteService(start, end, lang, pref, noMotorways, noTollways, via);

        OnlineMaps.instance.AddGoogleAPIQuery(query);
        return(query);
    }
 public static OnlineMapsOpenRouteService Find(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref = OnlineMapsOpenRouteServicePref.Fastest, bool noMotorways = false, bool noTollways = false, Vector2[] via = null)
 {
     return(null);
 }
 /// <summary>
 /// Creates a new request for a route search.
 /// </summary>
 /// <param name="start">Coordinates of the route begins.</param>
 /// <param name="end">Coordinates of the route ends.</param>
 /// <param name="lang">Language of intructions.</param>
 /// <param name="pref">The preference of the routing.</param>
 /// <param name="noMotorways">No Motorways.</param>
 /// <param name="noTollways">No Tollways.</param>
 /// <param name="via">Coordinates of the via positions.</param>
 /// <returns>Query instance.</returns>
 public static OnlineMapsOpenRouteService Find(Vector2 start, Vector2 end, string lang, OnlineMapsOpenRouteServicePref pref = OnlineMapsOpenRouteServicePref.Fastest, bool noMotorways = false, bool noTollways = false, Vector2[] via = null)
 {
     OnlineMapsOpenRouteService query = new OnlineMapsOpenRouteService(start, end, lang, pref, noMotorways, noTollways, via);
     OnlineMaps.instance.AddGoogleAPIQuery(query);
     return query;
 }