After registration based on the actual jpg image, when the published map is displayed on the webpage using ArcGIS API for Silverlight, the original text is always skewed. How can this problem be solved?
Figure 1. Maps with text skew after registration
The solution is as follows:
<esri:Map x:Name="myMap" IsLogoVisible="False" ZoomDuration="0:00:01" Extent="117.347734033208,30.5097885829245,117.611946391321,30.6766087944341" PanDuration="0:00:01" ExtentChanged="myMap_ExtentChanged"> <i:Interaction.Behaviors> <esri:MaintainExtentBehavior /> </i:Interaction.Behaviors> <esri:Map.Layers> <esri:ArcGISTiledMapServiceLayer ID="dLayer" Url="http://XXX.XXX.XX.XXX/ArcGIS/rest/services/XXX/MapServer/"/> </esri:Map.Layers> </esri:Map>
Mymap. Rotation =-8; // sets the Rotation Angle of the map.
The rotation attribute of the map control. You can set the Rotation Angle of the entire map.
But the question is, when textsymbol is used to add standard text information to the map, the text is skewed after being adjusted in the upward direction. What should I do?
Solution: Use the controltemplate of textsymbol to solve the problem.
<! -- Text Rotation Angle of textsymbol control template --> <ESRI: textsymbol X: Name = "rotatelabeltextsymbol"> <ESRI: textsymbol. controltemplate> <textblock text = "{binding symbol. text} "fontfamily =" {binding symbol. fontfamily} "fontsize =" {binding symbol. fontsize} "foreground =" {binding symbol. foreground} "> <textblock. rendertransform> <compositetransform rotation = "8"/> </textblock. rendertransform> </textblock> </controltemplate> </ESRI: textsymbol. controltemplate> </ESRI: textsymbol>
// Dynamically add text textsymbol = new textsymbol () {fontfamily = new system. windows. media. fontfamily ("Microsoft yahei"), foreground = new system. windows. media. solidcolorbrush (colorrevert. tocolor (tip_base.jtt_color), fontsize = 16, text = item. zdmc, offsetx = 15, offsety =-15, controltemplate = (layoutroot. resources ["rotatelabeltextsymbol"] As textsymbol ). controltemplate };
Figure 2. Map with no text skew after adjustment by program