Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

Load .TAB files from Server
Last Post 06-04-2012 12:18 PM by James. 8 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
AnggiUser is Offline
Level 1
Level 1
Posts:12
Avatar

--
05-09-2012 10:36 AM

Hi all, i am quite new to GIS application. i am currently trying to display MapInfo .TAB files from server and displaying the map on the client using silverlight. my requirements are:

1. displays specific .TAB file one at a time, and user can change which .TAB file is currently loaded

2. show a thematic map based on external data, (i need to join data in the .TAB file with data from oracle transactional table)

3. handling user click on feature (.TAB file on the server side)

Please, can anyone give me some examples how to do this?

Any help will be much appreciate!

 

JamesUser is Offline
MVP
MVP
Posts:1637
Avatar

--
05-10-2012 11:39 AM
Anggi,

Welcome to ThinkGeo Discussion Forum.

Our MapSuite provides TabFeatureLayer API, you can use it to implement your requirement easily, and you can find sample in our HowDoI sample, “Extending MapSuite””Load TabFeatureLayer”.

Let me know if you have more questions.

Thanks,
James
Think what? Think Geo!
AnggiUser is Offline
Level 1
Level 1
Posts:12
Avatar

--
05-10-2012 10:43 PM

 Hi James, thank you for your reply,

but i'm still wondering, how do we change which .TAB file is loaded in the .ASPX page from silverlight app on the client? and then i need to set the ZoomExtent to that specified .TAB file boundingbox, how can we do this?

and secondly, how do we show thematic map based on external data from database? i've seen some example like this:

 

ClassBreakStyle classBreakStyle = new ClassBreakStyle("POP_CNTRY");

                classBreakStyle.ClassBreaks.Add(new ClassBreak(double.MinValue, AreaStyles.Grass1));

                classBreakStyle.ClassBreaks.Add(new ClassBreak(1000000, AreaStyles.Evergreen2));

                classBreakStyle.ClassBreaks.Add(new ClassBreak(10000000, AreaStyles.Evergreen1));

                classBreakStyle.ClassBreaks.Add(new ClassBreak(50000000, AreaStyles.Crop1));

                classBreakStyle.ClassBreaks.Add(new ClassBreak(100000000, AreaStyles.Forest1));

that example using ClassBreakStyle is working well if there is column inside the .TAB file named "POP_CNTRY", but what if the column i want to display is not in the .TAB file, which is in the database, and i have to query the data from database, and then join the value with another column in the .TAB file (the KeyColumn in the .TAB file), how can we do this?

 

 

JamesUser is Offline
MVP
MVP
Posts:1637
Avatar

--
05-11-2012 11:46 AM
Anggi,

Our SilverlightEdition provide server side overlay, you can find sample from HowDoI sample, the code is similar with the way you write in .aspx.cs on web project.

If the column values are not from .tab file, you could create an InMemoryFeatureLayer, and add Feature into InternalFeatures property of it, the Feature contains two parts, one is shape which you can get from .tab file, and the other part is columnValues which you can get from database. And then you can apply ClassBreakStyle to InMemoryFeatureLayer.

Thanks,
James
Think what? Think Geo!
AnggiUser is Offline
Level 1
Level 1
Posts:12
Avatar

--
05-21-2012 11:25 AM

thank you James,
i'm able to load tab file from server, here is my code sample in the Default.aspx.cs, i called this method in the page_load,

        private void LoadTab()

        {

            ServerLayerOverlay layerOverlay = new ServerLayerOverlay("NativeServer");

            string tabFilename = Server.MapPath("~/Tabs/") + "map1.TAB";

            TabFeatureLayer serverLayer = new TabFeatureLayer(tabFilename);

            serverLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Capital3("name");

            serverLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(new GeoPen(new GeoColor(255, 0, 0)), new GeoSolidBrush(new GeoColor(0, 255, 0)));

            serverLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level10;

            try

            {

                if (serverLayer.RequireIndex)

                {

                    TabFeatureLayer.BuildIndexFile(tabFilename, BuildIndexMode.DoNotRebuild);

                }

                layerOverlay.Layers.Add(serverLayer);

            }

            catch (Exception exc)

            {

                Debug.Assert(true, exc.StackTrace);

            }

 

            SilverlightMapConnector1.ServerLayerOverlays.Add(layerOverlay);

        }

 

but like i said before, i'm still wondering, how do we change which .TAB file is loaded in the .ASPX page from silverlight app on the client? and then i need to set the ZoomExtent to that specified .TAB file boundingbox, how can we do this?

JamesUser is Offline
MVP
MVP
Posts:1637
Avatar

--
05-28-2012 08:41 AM
Anggi,

Could you create multi ServerLayerOverlay and each of them load a specific .tab file, and when you want to change it, you can switch the Id of server overlay, and meanwhile the server side provide a webclient to let client side request a extent string, and at client side, get extent string and apply to CurrentExtent of map.

Thanks,
James
Think what? Think Geo!
AnggiUser is Offline
Level 1
Level 1
Posts:12
Avatar

--
06-01-2012 01:02 AM

Hi James,

i think i can load multiple layers in the aspx page and then loads specified layer in the client side/silverlight,

but how do i get the extent string? the current extent from layer that currently loaded in the aspx page?

i need to get the layer.WrappingExtent.GetBoundingBox(); from the client side/silverlight.

 

thank you so much for your help James,

 

AnggiUser is Offline
Level 1
Level 1
Posts:12
Avatar

--
06-01-2012 05:52 AM
anyone knows why "Tab File Cannot be processed due to BFQ= Format is not supported" exception is raised when i try to build index for some TAB files?
how do we fix this exception?

thanks in advance..
JamesUser is Offline
MVP
MVP
Posts:1637
Avatar

--
06-04-2012 12:18 PM
Anggi,

As I mentioned, you can create a webclient service, and return bounding box of layer, use client code to request it and refresh the map. It's not related with MapSuite knowledge, it's just a simple scenario, you can find many sample by google it.

Thanks,
James
Think what? Think Geo!
You are not authorized to post a reply.

Active Forums 4.2