ThinkGeo.com    |     Documentation    |     Premium Support

About GeoDataTabel data on map

I’m using the GeoDataTable data to add one of these text type data to the existing map, displaying it like a label. I didn’t find an effective method. What should I do?

Hi Zhangming,

If you want to display the text like a label, there are two solutions, it’s not depend on your data source. Because we even don’t know which version you are using, so we can just provide some suggestion as below:

  1. Show that like a marker: https://github.com/ThinkGeo?utf8=✓&q=marker&type=&language=

  2. Add the data into an InmemoryFeatureLayer, add the text into feature’s column value, and then set the textstyle for the layer, so it will shows on map. You can also view our howdoisamples project: https://github.com/ThinkGeo?utf8=✓&q=howdoi&type=&language=

Wish that’s helpful.

Regards,

Ethan

Hi Ethan
thank you for your answer. I’ve done it the first way,But I’m not sure if there’s a lot of data that has an impact on performance.Will the second method be better? The second method does not find the code.

Regards,
Zhangming

Hi Zhangming,

You can provide us a simple sample with your scenario the next time, so we can help you solve your problem based on that, and please put your post in our sub-forum, so we can easily know which product you are using.

As below is the simple sample code about that:

        map.MapUnit = GeographyUnit.DecimalDegree;

        InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
        layer.Columns.Add(new FeatureSourceColumn("label"));

        layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1;
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        Feature feature1 = new Feature(50, 60);
        feature1.ColumnValues.Add("label", "It's a really simple sample to show how to render label on map");

        layer.InternalFeatures.Add(feature1);
        LayerOverlay overlay = new LayerOverlay();
        overlay.Layers.Add(layer);

        map.Overlays.Add(overlay);

You can find more detail code in our samples.

Wish that’s helpful.

Regards,

Ethan

Hi Ethan
Thanks a lot. i’m got it.
Regards,

Hi Zhangming,

I am glad to hear that’s helpful.

Regards,

Ethan