《WebGIS系统的设计与实现》的补充说明
昨天贴的《WebGIS系统的设计与实现》没有实现最后的Map渲染,原因是COM交互的问题。看了edison1024的留言和MapX的实现,发现是我的设计存在问题,我试图使用MapService去创建一个MapEngine,然后再在MapEngine里实现窗体的创建和地图的渲染。这样如果是.net类或者COM的不可视的DLL,则应该没有问题。但对于ActiveX,就存在问题。
按照edison1024的MapX的实现,使用创建Remoting服务的Host创建了另一个窗体对象,然后在MapEngine里去调用他的MapEngine对象(指向具体的窗体),就可以了:
Public Shared MapEngine As frmSuperMapForm
![](/Images/OutliningIndicators/None.gif)
<STAThread()> Shared Sub Main()
![](/Images/OutliningIndicators/InBlock.gif)
Dim chan1 As TcpChannel
chan1 = New TcpChannel(8085)
![](/Images/OutliningIndicators/InBlock.gif)
ChannelServices.RegisterChannel(chan1)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(MapService), "MapService", WellKnownObjectMode.Singleton)
![](/Images/OutliningIndicators/InBlock.gif)
MapEngine = New frmSuperMapForm
Application.Run(MapEngine)
![](/Images/OutliningIndicators/InBlock.gif)
End Sub
运行结果如下:
![](/images/cnblogs_com/maweifeng/20050809001.jpg)
按照edison1024的MapX的实现,使用创建Remoting服务的Host创建了另一个窗体对象,然后在MapEngine里去调用他的MapEngine对象(指向具体的窗体),就可以了:
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/None.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/InBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockEnd.gif)
运行结果如下:
![](/images/cnblogs_com/maweifeng/20050809001.jpg)