Exemple #1
0
    public static string Upgrade(int providerID, int type)
    {
        StringBuilder builder = new StringBuilder();

        if (providerID == 0)
        {
            builder.Append("arcgis");
        }
        else if (providerID == 1)
        {
            builder.Append("google");
        }
        else if (providerID == 2)
        {
            builder.Append("nokia");
        }
        else if (providerID == 3)
        {
            builder.Append("mapquest");
        }
        else if (providerID == 4)
        {
            builder.Append("virtualearth");
        }
        else if (providerID == 5)
        {
            builder.Append("osm");
        }
        else if (providerID == 6)
        {
            builder.Append("sputnik");
        }
        else if (providerID == 7)
        {
            builder.Append("amap");
        }
        else if (providerID == 8)
        {
            builder.Append("skobbler");
        }
        else if (providerID == 999)
        {
            builder.Append("custom").Append(".").Append("custom");
        }
        else
        {
            Debug.LogWarning("Trying to upgrade provider failed. Please select the provider manually.");
            return("arcgis");
        }

        string[] availableTypes = OnlineMaps.GetAvailableTypes((OnlineMapsProviderEnum)providerID);

        if (providerID < 8 && availableTypes.Length > type)
        {
            builder.Append(".");
            builder.Append(availableTypes[type].ToLower());
        }

        return(builder.ToString());
    }