Skip to content

Commit b473d1a

Browse files
committed
Add initial files.
1 parent 4fa8039 commit b473d1a

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

Samples.xcodeproj/project.pbxproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@
478478
D7EF5D752A26A03A00FEBDE5 /* ShowCoordinatesInMultipleFormatsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7EF5D742A26A03A00FEBDE5 /* ShowCoordinatesInMultipleFormatsView.swift */; };
479479
D7EF5D762A26A1EE00FEBDE5 /* ShowCoordinatesInMultipleFormatsView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7EF5D742A26A03A00FEBDE5 /* ShowCoordinatesInMultipleFormatsView.swift */; };
480480
D7F2784C2A1D76F5002E4567 /* AddWMSLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7E557672A1D768800B9FB09 /* AddWMSLayerView.swift */; };
481+
D7F2A02F2CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7F2A0292CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift */; };
482+
D7F2A0302CD00F400008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7F2A0292CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift */; };
481483
D7F850042B7C427A00680D7C /* ValidateUtilityNetworkTopologyView.Views.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7C97B552B75C10C0097CDA1 /* ValidateUtilityNetworkTopologyView.Views.swift */; };
482484
D7F8C0392B60564D0072BFA7 /* AddFeaturesWithContingentValuesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7F8C0362B60564D0072BFA7 /* AddFeaturesWithContingentValuesView.swift */; };
483485
D7F8C03B2B6056790072BFA7 /* AddFeaturesWithContingentValuesView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7F8C0362B60564D0072BFA7 /* AddFeaturesWithContingentValuesView.swift */; };
@@ -572,6 +574,7 @@
572574
dstPath = "";
573575
dstSubfolderSpec = 7;
574576
files = (
577+
D7F2A0302CD00F400008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift in Copy Source Code Files */,
575578
D75E5EF42CC04A0C00252595 /* EditFeaturesUsingFeatureFormsView.swift in Copy Source Code Files */,
576579
D7201D072CC6D3D3004BDB7D /* AddVectorTiledLayerFromCustomStyleView.swift in Copy Source Code Files */,
577580
D75E5EE92CC0342700252595 /* ListContentsOfKMLFileView.swift in Copy Source Code Files */,
@@ -1062,6 +1065,7 @@
10621065
D7EAF3592A1C023800D822C4 /* SetMinAndMaxScaleView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SetMinAndMaxScaleView.swift; sourceTree = "<group>"; };
10631066
D7ECF5972AB8BE63003FB2BE /* RenderMultilayerSymbolsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RenderMultilayerSymbolsView.swift; sourceTree = "<group>"; };
10641067
D7EF5D742A26A03A00FEBDE5 /* ShowCoordinatesInMultipleFormatsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShowCoordinatesInMultipleFormatsView.swift; sourceTree = "<group>"; };
1068+
D7F2A0292CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApplyDictionaryRendererToFeatureLayerView.swift; sourceTree = "<group>"; };
10651069
D7F8C0362B60564D0072BFA7 /* AddFeaturesWithContingentValuesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AddFeaturesWithContingentValuesView.swift; sourceTree = "<group>"; };
10661070
D7F8C03D2B605AF60072BFA7 /* ContingentValuesBirdNests.geodatabase */ = {isa = PBXFileReference; lastKnownFileType = file; path = ContingentValuesBirdNests.geodatabase; sourceTree = "<group>"; };
10671071
D7F8C0402B605E720072BFA7 /* FillmoreTopographicMap.vtpk */ = {isa = PBXFileReference; lastKnownFileType = file; path = FillmoreTopographicMap.vtpk; sourceTree = "<group>"; };
@@ -1238,6 +1242,7 @@
12381242
1C3B7DC22A5F64FC00907443 /* Analyze network with subnetwork trace */,
12391243
D7C16D172AC5F6C100689E89 /* Animate 3D graphic */,
12401244
D77570BC2A29427200F490CD /* Animate images with image overlay */,
1245+
D7F2A02C2CD00F1C0008D981 /* Apply dictionary renderer to feature layer */,
12411246
955AFAC52C10FD74009C8FE5 /* Apply mosaic rule to rasters */,
12421247
004A2BA12BED456500C297CE /* Apply scheduled updates to preplanned map area */,
12431248
D75362CC2A1E862B00D83028 /* Apply unique value renderer */,
@@ -2881,6 +2886,14 @@
28812886
path = "Show coordinates in multiple formats";
28822887
sourceTree = "<group>";
28832888
};
2889+
D7F2A02C2CD00F1C0008D981 /* Apply dictionary renderer to feature layer */ = {
2890+
isa = PBXGroup;
2891+
children = (
2892+
D7F2A0292CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift */,
2893+
);
2894+
path = "Apply dictionary renderer to feature layer";
2895+
sourceTree = "<group>";
2896+
};
28842897
D7F8C0342B60564D0072BFA7 /* Add features with contingent values */ = {
28852898
isa = PBXGroup;
28862899
children = (
@@ -3463,6 +3476,7 @@
34633476
1C42E04729D2396B004FC4BE /* ShowPopupView.swift in Sources */,
34643477
79302F872A1ED71B0002336A /* CreateAndSaveKMLView.Views.swift in Sources */,
34653478
D73FC0FD2AD4A18D0067A19B /* CreateMobileGeodatabaseView.swift in Sources */,
3479+
D7F2A02F2CD00F1C0008D981 /* ApplyDictionaryRendererToFeatureLayerView.swift in Sources */,
34663480
1C19B4F12A578E46001D2506 /* CreateLoadReportView.Views.swift in Sources */,
34673481
E066DD3B2860CA08004D3D5B /* ShowResultOfSpatialRelationshipsView.swift in Sources */,
34683482
7573E81E29D6134C00BEED9C /* TraceUtilityNetworkView.Views.swift in Sources */,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2024 Esri
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
import ArcGIS
16+
import SwiftUI
17+
18+
struct ApplyDictionaryRendererToFeatureLayerView: View {
19+
@State private var map = Map(basemapStyle: .arcGISTopographic)
20+
21+
var body: some View {
22+
MapView(map: map)
23+
}
24+
}
25+
26+
#Preview {
27+
ApplyDictionaryRendererToFeatureLayerView()
28+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Apply dictionary renderer to feature layer
2+
3+
Convert features into graphics to show them with mil2525d symbols.
4+
5+
![Image of apply dictionary renderer to feature layer](ApplyDictionayRendererToFeatureLayer.png)
6+
7+
## Use case
8+
9+
A dictionary renderer uses a style file along with a rule engine to display advanced symbology.
10+
This is useful for displaying features using precise military symbology.
11+
12+
## How to use the sample
13+
14+
Pan and zoom around the map. Observe the displayed military symbology on the map.
15+
16+
## How it works
17+
18+
1. Create a `Geodatabase` using `Geodatabase(geodatabasePath)`.
19+
2. Load the geodatabase using `Geodatabase.load()`.
20+
3. Instantiate a `DictionarySymbolStyle` using `DictionarySymbolStyle(dictionarySymbolStylePath)`.
21+
4. Load the dictionarySymbolStyle using `DictionarySymbolStyle.load()`.
22+
5. Cycle through each `GeodatabaseFeatureTable` from the geodatabase using `Geodatabase.featureTables`.
23+
6. Create a `FeatureLayer` from each table within the geodatabase using `FeatureLayer(GeodatabaseFeatureTable)`.
24+
7. Load the feature layer with `FeatureLayer.load()`.
25+
8. After the last layer has loaded, create a new `Envelope` from a union of the extents of all layers.
26+
9. Set the envelope to be the `Viewpoint` of the map view using `MapView.setViewpoint(new Viewpoint(Envelope))`.
27+
10. Add the feature layer to map using `Map.operationalLayers.add(FeatureLayer)`.
28+
11. Create a `DictionaryRenderer(SymbolDictionary)` and assign it to the feature layer renderer `featureLayer.renderer = dictionaryRenderer`.
29+
30+
## Relevant API
31+
32+
* DictionaryRenderer
33+
* DictionarySymbolStyle
34+
35+
## Offline data
36+
37+
Read more about how to set up the sample's offline data [here](https://github.com/Esri/arcgis-runtime-samples-qt#use-offline-data-in-the-samples).
38+
39+
Link | Local Location
40+
---------|-------|
41+
|[Mil2525d Stylx File](https://www.arcgis.com/home/item.html?id=c78b149a1d52414682c86a5feeb13d30)| `<userhome>`/ArcGIS/Runtime/Data/styles/mil2525d.stylx |
42+
|[Military Overlay geodatabase](https://www.arcgis.com/home/item.html?id=e0d41b4b409a49a5a7ba11939d8535dc)| `<userhome>`/ArcGIS/Runtime/Data/geodatabase/militaryoverlay.geodatabase |
43+
44+
## Tags
45+
46+
military, symbol
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"category": "Visualization",
3+
"description": "Convert features into graphics to show them with mil2525d symbols.",
4+
"ignore": false,
5+
"images": [],
6+
"keywords": [
7+
"military",
8+
"symbol",
9+
"DictionaryRenderer",
10+
"DictionarySymbolStyle"
11+
],
12+
"redirect_from": [],
13+
"relevant_apis": [
14+
"DictionaryRenderer",
15+
"DictionarySymbolStyle"
16+
],
17+
"snippets": [
18+
"ApplyDictionaryRendererToFeatureLayerView.swift"
19+
],
20+
"title": "Apply dictionary renderer to feature layer"
21+
}

0 commit comments

Comments
 (0)