CString ctring;
Ctring. Format (_ T ("distance: %. 2fm"), ant. gpqss. top ());
CClientDC dc (this );
CSize sz = dc. GetTextExtent (ctring );
(CMainFrame *) AfxGetMainWnd ()-> m_wndStatusBar.SetPaneInfo (1, NULL, SBPS_NORMAL, sz. cx );
(CMainFrame *) AfxGetMainWnd ()-> m_wndStatusBar.SetPaneText (1, ctring );
If (HaveLine = true ){
Layer. DeleteFeature (feat );
Layer. Refresh ();
HaveLine = false;
}
If (HaveLine = false ){
CMapXPoints Pnts;
Pnts. CreateDispatch (Pnts. GetClsid ());
FeaFac = m_ctrlMapX.GetFeatureFactory ();
For (int I = 0; I second-> X, iter-> second-> Y );
}
/// // Display the trajectory ////////////// //////////////////////////////
COleVariant vtPoints;
VtPoints. vt = VT_DISPATCH;
VtPoints. pdispVal = Pnts. m_lpDispatch;
VtPoints. pdispVal-> AddRef ();
Feature = FeaFac. CreateLine (vtPoints );
Style = Feature. GetStyle ();
Style. SetLineColor (miColorRed );
Style. SetLineWidth (4 );
Style. SetLineStyle (65 );
Feature. SetStyle (Style. m_lpDispatch );
Feat = Layer. AddFeature (Feature );
Feat. Update ();
Pnts. RemoveAll ();
HaveLine = true;
}
/// // Display the required City ///////////// ///////////////////////////////
Float screenX, screenY;
Double mapX, mapY;
CMapXPoint point;
Point. CreateDispatch (point. GetClsid ());
For (int I = 0; I second-> X, iter-> second-> Y );
CMapXStyle style;
Style. CreateDispatch (style. GetClsid ());
Style. SetSymbolType (miSymbolTypeBitmap );
Style. SetSymbolBitmapSize (7 );
Style. SetSymbolBitmapColor (RGB (255,125,210 ));
Style. SetSymbolBitmapName (_ T ("camera.bmp "));
M_ctrlMapX.SetAutoRedraw (FALSE );
Layer. SetEditable (TRUE );
VARIANT varPoint, varStyle;
VarPoint. vt = VT_DISPATCH;
VarPoint. pdispVal = point;
VarStyle. vt = VT_DISPATCH;
VarStyle. pdispVal = style;
CMapXFeatureFactory factory = m_ctrlMapX.GetFeatureFactory ();
CMapXFeature feature = factory. CreateSymbol (varPoint, varStyle );
Layer. AddFeature (feature );
Layer. Refresh ();
M_ctrlMapX.SetAutoRedraw (TRUE );
Layer. SetEditable (FALSE );
}
}