예제 #1
0
        public void UpdateLabelLocation(GPSTrackingMonitor.Communications.MessagePool trackingMessagePool)
        {
            if (trackingMessagePool == null || trackingMessagePool.Count == 0)
            {
                return;
            }

            MapObjects2.Point oCarLocation = new MapObjects2.PointClass();

            MapObjects2.TextSymbol oLabelSymbol = new MapObjects2.TextSymbolClass();
            oLabelSymbol.Font.Name           = "Arial";
            oLabelSymbol.Font.Size           = 8;
            oLabelSymbol.Color               = (uint)MapObjects2.ColorConstants.moYellow;
            oLabelSymbol.HorizontalAlignment = MapObjects2.AlignmentConstants.moAlignCenter;
            oLabelSymbol.VerticalAlignment   = MapObjects2.AlignmentConstants.moAlignCenter;

            int iGeoEventCount = this._trackingLayer.EventCount;

            MapObjects2.GeoEvent oGeoEvent = null;
            double dVerticalOffset         = this._mapControl.ToMapDistance(10f);

            for (int i = 0; i < iGeoEventCount; i++)
            {
                oGeoEvent = this._trackingLayer.get_Event(i);

                oCarLocation.X = oGeoEvent.X;
                oCarLocation.Y = oGeoEvent.Y + dVerticalOffset;

                this._mapControl.DrawText(oGeoEvent.Tag, oCarLocation, oLabelSymbol);
            }
        }
예제 #2
0
        public void UpdateLabelLocation(GPSTrackingMonitor.Communications.MessagePool trackingMessagePool)
        {
            if (trackingMessagePool == null || trackingMessagePool.Count == 0) return;

            MapObjects2.Point oCarLocation = new MapObjects2.PointClass();

            MapObjects2.TextSymbol oLabelSymbol = new MapObjects2.TextSymbolClass();
            oLabelSymbol.Font.Name = "Arial";
            oLabelSymbol.Font.Size = 8;
            oLabelSymbol.Color = (uint)MapObjects2.ColorConstants.moYellow;
            oLabelSymbol.HorizontalAlignment = MapObjects2.AlignmentConstants.moAlignCenter;
            oLabelSymbol.VerticalAlignment = MapObjects2.AlignmentConstants.moAlignCenter;

            int iGeoEventCount = this._trackingLayer.EventCount;
            MapObjects2.GeoEvent oGeoEvent = null;
            double dVerticalOffset = this._mapControl.ToMapDistance(10f);

            for (int i = 0; i < iGeoEventCount; i++)
            {
                oGeoEvent = this._trackingLayer.get_Event(i);

                oCarLocation.X = oGeoEvent.X;
                oCarLocation.Y = oGeoEvent.Y + dVerticalOffset;

                this._mapControl.DrawText(oGeoEvent.Tag, oCarLocation, oLabelSymbol);
            }
        }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void mapEye_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
 {
     if (e.index != 0)
     {
         return;
     }
     symE = new MapObjects2.SymbolClass();
     symE.OutlineColor = (uint)MapObjects2.ColorConstants.moRed;
     symE.Outline      = true;
     symE.SymbolType   = MapObjects2.SymbolTypeConstants.moFillSymbol;
     symE.Style        = (short)MapObjects2.FillStyleConstants.moTransparentFill;
     mapEye.DrawShape(mapMain.Extent, symE);
     MapObjects2.TextSymbol tsy = new MapObjects2.TextSymbolClass();
 }
예제 #4
0
파일: frmGisMain.cs 프로젝트: hkiaipc/guye
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void axMap2_AfterLayerDraw(object sender, AxMapObjects2._DMapEvents_AfterLayerDrawEvent e)
 {
     if(e.index!=0)
         return;
     symE=new MapObjects2.SymbolClass();
     symE.OutlineColor=(uint)MapObjects2.ColorConstants.moRed;
     symE.Outline=true;
     symE.SymbolType=MapObjects2.SymbolTypeConstants.moFillSymbol;
     symE.Style=(short)MapObjects2.FillStyleConstants.moTransparentFill;
     axMap2.DrawShape(axMap1.Extent,symE);
     MapObjects2.TextSymbol tsy=new MapObjects2.TextSymbolClass();
 }