通过坐标在graphicContainer绘制点总是重复
我有好多坐标点,想通过graphicContainer绘制点显示在mapcontrol上,但所有的点都在一个位置,是怎么回事?
调试的时候经纬度坐标是在变得,但屏幕坐标一直是锁定的。
下面是我的代码:
double x = double.Parse(row.Substring(index_1+1, index_2-index_1-1));
double y = double.Parse(row.Substring(index_2+1, index_3-index_2-1));
IPoint pPoint = new PointClass();
pPoint.PutCoords(x, y);
IMarkerElement pMarkerElement = new MarkerElementClass();
ISimpleMarkerSymbol pSimpleMarkerSymbol = new SimpleMarkerSymbol();
pSimpleMarkerSymbol.Color = GetRGBColor(11, 200, 145);
pSimpleMarkerSymbol.Size = 8;
pSimpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSDiamond;
IElement pElement = (IElement)pMarkerElement;
pElement.Geometry = pPoint;
pMarkerElement.Symbol = pSimpleMarkerSymbol;
pGraphicsContainer.AddElement((IElement)pMarkerElement, 0);
pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);