ThinkGeo.com    |     Documentation    |     Premium Support

How to: Show ESRI(.mxd format) in winforms

Hi ,

Possible to show ESRI (.MXD) format in thinkgeo ?

Please do the needful.

Regards,
Tamilarasan.

Hi,

It’s not supported now, please refer this guide: http://wiki.thinkgeo.com/wiki/map_suite_data_format_guide

And you can submit that here, our development team will view this list when we try to add new feature: http://helpdesk.thinkgeo.com/EnhancementTracker

Regards,

Ethan

Hi Ethan,

I need sample for to open GDB(ArgGIS) from winforms.

Regards,
Tamilarasan.

Hi Tamilarasan,

I think you means FileGeodatabase, you can view this sample: http://wiki.thinkgeo.com/wiki/Map_Suite_Wpf_Desktop_Edition_All_Samples#File_Geodatabase

And the code should looks like:

string gdbname = @"D:\abc.gdb"; 
string tableName = "tableA"; 
string id = "id"; 

FileGeoDatabaseFeatureLayer fgdb = new FileGeoDatabaseFeatureLayer(gdbname,tableName,id); 
fgdb.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.County2; 
fgdb.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
fgdb.Open(); 

Wish that’s helpful.

Regards,

Ethan

Hi Ethan,

I am using Winform.

Please update sample for Winform.

Regards,
Tamilarasan.

Hi Tamilarasan,

This sample is based our V9 service edition. The core code is really simple and just the same for all of our products, you can see the sample comment mentioned “Applies To: Desktop \ Web \ Silverlight \ Services \ Wpf”, so please just use it like this:

         fileGeoDatabaseFeatureLayer = new FileGeoDatabaseFeatureLayer(@"../../data/Shapes.gdb", "Cities", "OBJECTID");  
     fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;  
     fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;  
     fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1;  
     fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;  

If the code don’t works for you please let us know your problem.

Regards,

Ethan

Hi Ethan,

Its loading but map show blank screen.

Regards,
Tamilarasan.

Hi Tamil,

We created one simple for you. Please refer FileGeoDatabaseDemo.zip (13.3 KB)

If there is any issue, please let us know that.

Thanks
Mark

Hi Mark,

I am using your Shapes.gdb file it will show no issue.

We are using ArcGIS 10.6 and created GDB file it’s load without exception but show empty screen,

Please do the needful…

Regards,
Tamilarasan.

Hi Tamil,

Please upload a sample file to us, so our developer can look into it.

Regards,

Ethan

Hi Ethan,

I tried with our GDB file its load but refer below screen shot.

1.ThinkGeo Map

  1. ArcGIS Map

Our GDB files is more then 5 MB show not able to upload,

Please do the needful.

Regards,
Tamilarasan.

Hi Tamil,

Does the two screen shots render the same data?

If your data is bigger than 5MB, you can upload that to our FTP (You can get an FTP account from our sales), or you can put that in some netdisk for example GoogleDrive, and so we can directly download it.

The data is necessary so we can look into it because our test GDB data works well.

Regards,

Ethan

Hi Ethan,

Yes , we used same data.

also use below link to get our GDB file.

Regards,
Tamilarasan.

Hi Tamil,

Thanks for your data, it looks our map render the table of “SCHOOL” and the ArcGis render the table of “COUNTY”.

In fact we have the parameter “tableName” and if you want to render many layers you need to add many instance of it.

new FileGeoDatabaseFeatureLayer(gdbname,tableName,id)

Wish that’s helpful.

Regards,

Ethan

Hi Ethan,

I also tried to get all table name from GDB file.

and loop all the tables to added new FileGeoDatbaseFeatureLayer(gdbName,tablename,id)

But still showing previously mention above conversion.

I have doubt , offline map it will show same output screen with styles like ArcGIS map screen?

Or else any tool have to enable all the feature our map like you previously mention screen shot?

Regards,
Tamilarasan.

Hi Tamil,

As below is rendered by GlobalMapper for “School” table.

And as below is our map render the “County” table:

Here is the sample:

9282.zip (11.7 KB)

Regards,

Ethan

Hi Ethan,

I am using map unit for DecimalDegree but your example used Meter.

Please refer below screen shot.

We already done all the functionality with MapUnit.DecimalDegree.

Please do the needful.

Regards,
Tamilarasan.

Hi Tamil,

Your GDB file is under meter, if you want to use it under decimal degree, you just need to reproject it.

       private void Form1_Load(object sender, EventArgs e)
    {
        winformsMap1.MapUnit = GeographyUnit.DecimalDegree;

        LayerOverlay layerOverlay = new LayerOverlay();
        FileGeoDatabaseFeatureLayer fileGeoDatabaseFeatureLayer = new FileGeoDatabaseFeatureLayer(@"..\..\AppData\MapData.gdb", "COUNTY");

        Proj4Projection proj4 = new Proj4Projection();
        proj4.InternalProjectionParametersString = fileGeoDatabaseFeatureLayer.GetInternalProj4ProjectionParametersString();
        proj4.ExternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
        proj4.Open();

        fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
        fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;
        fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1;
        fileGeoDatabaseFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        fileGeoDatabaseFeatureLayer.FeatureSource.Projection = proj4;

        layerOverlay.Layers.Add(fileGeoDatabaseFeatureLayer);
        winformsMap1.Overlays.Add(layerOverlay);

        fileGeoDatabaseFeatureLayer.Open();
        winformsMap1.CurrentExtent = fileGeoDatabaseFeatureLayer.GetBoundingBox();
        winformsMap1.Refresh();
    }

Wish that’s helpful.

Regards,

Ethan

Hi Ethan,

May i know , How to find map unit for GDB?

Regards,
Tamilarasan

Hi Tamil,

You can use this code:

    fileGeoDatabaseFeatureLayer.Open();
    winformsMap1.CurrentExtent = fileGeoDatabaseFeatureLayer.GetBoundingBox();

If the point of CurrentExtent is in the range between -180 and 180, it may be DecimalDegree, if it’s a big value it must be meter.

Regards,

Ethan