Ejemplo n.º 1
0
 protected static string LocationValue(Location location)
 {
     string str = string.Empty;
     return AbstractEfaProvider.EscapeUmlauts(location.Type != LocationType.STATION && location.Type != LocationType.POI || !location.HasId() ? 
                                              location.Name : location.Id.ToString());
 }
Ejemplo n.º 2
0
 private void AppendLocation(StringBuilder uri, Location location, string paramSuffix)
 {
     if (this._canAcceptPoiID && location.Type == LocationType.POI && location.HasId())
     {
         uri.Append("&type_").Append(paramSuffix).Append("=poiID");
         uri.Append("&name_").Append(paramSuffix).Append("=").Append(location.Id);
     }
     else if ((location.Type == LocationType.POI || location.Type == LocationType.ADDRESS) && location.HasLocation())
     {
         NumberFormatInfo numberFormatInfo = new NumberFormatInfo();
         numberFormatInfo.NumberDecimalSeparator = ".";
         uri.Append("&type_").Append(paramSuffix).Append("=coord")
             .Append("&name_").Append(paramSuffix).Append("=")
             .Append(string.Format(numberFormatInfo, "{0:0.######}:{1:0.######}", location.Lon / 1000000.0, location.Lat / 1000000.0 ))
             .Append(":WGS84");
     }
     else
     {
         uri.Append("&type_").Append(paramSuffix).Append("=").Append(AbstractEfaProvider.LocationTypeValue(location));
         uri.Append("&name_").Append(paramSuffix).Append("=").Append(Uri.EscapeUriString(AbstractEfaProvider.LocationValue(location)));
     }
 }