private void GetLocationAndShow(MapProvider mapProvider)
        {
            try
            {
                if (isPopulatingSelectRows)
                {
                    return;
                }

                List <LocationCoordinate> locationCoordinates = new List <LocationCoordinate>();

                DataGridView dataGridView = kryptonDataGridViewLocationHistory;
                foreach (int rowIndex in DataGridViewHandler.GetRowSelected(dataGridView))
                {
                    DataGridViewGenericRow dataGridViewGenericRow = DataGridViewHandler.GetRowDataGridViewGenericRow(dataGridView, rowIndex);
                    if (dataGridViewGenericRow != null && !dataGridViewGenericRow.IsHeader && dataGridViewGenericRow.LocationCoordinate != null)
                    {
                        if (!locationCoordinates.Contains(dataGridViewGenericRow.LocationCoordinate))
                        {
                            locationCoordinates.Add(dataGridViewGenericRow.LocationCoordinate);
                        }
                    }
                }
                ShowMediaOnMap.UpdatedBroswerMap(browser, locationCoordinates, GetZoomLevel(), mapProvider);
            }
            catch (Exception ex)
            {
                //Logger.Error(ex);
                KryptonMessageBox.Show("Unexpected error occur.\r\nException message:" + ex.Message + "\r\n",
                                       "Unexpected error occur", MessageBoxButtons.OK, MessageBoxIcon.Error, showCtrlCopy: true);
            }
            finally
            {
            }
        }
예제 #2
0
        private void GetLocationAndShow(MapProvider mapProvider)
        {
            List <LocationCoordinate> locationCoordinates = new List <LocationCoordinate>();

            DataGridView dataGridView = dataGridViewMap;

            foreach (DataGridViewCell dataGridViewCell in dataGridView.SelectedCells)
            {
                if (LocationCoordinate.TryParse(DataGridViewHandler.GetCellValueNullOrStringTrim(dataGridView, dataGridViewCell.ColumnIndex, dataGridViewCell.RowIndex), out LocationCoordinate locationCoordinate))
                {
                    if (!locationCoordinates.Contains(locationCoordinate))
                    {
                        locationCoordinates.Add(locationCoordinate);
                    }
                }
            }
            ShowMediaOnMap.UpdatedBroswerMap(browser, locationCoordinates, GetZoomLevel(), mapProvider);
        }
예제 #3
0
        private void UpdateBrowserMap(string combinedCorordinateString, MapProvider mapProvider)
        {
            if (ClipboardUtility.IsClipboardActive && ClipboardUtility.NuberOfItemsToEdit > 1)
            {
                return;
            }
            DataGridView dataGridView = dataGridViewMap;

            if (DataGridViewHandler.GetCellSelectedCount(dataGridView) == 1) //Only updated the Browser Map when one cell are updated
            {
                LocationCoordinate locationCoordinate = LocationCoordinate.Parse(combinedCorordinateString);

                if (locationCoordinate != null)
                {
                    locationCoordinateRememberForZooming = new LocationCoordinate(locationCoordinate.Latitude, locationCoordinate.Longitude);
                    ShowMediaOnMap.UpdateBrowserMap(browser, locationCoordinate, GetZoomLevel(), mapProvider);
                }
            }
        }
예제 #4
0
        private void comboBoxMapZoomLevel_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (GlobalData.IsApplicationClosing)
            {
                return;
            }
            if (isSettingDefaultComboxValues)
            {
                return;
            }
            if (GlobalData.IsPopulatingMap)
            {
                return;
            }

            Properties.Settings.Default.ComboBoxMapZoomLevel = comboBoxMapZoomLevel.SelectedIndex;

            if (locationCoordinateRememberForZooming != null)
            {
                ShowMediaOnMap.UpdateBrowserMap(browser, locationCoordinateRememberForZooming, GetZoomLevel(), GetMapProvider());                                               //Use last valid coordinates clicked
            }
        }
예제 #5
0
 private MapProvider GetMapProvider()
 {
     return(ShowMediaOnMap.GetMapProvider(textBoxBrowserURL.Text));
 }