DotSpatial map not inside DotSpatial.Controls

本秂侑毒 提交于 2021-01-28 12:20:58

问题


I'm trying to install DotSpatial using c# WinForm, to take a look to the Map control. I've installed DotSpatial.Controls using nuget from VS. Instalation succesfull. Added inside my toolBar the DotSpatial.Control.dll wich is inside ../bin/debug folder, but, just 3 controls are added: AppManager, SpatialDockManager, SpatialHeaderControl.

Why Map control is not there?

Thanks in advance.


回答1:


The problem you are most likely having is that the Controls library has many dependencies that are necessary in order to use the Map control correctly. If you just download one dll, it won't be enough in order to get all the dependencies that you need. Here are the steps I took to be able to add a map control using version 1.9.0:

  1. Use GitHub GitHub Desktop to clone the DotSpatial\DotSpatial project.
  2. Open the Dotspatial\DotSpatial\Source\DotSpatial.sln in visual studio.
  3. Right click on Solution 'DotSpatial' in Solution Explorer -> Build Solution
  4. Close the solution and switch to your own project or solution.
  5. Right Click on References in the Solution Explorer -> Add Reference
  6. Browse to the Dotspatial\DotSpatial\Source\bin\Debug folder.
  7. Select the modules you want and then add them as references.
  8. Right click in the Toolbox window -> Add Tab, name it DotSpatial.
  9. Right click the DotSpatial Tab -> Choose Items ...
  10. Click the browse button
  11. Navigate to the Dotspatial\DotSpatial\Source\bin\Debug folder for instance.
  12. Select the DotSpatial.Controls.dll
  13. Sort the controls by Namespace (ensuring all the DotSpatial controls are selected)
  14. Click Ok to add them.
  15. Now you should be able to drag and drop the map onto your project.

As an added note, when trying to add the controls and drag and drop the map without setting up my project references first and I ended up with an IO Error saying that it could not find the file for DotSpatial.Projections.dll.

Anyway, I'm not 100% sure that this was the issue you were having, but hopefully it helps.




回答2:


Morning Guys, I have the same issue here. I've got whatever package starts with "DotSpatial" via NuGet. I've updated any DotSpatial package to their latest version (for some reason when I first installed the packages, I've got all 1.0 version...). I've done what Ted has described in steps 9 through 14, not only with the DotSpatial.Controls.dll, but with any DotSpatial Assemblies, one by one.

The Map control is not yet there.

Any hint would be very appreciated.

Thanks.




回答3:


Ted appears to be correct in that the issue is with the dependencies of the Map Control. The problem is when the packages are installed via NuGet, the various dlls are all installed in different directories, and the Map Control can't find them.

The solution is to copy all the dlls into a common directory, prior to adding the DotSpatial.Controls dll to the toolbox (steps 8-15 in Ted's answer).

Or you could use Ted's solution and download the source and compile the source.



来源:https://stackoverflow.com/questions/48565666/dotspatial-map-not-inside-dotspatial-controls

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!