Global Mapper SDK - C# Net example code needed

mapcodermapcoder Global Mapper UserPosts: 3
edited March 2012 in SDK
Hi, i am currently researching and learning basics from Global Mapper SDK, because i need to implement a feature in my application which is requested from my client.
Basically, the Global Mapper itself has everything my client needs :

1. Load terrain from satellite imaginery
2. Mark some points, like rectangle - 4 points, put markers on each of 3 points
3. Press 3D view button and see the area you selected in 3D, and which is most requested feature by my client - ROTATE it.

I have previous experience with GMap.NET, i can implement functions, load terrain based on latitude and longitude, zoom through it etc.
For me would be best if i can combine those two libraries, to load map and then show 3D view of the terrain, but example with Global Mapper SDK functions would be also appreciated.
So, how to do it in C# with Global Mapper SDK, just basic - load map, and then show 3D view of the area?

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    You can certainly do all of that with the Global Mapper SDK. Get the latest SDK build from http://www.globalmapper.com/GlobalMapperSDK_latest_beta.zip to check it out, there is an extensive C++ sample application that includes using the 3D viewer for loaded data, as well as a simpler C# sample application that shows how to use the SDK from C#. All functionality is available through C#, you might just need to add some function declarations if they aren't already in the sample. The C interface files are the ones where everything is defined.

    You would use GM_LoadLayerList to load your own files, or GM_LoadOnlineLayer to load online data, the GM_3DSetView to open the 3D view window on loaded data.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
  • mapcodermapcoder Global Mapper User Posts: 3
    edited March 2012
    Thanks Mike for your quick reply.
    I have tried the C# example, after some troubles to actually launch it from inside Visual Studio, but solved it by copying the necessary data from SDK's /bin folder (the needed dll files) into project folder.
    The application ( the C# one) is working and i succeeded to load the previously saved *.sid fille, Zoom In and Zoom Out events work perfectly, i don't have complains.
    However, i have tried to initialize GM_3DSetView in the example, but it wasn't recognized in the project space, no reference file or something like that.
    What else than already loaded wrapper GlobalMapperDLLWrapper.cs i should ad as reference to use GM_3DSetView function?
    I think there is lack of working, useful code examples of functions, members of GlobalMapperSDK, specially for NET.
    Let's imagine, i am loading online or offline layer, the example displays it, with zoom functions, then if i want to add another menu, like 3DView, on click event i need to initialize GM_3DSetView on loaded data, how to add correct reference, initialize GM_3DSetView and apply it on loaded layer? In C# please.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    The C# sample does not contain declarations for all of the functions in the SDK, so for the ones that are missing you have to add a declaration based on what is in the C header files. The C# sample only serves to demonstrate how to call from C#, to see how to actually use functionality I would definitely look at the C++ sample application as it is much more complete and of course the headers are 100% complete as they are the ones used to actually develop the application.

    That said, we are in the process of slowly adding declarations for more of the functions to the C# GlobalMapperDLLWrapper.cs, I think I will go ahead and add the 3D function wrappers.

    Thanks,

    Mike
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    I have updated the C# sample application to include declarations for all of the 3D functions as well as menu items that demonstrate using the 3D view and loading an online layer. I have attached the new C# sample.

    Thanks,

    MikeSDK_Sample_CSharp.zip
  • mapcodermapcoder Global Mapper User Posts: 3
    edited March 2012
    Thank you Mike for your assistance.
    I have downloaded updated example, took a look at the C++ one as well, managed to run both - without anything useful for me.
    First of all, the C# part when starting first shows an error that i can't trace from where it comes - it says something about invalid command "copy *.*/bin/" or something like that, but i managed to run the application.
    When it runs, Load online layer works, but Show 3D view doesn't, seems it blindly appears with "Error loading 3DView" message, i checked the code it's checking if GM.Error is true and that's it...?
    Then i checked the C++ example, managed to run it without errors, Load online, load offline layers work ( i am also very happy to see both examples can load many of file types and recognize necessary loadable data) but Show3D is asking me about file gm_dll registration key, while online sources that need registration or purchase do not allow me to actually run registration process.It stops with error.
    Can i purchase or register on some mapping provider and add their source manually from txt file and how to do that?
    I see the command button, i understand process but don't have example how is the source embedding into url.
    About the registration key, how can i obtain one in order to run example and perform 3d view of layers.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012
    You will need a license file (either temporary or purchased) to test out all of the functionality of the SDK, including the 3D view. If you email gmorders@bluemarblegeo.com they can provide that for you.

    The invalid "copy" command error is because the C# sample is trying to copy over the latest SDK DLLs assuming the C# sample is being built from a full Global Mapper SDK download so the 'bin' folder with the DLLs is a couple of directories up. If you are building somewhere else that copy won't do anything, but so long as you put the DLLs in the right place you are fine.

    Thanks,

    Mike
    Global Mapper Guru
    gmsupport@bluemarblegeo.com
    http://www.globalmapper.com
Sign In or Register to comment.