ArcGIS API for Silverlight registration jpgimage map text skew Solution

Source: Internet
Author: User
Tags silverlight

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

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.