Home > Mobile >  Qt call mapx drawing graphics, delete after drawing graphics, the graphics on the map disappeared, b
Qt call mapx drawing graphics, delete after drawing graphics, the graphics on the map disappeared, b

Time:09-16

This is the new layer:
Trail CMapXLayer *=the layers - & gt; CreateLayer (" Plane ");
Delete the trail;
This is the draw a straight line:
Trail CMapXLayer *=the layers - & gt; The Item (" Plane ");//the error
CMapXFeature * tmp1;
CMapXFeature * tmp2;
Drawline CMapXFeature *;
CMapXFeature * final;
Pt1 CMapXPoint * and * pt2;
CMapXStyle * style;
Trail - & gt; BeginAccess (miAccessReadWrite);
Tmp1=feaFactory - & gt; CreateSymbol ();
Tmp2=feaFactory - & gt; CreateSymbol ();
Pt1=tmp1 - & gt; Point ();
Pt2=tmp2 - & gt; Point ();
QPointF point1=GetLastPoint (icao);//get the latitude and longitude of a point on the
Pt1 - & gt; Set (point1. (x), point1. Y ());
Pt2 - & gt; Set (lon, lat);
////Savetrail=QPointF (lon, lat);
Drawline=feaFactory - & gt; CreateArc (pt1 - & gt; AsVariant (). ValuePt2 - & gt; AsVariant (). Value90,0,100);
Style=drawline - & gt; Style ();
Style - & gt; SetLineColor (QColor (0, 255));
Style - & gt; SetLineWidth (2);
Trail - & gt; SetEditable (true);
Final=trail - & gt; AddFeature (drawline - & gt; AsVariant (). ValueFinal - & gt; The Update ();
Trail - & gt; EndAccess ();
//qDebug () & lt; & lt;" DRAW_PLANE_TRAIL "& lt; Delete the trail; The delete tmp1; The delete tmp2;
The delete drawline; Delete final; The delete pt1;
The delete pt2. The delete style;
This part is to remove the layer:
The layers - & gt; Remove (" Plane ");
  •  Tags:  
  • Qt
  • Related