public GpsSetup(GPSIcon gpsIcon, GPSTrackLine gpsTrackLine, GPSGeoFence geoFence)
        {
            m_gpsIcon = gpsIcon;
            m_gpsTrackLine = gpsTrackLine;
            m_gpsFence = geoFence;

            InitializeComponent();

            if (m_gpsIcon!=null)
            {
                if (m_gpsIcon.m_RenderInfo.bPOI)
                {
                    checkBoxDistanceFromPOI.Enabled = true;
                    checkBoxDistanceFromPOI.Text = "Distance && bearing to " + m_gpsIcon.m_RenderInfo.sDescription + " from all Gps";
                    checkBoxDistanceFromPOI.Checked = m_gpsIcon.m_bSignalDistance;
                    checkBoxDistanceToPOI.Enabled = false;
                    checkBoxDistanceToPOI.Text = "Distance from " + m_gpsIcon.m_RenderInfo.sDescription + " to all POIs";
                    checkBoxTrackHeading.Enabled = false;
                    checkBoxTrackLine.Enabled = false;
                }
                else
                {
                    checkBoxDistanceFromPOI.Enabled = false;
                    checkBoxDistanceFromPOI.Text = "Distance && bearing to " + m_gpsIcon.m_RenderInfo.sDescription + " from all Gps";
                    checkBoxDistanceToPOI.Enabled = true;
                    checkBoxDistanceToPOI.Text = "Distance from " + m_gpsIcon.m_RenderInfo.sDescription + " to all POIs";
                    checkBoxDistanceToPOI.Checked = m_gpsIcon.m_bSignalDistance;
                }

                checkBoxInformationText.Checked = m_gpsIcon.m_bShowInfo;
                checkBoxTrackHeading.Checked = m_gpsIcon.m_bTrackHeading;
                checkBoxTrackLine.Checked = m_gpsIcon.m_bTrackLine;
                labelTitle.Text = "Set options for " + m_gpsIcon.m_RenderInfo.sDescription;
            }
            else
            if (m_gpsTrackLine != null)
            {
                checkBoxInformationText.Checked = m_gpsTrackLine.m_bShowInfo;
                checkBoxTrackHeading.Enabled = false;
                checkBoxTrackLine.Enabled = false;
                checkBoxDistanceFromPOI.Text = "Distance && bearing to " + m_gpsTrackLine.m_sDescription + " from all Gps";
                checkBoxDistanceFromPOI.Enabled = false;
                checkBoxDistanceToPOI.Text = "Distance from " + m_gpsTrackLine.m_sDescription + " to all POIs";
                checkBoxDistanceToPOI.Enabled = false;
                labelTitle.Text = "Set options for " + m_gpsIcon.m_RenderInfo.sDescription;
            }
            else
                if (m_gpsFence != null)
            {
                checkBoxInformationText.Checked = m_gpsFence.m_bShowInfo;
                checkBoxTrackHeading.Enabled = false;
                checkBoxTrackLine.Enabled = false;
                checkBoxDistanceFromPOI.Text = "Distance && bearing to " + m_gpsFence.m_sDescription + " from all Gps";
                checkBoxDistanceFromPOI.Enabled = false;
                checkBoxDistanceToPOI.Text = "Distance from " + m_gpsFence.m_sDescription + " to all POIs";
                checkBoxDistanceToPOI.Enabled = false;
                labelTitle.Text = "Set options for " + m_gpsFence.m_sDescription;
            }

            
        }
		//
		//Show the user selected icon for the gps device on the WorldView
		public void ShowOverlay(GPSRenderInformation renderInformation)
		{
            lock ("RenderAccess")
			{
				if (renderInformation.gpsTrack!=null)
				{
                    //Resize array if necessary
                    if (renderInformation.iIndex >= m_uTrackResize)
                    {
                        m_uTrackResize = (uint)renderInformation.iIndex+1;
                        Array.Resize(ref m_gpsTrack, (int)m_uTrackResize);
                    }

					if (m_gpsTrack[renderInformation.iIndex]==null)
                        m_gpsTrack[renderInformation.iIndex] = new GPSTrackLine(ParentApplication.WorldWindow.CurrentWorld, renderInformation.sDescription);
                    m_gpsTrack[renderInformation.iIndex].Initialize(this.drawArgs);
                    m_gpsTrack[renderInformation.iIndex].SetTrack(this, renderInformation.gpsTrack, renderInformation.sDescription, renderInformation.colorTrack, renderInformation.sIcon, renderInformation.bShowInfo);
					Add(m_gpsTrack[renderInformation.iIndex]);
				}
				else
				{
					if (renderInformation.bPOI==false)
					{
						
						int iIndex;
						for (iIndex=0; iIndex<m_iGpsIconIndex; iIndex++)
							if (renderInformation.sDescription==m_gpsIcons[iIndex].m_RenderInfo.sDescription)
								break;

						if (iIndex==m_iGpsIconIndex)
						{
                            //Resize array if necessary
                            if (m_iGpsIconIndex>=m_uIconResize)
                            {
                                m_uIconResize+=5;
                                Array.Resize(ref m_gpsIcons, (int)m_uIconResize);
                            }

							m_gpsIcons[iIndex] = new GPSIcon(this, renderInformation, ParentApplication.WorldWindow.CurrentWorld);
							m_gpsIcons[iIndex].Initialize(this.drawArgs);
							Add(m_gpsIcons[iIndex]);
							m_iGpsIconIndex++;
						}

						if (m_gpsIcons[iIndex].m_bTrack)
							Plugin.pluginWorldWindowGotoLatLonHeading(renderInformation.fLat,renderInformation.fLon,renderInformation.fHeading,renderInformation.iStartAltitud);

						m_gpsIcons[iIndex].SetGpsData(drawArgs, renderInformation);
					}
					else
					{
                        //Resize array if necessary
                        if (m_iGpsPOIIndex >= m_uPOIResize)
                        {
                            m_uPOIResize += 5;
                            Array.Resize(ref m_gpsPOI, (int)m_uPOIResize);
                        }

						if (m_gpsPOI[m_iGpsPOIIndex]==null)
						{
							m_gpsPOI[m_iGpsPOIIndex] = new GPSIcon(this, renderInformation.iIndex,renderInformation, ParentApplication.WorldWindow.CurrentWorld);
							m_gpsPOI[m_iGpsPOIIndex].Initialize(this.drawArgs);
							Add(m_gpsPOI[m_iGpsPOIIndex]);
						}
						m_iGpsPOIIndex++;
					}
				}
			}
		}