zzkgis

The OnMapReplaced event is triggered whenever the IMapControl2::Map is replaced by another map, such as when the IMapControl2::LoadMxFile method is used or when the map property is explicitly replaced. Use this event to keep in synch with the current map. 
问:这个方法在什么情况下被触发呢?
答:当MapControl 的地图被另一个地图替换时被触发。
问:为什么加载shp等数据时该方法不会被触发?
答:因为MapControl被初始化的时候就默认创建了一个地图文档,新加载的shp数据只是加载到了这个原始的地图文档中,并没有被替换,故该方法不会被触发。
问:那要怎么样才可以触发该事件?
答:加载地图文档,.mxd格式的数据就会触发该事件。
问:那我不想加载地图文档,只想加载shp数据该怎么实现鹰眼效果?
答:用OnAfterScreenDraw()方法。
OnAfterScreenDraw is triggered after the IDisplayEvents::DisplayFinished event is called on the map\'s screen display. The hdc represents the device context on the screen display.

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-23
  • 2021-06-09
  • 2021-08-31
  • 2021-06-23
  • 2022-12-23
猜你喜欢
  • 2021-11-17
  • 2021-06-16
  • 2022-02-03
  • 2021-06-02
  • 2021-05-21
  • 2022-12-23
相关资源
相似解决方案