コード例 #1
0
ファイル: Default.aspx.cs プロジェクト: ziad007/URI2
        /// <summary>
        /// Handles the show click.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        protected void HandleShowClick(object sender, EventArgs e)
        {
            string point = txtPoint.Text;
            if (!string.IsNullOrEmpty(point)) {
                string[] pair = point.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
                if (pair.Length == 2) {
                    double lat, lng;

                    if (double.TryParse(pair[0], out lat)) {
                        if (double.TryParse(pair[1], out lng)) {
                            GoogleMap1.Center.Latitude = lat;
                            GoogleMap1.Center.Longitude = lng;
                        }
                    }
                }
            }
            else {

                Competition.CompetitionPlayers complayers = new Competition.CompetitionPlayers();
                complayers = complayers.MAXgetPlayerDetail(1);

                int i = 0;

                GoogleMap1.Latitude = complayers.PrizeXCoordinates;
                GoogleMap1.Latitude = complayers.PrizeYCoordinates;

                if (complayers.Counter > 5)

                    GoogleMap1.Zoom += 30;

                if (complayers.Counter > 10)

                    GoogleMap1.Zoom += 50;

                else
                    GoogleMap1.Zoom += 10;

                string address = txtAddress.Text;
                if (!string.IsNullOrEmpty(address)) {
                 //   GoogleMap1.Address = address;
                  //  GoogleMap1.Center = null;
                }
            }

            txtAddress.Text = null;
            txtPoint.Text = null;
        }
コード例 #2
0
ファイル: Default.aspx.cs プロジェクト: ziad007/URI2
        protected void Page_Load(object sender, EventArgs e)
        {
            Competition.CompetitionPlayers complayers = new Competition.CompetitionPlayers();
            complayers = complayers.MAXgetPlayerDetail(1);

            int i = 0;

            GoogleMap1.Latitude = complayers.PrizeXCoordinates;
            GoogleMap1.Latitude = complayers.PrizeYCoordinates;

            if (complayers.Counter > 5)

                GoogleMap1.Zoom += 30;

            if (complayers.Counter > 10)

                GoogleMap1.Zoom += 50;

            else
                GoogleMap1.Zoom += 10;
        }