private void map_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            string x = map.CenterPoint.GetX().ToString();
            string y = map.CenterPoint.GetY().ToString();

            //chi lấy 3 số sau . để so sánh tọa đọ lấy được với tọa độ trong csdl
            string[] x1 = x.Split(',');
            x1[1] = x1[1].Substring(0, 3);
            x     = x1[0] + "." + x1[1];
            //textBox2.Text = x;
            string[] y1 = y.Split(',');
            y1[1] = y1[1].Substring(0, 3);
            y     = y1[0] + "." + y1[1];
            //textBox3.Text = y;
            //x:kinh do ,y:vi do:sau khi lay duoc thi tim ID Xa ->IDCoS0
            DataTable ds = wf.HienThiDSCoSo(",a.GioiThieu", " where a.ViDo like N'%" + y + "%' and a.KinhDo like N'%" + x + "%'");

            if (int.Parse(ds.Rows.Count.ToString()) == 1)
            {
                txtIDCoSo.Text = ds.Rows[0]["IDCoSo"].ToString();
                HienThi();
            }

            //khắc phục thêm nếu có từ 2 cơ sở trở lên
        }
示例#2
0
        void mapControl1_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            string selectedCountryName = GetCountryNameFromItem(e.Item);

            this.gameCore.TrySelectionCountry(selectedCountryName);
            FileLayer.SelectedItems.Clear();
        }
示例#3
0
 private void mapControl_MapItemClick(object sender, MapItemClickEventArgs e)
 {
     if (e.Item is MapBubble)
     {
         StoresLayer.SelectedItem = e.Item;
         HomeData.Items.Clear();
         HomeData.Items.Add(listStores.FindLast(q => q.Latitude == ((MapBubble)StoresLayer.SelectedItem).Location.GetY()).MapItem);
     }
 }
        private void mapControl1_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            MapBubble a = e.Item as MapBubble;

            if (a != null)
            {
                MessageBox.Show(Convert.ToString(a));
            }
        }
示例#5
0
        void OnMapItemClick(object sender, MapItemClickEventArgs e)
        {
            var attr = e.Item.Attributes["RevenueYTD"];

            if (attr == null)
            {
                (mapControl1.Layers[1] as VectorItemsLayer).SelectedItem = item;
                return;
            }
            item = e.Item;
            SalesPerformanceDataGenerator.Current.Filter = e.Item.Attributes["NAME"].Value.ToString();
        }
示例#6
0
        //------------------------------------------------------------------------
        private void m_wndMap_MapItemClicked(CVEarthCtrl ctrl, MapItemClickEventArgs args)
        {
            IMapItem item = args.Item;

            if (item != null)
            {
                SelectItemInTree(item);
            }
            m_currentSelectedMapItem = item;
            if (args.MouseArgs.Button == System.Windows.Forms.MouseButtons.Right)
            {
                m_menuItem.Show(this, new Point(args.MouseArgs.X, args.MouseArgs.Y));
            }
        }
示例#7
0
        void mapControl_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            MapBubble bubble = e.Item as MapBubble;

            if (bubble != null)
            {
                StoresLayer.SelectedItem = e.Item;
                HomeData.Items.Clear();
                var last = listStores.FindLast(q => q.Latitude == bubble.Location.GetY());
                if (last != null)
                {
                    HomeData.Items.Add(last.MapItem);
                }
            }
        }
示例#8
0
        private void mapControl1_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            MapPushpin pushpin = e.Item as MapPushpin;

            if (pushpin == null)
            {
                return;
            }
            if (helper.Pushpins.Contains(pushpin))
            {
                return;
            }

            helper.AddItem(pushpin);
            CalculateRoute();
            e.Handled = true;
        }
        void mapControl_MapItemClick(object sender, MapItemClickEventArgs e)
        {
            //if(IsCountyMode) return;//as for now
            bool showHintOnClick = false;

            if (MouseEventSourceInfo.IsTouchEvent() && e.MouseArgs.Clicks == 1)
            {
                if (Environment.TickCount - lastClickTime > 200)
                {
                    lastClickTime   = Environment.TickCount;
                    showHintOnClick = true;
                    if (IsCountyMode && StateFromMapAttribute(e.Item.Attributes) != null)
                    {
                        showHintOnClick = false;
                    }
                }
            }
            if (showHintOnClick)
            {
                mapTooltipController.ShowHint(new ToolTipControlInfo(e.Item, "text")
                {
                    ImmediateToolTip = true,
                    ForcedShow       = DefaultBoolean.True,
                    ToolTipLocation  = ToolTipLocation.TopCenter,
                    ToolTipPosition  = Point.Subtract(mapControl.PointToScreen(e.MouseArgs.Location), new Size(0, 60))
                });
                e.Handled = true;
                return;
            }

            var state = StateFromMapAttribute(e.Item.Attributes);

            if (state != null)
            {
                if (IsElectionPlaygroundMode) // e.MouseArgs.Button == MouseButtons.Right) {
                {
                    SwitchStateVote(state);
                    return;
                }
                ShowCountyMap(state);
            }
        }
示例#10
0
 private void OnPinClick(object sender, MapItemClickEventArgs e)
 {
     //((MapPushpin)e.Item).Text
     MessageBox.Show(((MapPushpin)e.Item).Text);
 }
示例#11
0
 private void njbGoogleMap1_MapMarkerRightClick(object sender, MapItemClickEventArgs e)
 {
     LastMarkerRightClick = e.ID;
     MarkerMenu.Show(Cursor.Position.X, Cursor.Position.Y);
 }
示例#12
0
 private void njbGoogleMap1_MapMarkerClick(object sender, MapItemClickEventArgs e)
 {
     MessageBox.Show("Marker " + e.ID + " Clicked");
 }
示例#13
0
 private void njbGoogleMap1_MapPolygonClick(object sender, MapItemClickEventArgs e)
 {
     MessageBox.Show("Polygon " + e.ID + " Clicked");
 }
示例#14
0
 private void njbGoogleMap1_MapPolygonRightClick(object sender, MapItemClickEventArgs e)
 {
     LastPolygonRightClick = e.ID;
     PolygonMenu.Show(Cursor.Position.X, Cursor.Position.Y);
 }
示例#15
0
 private void mapControl1_MapItemClick(object sender, MapItemClickEventArgs e)
 {
     districtNumber = locations.Find(x => x.Name == (string)e.Item.Attributes[1].Value).LocationId;
     ResumeGu();
 }