Hi,
My requirement is to apply text styles (such as font,font size, pentype, xoffset ,yoffset and rotation etc..) to the features on the map. Please provide me some examples.
I have tried to apply text styles to features as follows but it is not working. I have attached the .cs file for referen
void
MainPage_Loaded(object sender, RoutedEventArgs e)MouseCoordinateType.LatitudeLongitude;true;GeographyUnit.Meter;true;new SolidColorBrush(Color.FromArgb(255, 255, 255, 255));ServerLayerOverlay overlay = new ServerLayerOverlay("CanaveralMap1Server", "SilverlightMapConnector1");"CanaveralMap1Server", overlay);ServerLayerOverlay overlay1 = new ServerLayerOverlay("CanaveralMap2Server", "SilverlightMapConnector1");"CanaveralMap2Server", overlay1);ServerLayerOverlay overlay2 = new ServerLayerOverlay("CanaveralMap3Server", "SilverlightMapConnector1");"CanaveralMap3Server", overlay2);new RectangleShape(533181.490451491, 3144268.68096696, 544626.363014241, 3138546.24468558);"CanaveralMap1Server");"CanaveralMap2Server");"CanaveralMap3Server");null;null;double x = 537530.542025336;double y = 3142780.8475;GeoFont font=new GeoFont("Arial",50,true);TextStyle txtStyle = new TextStyle("Name",new GeoFont("Arial",40),new GeoSolidBrush(new GeoColor(255,0,0)));false;///key
inMemoryFeatureLayer.Columns.Add(
inMemoryFeatureLayer.Columns.Add(
InMemoryFeatureLayer inMemoryFeatureLayer = new InMemoryFeatureLayer();new FeatureSourceColumn("State"));new FeatureSourceColumn("Name"));//inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.StandardColors.Blue, 50);
CreateValueStyle();
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(vs);
//add txt style to inmf
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(txtStyle);
inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =
ApplyUntilZoomLevel.Level20;PointShape Radarpoint = new PointShape(x, y);//inMemoryFeatureLayer.InternalFeatures.Add(pointFeature.Id, pointFeature);
f.ColumnValues[
Feature f = new Feature(new PointShape(x, y));"State"] = "fail";// set feature colomn value
f.ColumnValues[
"Name"] = "asfoojhiodfhidbfgdbgfdgfdgtf";// Add feature to in mem layer
inMemoryFeatureLayer.InternalFeatures.Add(f);
layerFeatureOverlay.Layers.Add(
Map1.Overlays.Add(
}
{
vs.ColumnName =
vs.ValueItems.Add(
vs.ValueItems.Add(
}
LayerOverlay layerFeatureOverlay = new LayerOverlay();"radar", inMemoryFeatureLayer);"AustinOverlay", layerFeatureOverlay);private void CreateValueStyle()"state";new ValueItem("ok",new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(new GeoColor(255,0,0)),20)));new ValueItem("fail", new PointStyle(PointSymbolType.Circle, new GeoSolidBrush(new GeoColor(0, 255, 0)), 20)));
{
Map1.MapTools.MouseCoordinate.MouseCoordinateType =
Map1.MapTools.PanZoomBar.IsEnabled =
Map1.MapUnit =
Map1.MapTools.MouseCoordinate.IsEnabled =
Map1.Background =
Map1.Overlays.Add(
Map1.Overlays.Add(
Map1.Overlays.Add(
Map1.CurrentExtent =
Map1.Refresh();
m_MapDetails.lstNotSelectedMaps.Add(
m_MapDetails.lstNotSelectedMaps.Add(
m_MapDetails.lstNotSelectedMaps.Add(
lstBoxAvailableMaps.ItemsSource =
lstBoxSelectedMaps.ItemsSource =
lstBoxAvailableMaps.ItemsSource = m_MapDetails.lstNotSelectedMaps;
lstBoxSelectedMaps.ItemsSource = m_MapDetails.lstSelectedMaps;
txtStyle.SuppressPartialLabels =
002_001_MainPage.xaml.cs (12.7 KB)
MainPage.xaml (208 KB)