Skip to content

Commit 412037a

Browse files
committed
Merge branch 'master' into dev
2 parents 7560e54 + 0a384dc commit 412037a

File tree

58 files changed

+966
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+966
-711
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
1-
# Add Graphics with Renderer
1+
# Add graphics with renderer
22

3-
Specify a graphic's symbol with a renderer.
3+
A renderer allows you to change the style of all graphics in a graphics overlay by referencing a single symbol style. A renderer will only effect graphics that do not specify their own symbol style.
44

5-
A renderer allows you to change the style of all graphics in an overlay by only changing one copy of the symbol. A renderer will only effect graphics that do not specify their own symbol.
5+
![Image of adding graphics with renderer](AddGraphicsWithRenderer.png)
66

7-
![](AddGraphicsWithRenderer.png)
7+
## Use case
88

9-
## How it works
9+
A renderer allows you to change the style of all graphics in an overlay by only changing one copy of the symbol. For example, a user may wish to display a number of graphics on a map of parkland which represent trees, all sharing a common symbol.
10+
11+
## How to use the sample
1012

11-
To show a `Graphic` in a `GraphicsOverlay` using a renderer:
13+
Run the sample and view graphics for points, lines, and polygons, which are stylized using renderers.
14+
15+
## How it works
1216

13-
1. Create a `GraphicsOverlay` and add it to the `MapView`
14-
2. Create a `Graphic`, specifying only its geometry
15-
3. Create a single `Symbol` such as a `SimpleMarkerSymbol`
16-
4. Create a renderer with the symbol such as `new SimpleRenderer(symbol)`
17-
5. Set the renderer on the graphics overlay with `graphicsOverlay.setRenderer(renderer)`
17+
1. Create a `GraphicsOverlay` and add it to the `MapView`.
18+
2. Create a `Graphic`, specifying only a `Geometry`.
19+
3. Create a single `Symbol` such as a `SimpleMarkerSymbol`.
20+
4. Create a renderer with the symbol, such as `new SimpleRenderer(symbol)`.
21+
5. Set the renderer on the graphics overlay with `graphicsOverlay.setRenderer(renderer)`.
1822

1923
## Relevant API
2024

21-
* ArcGISMap
25+
* Geometry
2226
* Graphic
2327
* GraphicsOverlay
24-
* MapView
25-
* Point
2628
* SimpleFillSymbol
2729
* SimpleLineSymbol
2830
* SimpleMarkerSymbol
2931
* SimpleRenderer
32+
33+
## Additional information
34+
35+
To set unique symbols across a number of graphics (e.g. showing graphics of individual landmarks) see "Add graphics with symbols" sample.
36+
37+
## Tags
38+
39+
display, graphics, marker, overlay, renderer, symbol
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,38 @@
1-
# Add Graphics with Symbols
1+
# Add graphics with symbols
22

3-
Draw simple graphics with marker, line, polygon, and text symbols.
3+
Use a symbol style to display a graphic on a graphics overlay.
44

5-
![](AddGraphicsWithSymbols.png)
5+
![Image of adding graphics with symbols](AddGraphicsWithSymbols.png)
6+
7+
## Use case
8+
9+
Allows you to customize a graphic by assigning a unique symbol. For example, you may wish to display individual graphics for different landmarks across a region, and to style each one with a unique symbol.
10+
11+
## How to use the sample
12+
13+
Pan and zoom around the map. Observe the graphics on the map.
614

715
## How it works
816

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.
17+
1. Create a `GraphicsOverlay` and add it to the `MapView`.
18+
2. Create a `Symbol` such as `SimpleMarkerSymbol`, `SimpleLineSymbol`, `SimpleFillSymbol` or `TextSymbol`.
19+
3. Create a `Graphic`, specifying a `Geometry` and a symbol.
20+
4. Add the graphic to the graphics overlay.
3221

3322
## Relevant API
3423

24+
* Geometry
3525
* Graphic
3626
* GraphicsOverlay
37-
* MapView
38-
* Point
39-
* PointCollection
40-
* Polygon
41-
* Polyline
42-
* SimepleFillSymbol
27+
* SimpleFillSymbol
4328
* SimpleLineSymbol
4429
* SimpleMarkerSymbol
4530
* TextSymbol
31+
32+
## Additional information
33+
34+
To set a symbol style across a number of graphics (e.g. showing trees as graphics sharing a symbol in a park), see the "Add graphics with renderer" sample.
35+
36+
## Tags
37+
38+
display, fill, graphics, line, marker, overlay, point, symbol
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
11
# Control annotation sublayer visibility
22

3-
Change the visibility of annotation sublayers.
3+
Use annotation sublayers to gain finer control of annotation layer subtypes.
44

5-
![Control annotation sublayer visibility sample](ControlAnnotationSublayerVisibility.png)
5+
![Image of control annotation sublayer visibility](ControlAnnotationSublayerVisibility.png)
66

77
## Use case
88

9-
An annotation layer for water utilities may contain sublayers for water mains, pipes, and valves. One might turn off the visibility of water main and pipe sublayers to make the valves easier to identify.
9+
Annotation, which differs from labels by having a fixed place and size, is typically only relevant at particular scales. Annotation sublayers allow for finer control of annotation by allowing properties (like visibility in the map and legend) to be set and others to be read (like name) on subtypes of an annotation layer.
10+
11+
An annotation dataset which marks valves as "Opened" or "Closed", might be set to display the "Closed" valves over a broader range of scales than the "Opened" valves, if the "Closed" data is considered more relevant by the map's author. Regardless, the user can be given a manual option to set visibility of annotation sublayers on and off, if required.
1012

1113
## How to use the sample
1214

13-
Zoom in to change the map's scale. The annotation sublayers were authored so that the "Open" sublayer will be visible for scales 1:500-1:2000 and the "Closed" sublayer is always visible. Use the checkboxes to toggle a sublayer's visibility.
15+
Start the sample and take note of the visibility of the annotation. Zoom in and out to see the annotation turn on and off based on scale ranges set on the data.
16+
17+
Use the checkboxes to manually set "Open" and "Closed" annotation sublayers visibility to on or off.
1418

1519
## How it works
1620

17-
1. Load a `MobileMapPackage` containing annotation layers.
18-
2. Get the `AnnotationSublayer` from the `Annotation Layer` of the mobile map package.
19-
3. Set the annotation sublayer's visibility as required.
21+
1. Load a `MobileMapPackage` that contains `AnnotationSublayer`.
22+
2. Get the sublayers from the map package's layers by calling `Layer.getSubLayerContents.get(i)`.
23+
3. You can toggle the visibility of each sublayer manually using `.setVisible()`.
24+
4. To determine if a sublayer is visible at the current scale of the `MapView`, use `sublayer.isVisibleAtScale()`, by passing in the map's current scale.
2025

2126
## Relevant API
2227

2328
* AnnotationLayer
2429
* AnnotationSublayer
2530
* LayerContent
2631

27-
## Additional Information
32+
## About the data
2833

29-
Annotation, which differs from labels by having a fixed place and size, is typically only relevant at particular scales. Annotation sublayers allow for finer control of annotation by allowing properties (e.g. visibility in the map and legend) to be set and others to be read (e.g. name) on subtypes of an annotation layer.
34+
The scale ranges were set by the map's author using ArcGIS Pro:
35+
* The "Open" annotation sublayer has its maximum scale set to 1:500 and its minimum scale set to 1:2000.
36+
* The "Closed" annotation sublayer has no minimum or maximum scales set, so will be drawn at all scales.
3037

3138
## Tags
3239

33-
scale, text, utilities
40+
annotation, scale, text, utilities, visualization
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# Dictionary renderer with graphics overlay
22

3-
Display mil2525d symbols.
3+
Create graphics using a local mil2525d style file and an XML file with key/value pairs for each graphic.
44

5-
![Dictionary Renderer Graphics Overlay Sample](DictionaryRendererGraphicsOverlay.png)
5+
![Image of dictionary renderer graphics overlay](DictionaryRendererGraphicsOverlay.png)
66

77
## Use case
88

99
Use a dictionary renderer on a graphics overlay to display more transient data, such as military messages coming through a local tactical network.
1010

1111
## How to use the sample
1212

13-
Pan and zoom to see military symbols within the map.
13+
Run the sample and view the military symbols on the map.
1414

1515
## How it works
1616

17-
1. Create a new `DictionarySymbolStyle` from a stylx file.
18-
2. Create a new `DictionaryRenderer` from the dictionary symbol style.
19-
3. Create a new `GraphicsOverlay` and set the dictionary renderer to the graphics overlay.
20-
4. Parse through the local XML file creating a map of key/value pairs for each block of attributes.
21-
5. Create a `Graphic` for each attribute:
22-
1. Use the `_wkid` key to get the geometry's spatial reference.
23-
2. Use the `_control_points` key to get the geometry's shape.
24-
6. Add the graphic to the graphics overlay.
17+
1. Create a new `SymbolDictionary(specificationType, dictionaryPath)`.
18+
2. Create a new `DictionaryRenderer(symbolDictionary)`.
19+
3. Create a new `GraphicsOverlay`
20+
4. Set the dictionary renderer to the graphics overlay.
21+
5. Parse through the local XML file creating a map of key/value pairs for each block of attributes.
22+
6. Create a `Graphic` for each attribute.
23+
7. Use the `_wkid` key to get the geometry's spatial reference.
24+
8. Use the `_control_points` key to get the geometry's shape.
25+
9. Add the graphic to the graphics overlay.
2526

2627
## Relevant API
2728

@@ -31,4 +32,4 @@ Pan and zoom to see military symbols within the map.
3132

3233
## Tags
3334

34-
dictionary renderer, dictionary symbol style, military, symbol
35+
visualization
+16-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
1-
# Display Grid
1+
# Display grid
22

3-
Display a variety of grids on a map.
3+
Display coordinate system grids including Latitude/Longitude, MGRS, UTM and USNG on a map view. Also, toggle label visibility and change the color of grid lines and grid labels.
44

5-
![](DisplayGrid.png)
5+
![Image of display grid](DisplayGrid.png)
6+
7+
## Use case
8+
9+
Grids are often used on printed maps, but can also be helpful on digital maps, to identify locations on a map.
610

711
## How to use the sample
812

9-
Select the different grid style options and click "Update" to set the grid.
13+
Use the controls to select the type of grid from `Grid Type` (LatLong, MGRS, UTM and USNG), and to modify its properties like label visibility, grid line color, and grid label color. Click the 'Update' button to see the result.
1014

11-
## How it works
1215

13-
To show and style a grid:
16+
## How it works
1417

1518
1. Create an instance of one of the `Grid` types.
16-
2. Grid lines and labels can be styled per grid level with `grid.setLineSymbol(gridLevel, lineSymbol)` and `grid.setTextSymbol(gridLevel, textSymbol)`.
17-
3. The label position can be set with `grid.setLabelPosition(labelPosition)`.
19+
2. Grid lines and labels can be styled per grid level with `setLineSymbol(gridLevel, lineSymbol)` and `setTextSymbol(gridLevel, textSymbol)` methods on the grid.
20+
3. The label position can be set with `setLabelPosition(labelPosition)` method on the grid.
1821
4. For the `LatitudeLongitudeGrid` type, you can specify a label format of `DECIMAL_DEGREES` or `DEGREES_MINUTES_SECONDS`.
19-
5. To set the grid, use `mapView.setGrid(grid)`.
22+
5. To set the grid, use the `setGrid(grid)` method on the map view.
2023

2124
## Relevant API
2225

@@ -29,3 +32,7 @@ To show and style a grid:
2932
* TextSymbol
3033
* UsngGrid
3134
* UtmGrid
35+
36+
## Tags
37+
38+
coordinates, degrees, graticule, grid, latitude, longitude, MGRS, minutes, seconds, USNG, UTM
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
1-
# Format Coordinates
1+
# Format coordinates
22

3-
Write coordinates in a variety of common formats.
3+
Format coordinates in a variety of common notations.
44

5-
Convert a map location Point in WGS84 to a String in a number of different coordinate notations (and vice versa) including decimal degrees; degrees, minutes, seconds; Universal Transverse Mercator (UTM), and United States National Grid (USNG).
5+
![Image of format coordinates](FormatCoordinates.png)
66

7-
![](FormatCoordinates.png)
7+
## Use case
8+
9+
The coordinate formatter can format a map location in WGS84 in a number of common coordinate notations. Parsing one of these formats to a location is also supported. Formats include decimal degrees; degrees, minutes, seconds; Universal Transverse Mercator (UTM), and United States National Grid (USNG).
810

911
## How to use the sample
1012

11-
Click on the map to see a callout with the clicked location's coordinate formatted in 4 different ways. You can also put a coordinate string in any of these formats in the text field. Hit Enter and the coordinate string will be converted to a map location which the callout will move to.
13+
Click on the map to see a callout with the clicked location's coordinate formatted in 4 different ways. You can also put a coordinate string in any of these formats in the text field. Hit 'Enter' and the coordinate string will be parsed to a map location which the callout will move to.
1214

1315
## How it works
1416

15-
To convert between a `Point` and different coordinate formats using the
16-
`CoordinateFormatter`:
17-
1817
1. Get or create a map `Point` with a spatial reference.
19-
2. Use one of the static "to" methods on `CoordinateFormatter` such as
20-
`CoordinateFormatter.toLatitudeLongitude(point, CoordinateFormatter.LatitudeLongitudeFormat.DECIMAL_DEGREES,4)` to get the formatted string`.
18+
2. Use one of the static "to" methods on `CoordinateFormatter` such as `CoordinateFormatter.toLatitudeLongitude(point, CoordinateFormatter.LatitudeLongitudeFormat.DECIMAL_DEGREES, 4)` to get the formatted string.
2119
3. To go from a formatted string to a `Point`, use one of the "from" static methods like `CoordinateFormatter.fromUtm(coordinateString, map.getSpatialReference(), CoordinateFormatter.UtmConversionMode.LATITUDE_BAND_INDICATORS)`.
2220

2321
## Relevant API
2422

25-
* ArcGISMap
26-
* ArcGISTiledLayer
27-
* Basemap
28-
* Callout
2923
* CoordinateFormatter
30-
* MapView
24+
25+
## Tags
26+
27+
convert, coordinate, decimal degrees, degree minutes seconds, format, latitude, longitude, USNG, UTM
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
# Identify Graphics
1+
# Identify graphics
22

3-
Determine if a graphic was clicked.
3+
Identify a graphic to get further information about the object.
44

5-
## How to use the sample
5+
![Image of identify graphics](IdentifyGraphics.png)
66

7-
When you click on a graphic on the map, you should see an alert.
7+
## Use case
88

9-
![](IdentifyGraphics.png)
9+
A user may wish to select a graphic on a map to view relevant information about it.
1010

11-
## How it works
11+
## How to use the sample
1212

13-
To identify a `Graphic` from the `MapView`.
13+
Select a graphic to identify it. You will see an alert message displayed.
1414

15-
1. Create a `GraphicsOverlay` and add it to the MapView.
16-
2. Add Graphic along with a `SimpleFillSymbol`.
17-
3. Add the graphic to the graphics overlay.
18-
4. Identify the graphics on the specified location, `MapView.identifyGraphicsOverlayAsync(graphicsOverlay, point, tolerance, max results)` method.
15+
## How it works
16+
17+
1. Use the `.setOnMouseClicked()` method to listen to clicks on a `MapView`.
18+
2. When the map view is clicked, use the event to create a `Point` from the location clicked on the map.
19+
3. Identify the graphic on the map view with `MapView.identifyGraphicsOverlayAsync(graphicsOverlay, pointClicked, tolerance, max results)`.
1920

2021
## Relevant API
2122

2223
* Graphic
2324
* GraphicsOverlay
2425
* MapView
25-
* PointCollection
26-
* Polygon
27-
* SimpleFillSymbol
26+
* Point
27+
28+
## Tags
29+
30+
graphics, identify

0 commit comments

Comments
 (0)