ThinkGeo.com    |     Documentation    |     Premium Support

How can we display feature.Tag on map

hello,
We want to display this feature.Tag on the map. how can it be done please provide us with sample line of code.if we are adding feature.Tag vales just before adding it to layer.
Thanks and Regards,
Hrishikesh Konde.

Hi Hrishikesh,

The sample code maybe helpful, and you can view our HowDoISample to get more sample here: https://github.com/ThinkGeo/HowDoISample-ForWpf/blob/master/HowDoI/Getting%20Started/AddPopups.xaml.cs

        map.MapUnit = GeographyUnit.DecimalDegree;

        LayerOverlay overlay = new LayerOverlay();
        InMemoryFeatureLayer layer = new InMemoryFeatureLayer();
        layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1;
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        overlay.Layers.Add(layer);
        map.Overlays.Add(overlay);
                    

        Feature f = new Feature(0, 0);
        f.Tag = "abc";

        PopupOverlay popupOverlay = new PopupOverlay();
        map.Overlays.Add(popupOverlay);
        Popup popup = new Popup(f.GetShape().GetCenterPoint());
        popup.Content = f.Tag;
        popupOverlay.Popups.Add(popup);

        layer.InternalFeatures.Add(f);
        map.CurrentExtent = new RectangleShape(-10, 10, 10, -10);
        map.Refresh();

Regards,

Ethan