Ejemplo n.º 1
0
        private void Map_ShapeIdentified(object sender, AxMapWinGIS._DMapEvents_ShapeIdentifiedEvent e)
        {
            if (e.shapeIndex > -1)
            {
                spJournalistInfo.Children.Clear();

                Journalist j = _media.journalists[_indexOrders[e.shapeIndex]];
                spJournalistInfo.Children.Add(ViewUtils.CreateLabel(j.ToString() + " (" + j.age + " ans)", "StyleLabel2", 12, -1));
                spJournalistInfo.Children.Add(ViewUtils.CreateLabel("Basé à " + j.baseCity.Name, "StyleLabel2", 12, -1));
                List <Match> commentedGames = j.CommentedGames;
                commentedGames.Sort(new MatchDateComparator());
                ViewMatches view = new ViewMatches(commentedGames, true, false, false, false, false, true);
                view.Full(spMatches);
            }
        }
Ejemplo n.º 2
0
        private void AxMap_ShapeIdentified(object sender, AxMapWinGIS._DMapEvents_ShapeIdentifiedEvent e)
        {
            int selectedLayerHandle = e.layerHandle;
            int selectedShapeIndex  = e.shapeIndex;

            // multiple layers clicked, for simplicity just take the point-type, because on others we can click somewhere
            if (e.layerHandle == -1)
            {
                SelectionList sl = AxMap.IdentifiedShapes;

                // check for raste layers (remove them, we dont need it)
                for (int i = 0; i < sl.Count; i++)
                {
                    Shapefile sf = AxMap.get_Shapefile(sl.LayerHandle[i]);
                    if (sf == null)
                    {
                        sl.RemoveByLayerHandle(sl.LayerHandle[i]);
                    }
                }
                if (sl.Count > 1)
                {
                    for (int i = 0; i < sl.Count; i++)
                    {
                        Shapefile sf = AxMap.get_Shapefile(sl.LayerHandle[i]);

                        if (sf.ShapefileType == ShpfileType.SHP_POINT)
                        {
                            selectedLayerHandle = sl.LayerHandle[i];
                            selectedShapeIndex  = sl.ShapeIndex[i];
                        }
                        else
                        {
                            sl.RemoveByLayerHandle(sl.LayerHandle[i]);
                        }
                    }
                }


                // if there was no point, just take the first one
                if (selectedLayerHandle == -1)
                {
                    selectedLayerHandle = sl.LayerHandle[0];
                    selectedShapeIndex  = sl.ShapeIndex[0];
                }
            }

            foreach (ILayer layer in CurrentSelectionLayers)
            {
                if (layer.GetType() == typeof(ResTBDamagePotentialLayer))
                {
                    if ((selectedLayerHandle == ((ResTBDamagePotentialLayer)layer).PointHandle) || (selectedLayerHandle == ((ResTBDamagePotentialLayer)layer).LineHandle) || (selectedLayerHandle == ((ResTBDamagePotentialLayer)layer).PolygonHandle))
                    {
                        Events.MapControl_Clicked clicked = new Events.MapControl_Clicked();
                        Shapefile sf = AxMap.get_Shapefile(selectedLayerHandle);

                        clicked.ClickedShape      = sf.Shape[selectedShapeIndex];
                        clicked.ClickedShapeFile  = sf;
                        clicked.ClickedShapeIndex = selectedShapeIndex;
                        clicked.Layer             = layer;
                        MapControlTools.On_ShapeClicked(clicked);

                        Events.MapControl_SelectingStateChange selectingStateChange = new Events.MapControl_SelectingStateChange()
                        {
                            SelectingState = Events.SelectingState.ShapeSelected, SelectingLayers = CurrentSelectionLayers
                        };
                        On_SelectingStateChange(selectingStateChange);

                        //StopSelecting();
                    }
                }
                else if (selectedLayerHandle == layer.Handle)
                {
                    Events.MapControl_Clicked clicked = new Events.MapControl_Clicked();
                    Shapefile sf = AxMap.get_Shapefile(selectedLayerHandle);

                    clicked.ClickedShape      = sf.Shape[selectedLayerHandle];
                    clicked.ClickedShapeFile  = sf;
                    clicked.ClickedShapeIndex = selectedShapeIndex;
                    clicked.Layer             = layer;
                    MapControlTools.On_ShapeClicked(clicked);
                    Events.MapControl_SelectingStateChange selectingStateChange = new Events.MapControl_SelectingStateChange()
                    {
                        SelectingState = Events.SelectingState.ShapeSelected, SelectingLayers = CurrentSelectionLayers
                    };
                    On_SelectingStateChange(selectingStateChange);

                    //StopSelecting();
                }
            }
        }
Ejemplo n.º 3
0
 private void axMap1_ShapeIdentified(object sender, AxMapWinGIS._DMapEvents_ShapeIdentifiedEvent e)
 {
     axMap1.ZoomToShape(e.layerHandle, e.shapeIndex);
 }