如何实现在地图上添加点、线、区域的操作啊,我看的资料上都是说调用MapX中现有的m_ctrlMapX.SetCurrentTool(miPanTool);只要将内部参数改为
添加线条 miAddLineTool 将线条图元添加到插入图层中。
添加点 miAddPointTool 单击该工具可将点图元添加到插入图层中。
添加折线 miAddPolyLineTool 将折线图元添加到插入图层中。
添加区域 miAddRegionTool 将区域图元添加到插入图层中。
即可,但是运行之后一点按钮就会提示The insertion layer is not set. The insertion layer must be set before the object creation tools can be used.
这问题该如何解决请各位大侠能够帮帮忙。
添加线条 miAddLineTool 将线条图元添加到插入图层中。
添加点 miAddPointTool 单击该工具可将点图元添加到插入图层中。
添加折线 miAddPolyLineTool 将折线图元添加到插入图层中。
添加区域 miAddRegionTool 将区域图元添加到插入图层中。
即可,但是运行之后一点按钮就会提示The insertion layer is not set. The insertion layer must be set before the object creation tools can be used.
这问题该如何解决请各位大侠能够帮帮忙。
-------------------------------------
添加之前,要设一个层的
tempLayer.SetEditable(true);
m_ctrlMapX.GetLayers().SetInsertionLayer(tempLayer);m_ctrlMapX.SetCurrentTool(miAddLineTool);这样应该就行了。