Symbol Rendering Chapter--symbol

Source: Internet
Author: User
Tags polyline

Symbol is an interface for symbolic style settings on Graphic objects, and all symbol style classes implement the symbol interface.

1.PictureMarkerSymbol
Picturemarkersymbol is a class that styles settings for Graphic objects of points or multipoint features, Picturemarkersymbol
Pictures, such as the URL or drawable to set the picture symbol, for Picturemarkersymbol can also set the picture symbol rotation angle and
Position offset, as follows:

Create picture styles to match
Picturemarkersymbol pic = new Picturemarkersymbol (Getresources (). getdrawable (R.drawable.icon));
Points pt = new Point (113,32);//Create a Dot Object
Graphic GP = new Graphic (pt,pic); set style
Graphicslayer.addgraphic (GP); Add to Layer

2.SimpleMarkerSymbol

Simplemarkersymbol is also a class for styling the Graphic objects of point features, Simplemarkersymbol and
The Picturemarkersymbol class is similar, except that one renders as a vector point and the other replaces that point with a picture. Using Simplemarkersymbol
You can set the style of a point, such as the size, color, and type of a point, using the following:

Point points = new dot ();//Create a Spot object
POINT.SETX (114);//set X coordinate
Point.sety (32);//Set y-coordinate
Set the color, size, and point type of a point style
Simplemarkersymbol SMS = new Simplemarkersymbol (Color.red,25,style. CIRCLE)
Graphic GP = new Graphic (point,sms);
Graphicslayer.addgraphic (GP);//Add to layer display

3. Simplelinesymbol

Simplelinesymbol is a class for styling the Graphic object of a linear feature, through which you can set the style of a linear feature, package
including Linetype, line color, line width, and line transparency, etc., as follows:

Polyline Poly = new Polyline ();//Create Poly Object
Poly.startpath (new Point (0,0));//Add initial points
Poly.lineto (new Point (10,0));
Poly.lineto (new Point (10,10));
Simplelinesymbol SLS = new Simplelinesymbol (color.red,25, simplelinesymbol.solid);//Line Style object,
Includes parameters such as color, line width, and linetype
Sfs.setalpha (50);//Set Transparency
Graphic GP = new Graphic (poly, SLS);

Graphicslayer.addgraphic (GP);//Add to Layer

4.SimpleFillSymbol

Simplefillsymbol is a class that styles the Graphic object of a polygon feature by setting the fill color of the polygon features and
Brightness, you can also add a border to the polygon features style settings, Simplefillsymbol usage is very simple, as follows:

Polygon Poly = new Polygon ();//Create Poly Object
Poly.startpath (new Point (0,0));//Add initial points
Poly.lineto (new Point (10,0));
Poly.lineto (new Point (10,10));
Poly.lineto (new Point (0,0));//The polygon is closed, so the last place to add the initial points
Simplefillsymbol SFS = new Simplefillsymbol (color.red);//Polygon Style object
Sfs.setalpha (50);//Set Transparency
Graphic GP = new Graphic (POLY,SFS);
Graphicslayer.addgraphic (GP);//Add to Layer

5.TextSymbol

Textsymbol is also a class for styling the Graphic object of a point feature, which replaces the position of the point with text for plotting the display.
With Textsymbol, you can set the size, color, content, and arrangement of text. There are two ways of plotting text: horizontal and vertical
column, which is displayed by default in landscape orientation. Use the following:

Point points = new dot ();//Create a Spot object
POINT.SETX (114);//set X coordinate
Point.sety (32);//Set y-coordinate
Set the color, size, and text content of a point style
Textsymbol ts = new Textsymbol (12, "point style", color.red);
Graphic GP = new Graphic (point,ts);
Graphicslayer.addgraphic (GP);//Add to layer display

The--symbol of symbolic rendering is summarized here, if there is perfect to follow.

Symbol Rendering Chapter--symbol

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.