using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GoogleMapControl
{
    /// <summary>
    /// Classe que representara o Mapa
    /// </summary>
    public partial class Map : System.Web.UI.WebControls.Panel
    {
        private string _GoogleMapsJavaScriptURL = "";

        private string _ZoomInButtonText = "";
        private string _ZoomInButtonImage = "";
        private string _ZoomOutButtonText = "";
        private string _ZoomOutButtonImage = "";
        private string _MoveButtonText = "";
        private string _MoveButtonImage = "";
        private string _ZoomSelectedButtonText = "";
        private string _ZoomSelectedButtonImage = "";
        private string _LabelSearch = "";
        private string _SearchButtonText = "";
        private string _SearchButtonImage = "";
        private string _SearchInputCssClass = "";
        private string _ImageCssClass = "";

        #region Novas Propriedades

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string GoogleMapKey { get; set; }


        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        //[System.ComponentModel.DefaultValue("http://maps.google.com/maps?file=api&amp;v=2&amp;key={0}")]
        [System.ComponentModel.Category("Google Maps")]
        public string GoogleMapsJavaScriptURL
        {
            get
            {
                if (string.IsNullOrEmpty(_GoogleMapsJavaScriptURL))
                {
                    //return "http://maps.google.com/maps?file=api&amp;v=2&amp;key={0}";
                    return "http://maps.google.com/maps?file=api&amp;v=2.x&amp;key={0}";
                            
                }
                else { return _GoogleMapsJavaScriptURL; }
            }
        }



        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public int Zoom { get; set; }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public double Lat { get; set; }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public double Lng { get; set; }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public bool ShowToolBar { get; set; }




        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomInButtonText
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomInButtonText))
                {
                    return "Aumentar Zoom";
                }
                return this._ZoomInButtonText;
            }
        }


        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomInButtonImage
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomInButtonImage))
                {
                    return this.Page.ClientScript.GetWebResourceUrl(GetType(), "GoogleMapControl.zoomin.png");
                }
                return this._ZoomInButtonImage;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomOutButtonText
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomOutButtonText))
                {
                    return "Diminuir Zoom";
                }
                return this._ZoomOutButtonText;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomOutButtonImage
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomOutButtonImage))
                {
                    return this.Page.ClientScript.GetWebResourceUrl(GetType(), "GoogleMapControl.zoomout.png");
                }
                return this._ZoomOutButtonImage;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string MoveButtonText
        {
            get
            {
                if (string.IsNullOrEmpty(this._MoveButtonText))
                {
                    return "Mover Mapa";
                }
                return this._MoveButtonText;
            }
        }


        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string MoveButtonImage
        {
            get
            {
                if (string.IsNullOrEmpty(this._MoveButtonImage))
                {
                    return this.Page.ClientScript.GetWebResourceUrl(GetType(),"GoogleMapControl.ie-hand.gif");
                }
                return this._MoveButtonImage;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomSelectedButtonText
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomSelectedButtonText))
                {
                    return "Zoom por Seleção";
                }
                return this._ZoomSelectedButtonText;
            }
        }


        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ZoomSelectedButtonImage
        {
            get
            {
                if (string.IsNullOrEmpty(this._ZoomSelectedButtonImage))
                {
                    return this.Page.ClientScript.GetWebResourceUrl(GetType(), "GoogleMapControl.zoomselected.png");
                }
                return this._ZoomSelectedButtonImage;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string LabelSearch
        {
            get
            {
                if (string.IsNullOrEmpty(this._LabelSearch))
                {
                    return "Encontrar no mapa:";
                }
                return this._LabelSearch;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string SearchButtonText
        {
            get
            {
                if (string.IsNullOrEmpty(this._SearchButtonText))
                {
                    return "Encontrar no mapa:";
                }
                return this._SearchButtonText;
            }
        }
        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string SearchButtonImage
        {
            get
            {
                if (string.IsNullOrEmpty(this._SearchButtonImage))
                {
                    return this.Page.ClientScript.GetWebResourceUrl(GetType(), "GoogleMapControl.mag-glass.jpg");
                    
                }
                return this._SearchButtonImage;
            }
        }
        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string SearchInputCssClass
        {
            get
            {
                if (string.IsNullOrEmpty(this._SearchInputCssClass))
                {
                    return "";
                }
                return this._SearchInputCssClass;
            }
        }

        [System.ComponentModel.Browsable(true)]
        [System.ComponentModel.Localizable(true)]
        [System.ComponentModel.Bindable(true)]
        [System.ComponentModel.Category("Google Maps")]
        public string ImageCssClass
        {
            get
            {
                if (string.IsNullOrEmpty(this._ImageCssClass))
                {
                    return "";
                }
                return this._ImageCssClass;
            }
        }
        #endregion
    }
}

