﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for MarkerHelper
/// </summary>
public class MarkerHelper
{
    public MarkerHelper()
    {

    }

    public static string GetMarkerUrl(object position)
    {
        if (position == null)
        {
            return @"http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.5|0|000000|10|_|?";

        }
        else
        {
            return GetMarkerUrl(int.Parse(position.ToString()));
        }
    }

    public static string GetWorkedMarkerUrl(object position)
    {
        if (position == null)
        {
            return @"http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.5|0|D1D1D1|10|_|";

        }
        else
        {
            return GetWorkedMarkerUrl(int.Parse(position.ToString()));
        }
    }

    public static string GetWorkedMarkerUrl(int position)
    {
        return @"http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.5|0|D1D1D1|10|_|" + position.ToString();
    }

    public static string GetMarkerUrl(int position)
    {
        string color = "000000";
        switch (position / 100)
        {
            case 0:
                color = "BFEFFF";
                break;
            case 1:
                color = "F5F5DC";
                break;
            case 2:
                color = "C1FFC1";
                break;
            case 3:
                color = "E0EEE0";
                break;
            case 4:
                color = "FFB6C1";
                break;
            case 5:
                color = "E066FF";
                break;
            default:
                color = "E6E6FA";
                break;
        }
        return @"http://chart.apis.google.com/chart?chst=d_map_spin&chld=0.5|0|" + color + "|10|_|" + position.ToString();

    }
}