function MapIconMaker() {
}

MapIconMaker.prototype.createMarkerIcon = function(options) {
    var width = options.width || 32;
    var height = options.height || 32;
    var cornerColor = options.cornerColor || '#FFFFFF';
    var primaryColor = options.primaryColor || '#FF0000';
    var strokeColor = options.strokeColor || '#000000';
    var baseUrl = 'http://chart.apis.google.com/chart?cht=mm';
    var iconUrl = baseUrl + '&chs='
        + width + 'x'
        + height + '&chco='
        + cornerColor.replace('#', '') + ','
        + primaryColor.replace('#', '') + ','
        + strokeColor.replace('#', '') + '&ext=.png';
    var icon = new GIcon(G_DEFAULT_ICON);
    icon.image = iconUrl;
    icon.iconSize = new GSize(width, height);
    icon.shadowSize = new GSize(Math.floor(width * 1.6), height);
    icon.iconAnchor = new GPoint(width / 2, height);
    icon.infoWindowAnchor = new GPoint(width / 2, Math.floor(height / 12));
    icon.printImage = iconUrl + '&chof=gif';
    icon.mozPrintImage = iconUrl + '&chf=bg,s,ECECD8' + '&chof=gif';
    iconUrl = baseUrl + '&chs='
        + width + 'x'
        + height + '&chco='
        + cornerColor.replace('#', '') + ','
        + primaryColor.replace('#', '') + ','
        + strokeColor.replace('#', '');
    icon.transparent = iconUrl + '&chf=a,s,ffffff11&ext=.png';
    icon.imageMap = [
        width / 2, height,
        (7 / 16) * width, (5 / 8) * height,
        (5 / 16) * width, (7 / 16) * height,
        (7 / 32) * width, (5 / 16) * height,
        (5 / 16) * width, (1 / 8) * height,
        (1 / 2) * width, 0,
        (11 / 16) * width, (1 / 8) * height,
        (25 / 32) * width, (5 / 16) * height,
        (11 / 16) * width, (7 / 16) * height,
        (9 / 16) * width, (5 / 8) * height
    ];

    for (var i = 0; i < icon.imageMap.length; i++) {
        icon.imageMap[i] = parseInt(icon.imageMap[i]);
    }

    return icon;
}

