Map Culture

Jul 19, 2010 at 2:46 PM

hi, sorry for so many questions :(

Is it possible to hope on next update:

Create additional google map type - Google Local Culture and use next URL in it:

"http://mt3.google.com/vt/lyrs=m@107&hl=" + Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName + "&x=18&y=10&z=5&s="

This allow application to manage google map culture (text languages). Maybe some other map providers support same posibility?

Jul 19, 2010 at 6:09 PM

it's was possible long ago, map.Manager.Language = ...

Jul 19, 2010 at 6:46 PM
Edited Jul 19, 2010 at 6:48 PM

Why you so love custom types? :(

Show me simple mapping from Thread.CurrentThread.CurrentUICulture to your LanguageType please.

Jul 19, 2010 at 7:04 PM

because it is custom, http://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1

Jul 19, 2010 at 7:11 PM
Edited Jul 19, 2010 at 7:20 PM

 

        public static string EnumToString(this Enum value)
        {
            FieldInfo fi = value.GetType().GetField(value.ToString());
            DescriptionAttribute[] attributes =
                   (DescriptionAttribute[])fi.GetCustomAttributes(
                  typeof(DescriptionAttribute), false);

            return (attributes.Length > 0) ? attributes[0].Description : value.ToString();
        }

        public static T StringToEnum<T>(this string value)
        {
            FieldInfo[] fi = typeof(T).GetFields();
            foreach (FieldInfo info in fi)
            {
                List<DescriptionAttribute> attributes = new List<DescriptionAttribute>((DescriptionAttribute[])info.GetCustomAttributes(typeof(DescriptionAttribute), false));
                if (attributes.Any(x => x.Description == value))
                {
                    return (T)info.GetValue(null);
                }                
            }
            return default(T);
        }

Jul 19, 2010 at 7:15 PM
Edited Jul 19, 2010 at 7:22 PM
radioman wrote:

because it is custom, http://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1

 

Google return image in any way, if specified language not right or not present at all. And because most of languages use standard 2 symbol - it's possible to unify this part. And automate it - using CurrentUICulture by default.

Jul 19, 2010 at 7:39 PM

in many cases, that parameter doesn't matter

Jul 20, 2010 at 8:52 AM

It's verry important for right Localization.