|
1 |
| -<h1>Add Graphics with Symbols</h1> |
2 |
| - |
3 |
| -<p>Draw simple graphics with marker, line, polygon, and text symbols.</p> |
4 |
| - |
5 |
| -<p><img src="AddGraphicsWithSymbols.png"/></p> |
6 |
| - |
7 |
| -<h2>How it works</h2> |
8 |
| - |
9 |
| -<p>To display a <code>Graphic</code> using a symbol:</p> |
10 |
| - |
11 |
| -<ol> |
12 |
| - <li>Create a <code>GraphicsOverlay</code> and add it to the <code>MapView</code>, <code>MapView.getGraphicsOverlay.add()</code>.</li> |
13 |
| - <li>To create a graphic using a <code>SimpleMarkerSymbol</code>. |
14 |
| - <ul><li>create a <code>Point</code> where the graphic will be located</li> |
15 |
| - <li>create a simple marker symbol that will display at that point</li> |
16 |
| - <li>assign point and symbol to graphic, <code>Graphic(point, symbol)</code></li></ul></li> |
17 |
| - <li>To create a graphic using a <code>SimpleLineSymbol</code>. |
18 |
| - <ul><li>create a <code>PointCollection</code> that will hold all the points that make up the line</li> |
19 |
| - <li>create a <code>Polyline</code> using the point collection, <code>Polyline(PointCollection)</code></li> |
20 |
| - <li>create a simple line symbol that will display over those collected points</li> |
21 |
| - <li>assign polyline and symbol to graphic, <code>Graphic(polyline, symbol)</code></li></ul></li> |
22 |
| - <li>To create a graphic using a <code>SimepleFillSymbol</code>. |
23 |
| - <ul><li>create a point collection that will hold all the points that make up the line</li> |
24 |
| - <li>create a <code>Polygon</code> using the point collection, <code>Polygon(PointCollection)</code></li> |
25 |
| - <li>create a simple line symbol that will display as an outline for points collected</li> |
26 |
| - <li>create a simeple fill symbol, using line symbol from above, that will fill the region in between the points collected with a single color </li> |
27 |
| - <li>assign polygon and symbol to graphic, <code>Graphic(polygon, symbol)</code></li></ul></li> |
28 |
| - <li>To create a graphic using a <code>TextSymbol</code>. |
29 |
| - <ul><li>create a point where the graphic will be located</li> |
30 |
| - <li>create a text symbol, that will display at that point</li> |
31 |
| - <li>assign point and symbol to graphic, <code>Graphic(point, symbol)</code></li></ul></li> |
32 |
| - <li>Add graphic to graphics overlay to display it to the map view.</li> |
33 |
| -</ol> |
34 |
| - |
35 |
| -<h2>Relevant API</h2> |
36 |
| - |
37 |
| -<ul> |
38 |
| - <li>Graphic</li> |
39 |
| - <li>GraphicsOverlay</li> |
40 |
| - <li>MapView</li> |
41 |
| - <li>Point</li> |
42 |
| - <li>PointCollection</li> |
43 |
| - <li>Polygon</li> |
44 |
| - <li>Polyline</li> |
45 |
| - <li>SimepleFillSymbol</li> |
46 |
| - <li>SimpleLineSymbol</li> |
47 |
| - <li>SimpleMarkerSymbol</li> |
48 |
| - <li>TextSymbol</li> |
49 |
| -</ul> |
50 |
| - |
51 |
| - |
| 1 | +# Add Graphics with Symbols |
| 2 | + |
| 3 | +Draw simple graphics with marker, line, polygon, and text symbols. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## How it works |
| 8 | + |
| 9 | +To display a `Graphic` using a symbol: |
| 10 | + |
| 11 | +1. Create a `GraphicsOverlay` and add it to the `MapView`, `MapView.getGraphicsOverlay.add()`. |
| 12 | +2. To create a graphic using a `SimpleMarkerSymbol`. |
| 13 | + * create a `Point` where the graphic will be located |
| 14 | + * create a simple marker symbol that will display at that point |
| 15 | + * assign point and symbol to graphic, `Graphic(point, symbol)` |
| 16 | +3. To create a graphic using a `SimpleLineSymbol`. |
| 17 | + * create a `PointCollection` that will hold all the points that make up the line |
| 18 | + * create a `Polyline` using the point collection, `Polyline(PointCollection)` |
| 19 | + * create a simple line symbol that will display over those collected points |
| 20 | + * assign polyline and symbol to graphic, `Graphic(polyline, symbol)` |
| 21 | +4. To create a graphic using a `SimepleFillSymbol`. |
| 22 | + * create a point collection that will hold all the points that make up the line |
| 23 | + * create a `Polygon` using the point collection, `Polygon(PointCollection)` |
| 24 | + * create a simple line symbol that will display as an outline for points collected |
| 25 | + * create a simeple fill symbol, using line symbol from above, that will fill the region in between the points collected with a single color |
| 26 | + * assign polygon and symbol to graphic, `Graphic(polygon, symbol)` |
| 27 | +5. To create a graphic using a `TextSymbol`. |
| 28 | + * create a point where the graphic will be located |
| 29 | + * create a text symbol, that will display at that point |
| 30 | + * assign point and symbol to graphic, `Graphic(point, symbol)` |
| 31 | +6. Add graphic to graphics overlay to display it to the map view. |
| 32 | + |
| 33 | +## Relevant API |
| 34 | + |
| 35 | +* Graphic |
| 36 | +* GraphicsOverlay |
| 37 | +* MapView |
| 38 | +* Point |
| 39 | +* PointCollection |
| 40 | +* Polygon |
| 41 | +* Polyline |
| 42 | +* SimepleFillSymbol |
| 43 | +* SimpleLineSymbol |
| 44 | +* SimpleMarkerSymbol |
| 45 | +* TextSymbol |
0 commit comments