diff --git a/Samples.xcodeproj/project.pbxproj b/Samples.xcodeproj/project.pbxproj index b3f1177b..204e728b 100644 --- a/Samples.xcodeproj/project.pbxproj +++ b/Samples.xcodeproj/project.pbxproj @@ -244,6 +244,9 @@ D7114A0F2BDC6AED00FA68CA /* EditWithBranchVersioningView.Model.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7114A0C2BDC6A3300FA68CA /* EditWithBranchVersioningView.Model.swift */; }; D71371792BD88ECC00EB2F86 /* MonitorChangesToLayerViewStateView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D71371752BD88ECC00EB2F86 /* MonitorChangesToLayerViewStateView.swift */; }; D713717C2BD88EF800EB2F86 /* MonitorChangesToLayerViewStateView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D71371752BD88ECC00EB2F86 /* MonitorChangesToLayerViewStateView.swift */; }; + D713C6D72CB990600073AA72 /* AddKMLLayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D713C6D12CB990600073AA72 /* AddKMLLayerView.swift */; }; + D713C6D82CB990800073AA72 /* AddKMLLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D713C6D12CB990600073AA72 /* AddKMLLayerView.swift */; }; + D713C6F72CB9B9A60073AA72 /* US_State_Capitals.kml in Resources */ = {isa = PBXBuildFile; fileRef = D713C6F52CB9B9A60073AA72 /* US_State_Capitals.kml */; settings = {ASSET_TAGS = (AddKmlLayer, ); }; }; D718A1E72B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift in Sources */ = {isa = PBXBuildFile; fileRef = D718A1E62B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift */; }; D718A1E82B571C9100447087 /* OrbitCameraAroundObjectView.Model.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D718A1E62B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift */; }; D718A1ED2B575FD900447087 /* ManageBookmarksView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D718A1EA2B575FD900447087 /* ManageBookmarksView.swift */; }; @@ -391,6 +394,8 @@ D77D9C012BB2439400B38A6C /* AugmentRealityToShowHiddenInfrastructureView.ARSceneView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D77D9BFF2BB2438200B38A6C /* AugmentRealityToShowHiddenInfrastructureView.ARSceneView.swift */; }; D7848ED82CBD85A300F6F546 /* AddPointSceneLayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7848ED42CBD85A300F6F546 /* AddPointSceneLayerView.swift */; }; D7848EDB2CBD85D100F6F546 /* AddPointSceneLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7848ED42CBD85A300F6F546 /* AddPointSceneLayerView.swift */; }; + D7848EFE2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7848EFA2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift */; }; + D7848F012CBD987B00F6F546 /* AddElevationSourceFromRasterView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7848EFA2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift */; }; D78666AD2A2161F100C60110 /* FindNearestVertexView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78666AC2A2161F100C60110 /* FindNearestVertexView.swift */; }; D78666AE2A21629200C60110 /* FindNearestVertexView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D78666AC2A2161F100C60110 /* FindNearestVertexView.swift */; }; D78FA4942C3C88880079313E /* CreateDynamicBasemapGalleryView.Views.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78FA4932C3C88880079313E /* CreateDynamicBasemapGalleryView.Views.swift */; }; @@ -417,6 +422,14 @@ D7BA8C442B2A4DAA00018633 /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BA8C432B2A4DAA00018633 /* Array.swift */; }; D7BA8C462B2A8ACA00018633 /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BA8C452B2A8ACA00018633 /* String.swift */; }; D7BB3DD22C5D781800FFCD56 /* SaveTheBay.geodatabase in Resources */ = {isa = PBXBuildFile; fileRef = D7BB3DD02C5D781800FFCD56 /* SaveTheBay.geodatabase */; settings = {ASSET_TAGS = (EditGeodatabaseWithTransactions, ); }; }; + D7BE7E6F2CC19CC3006DDB0C /* AddTiledLayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BE7E6B2CC19CC3006DDB0C /* AddTiledLayerView.swift */; }; + D7BE7E722CC19CE5006DDB0C /* AddTiledLayerView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7BE7E6B2CC19CC3006DDB0C /* AddTiledLayerView.swift */; }; + D7BEBAA02CBD9CCA00F882E7 /* MontereyElevation.dt2 in Resources */ = {isa = PBXBuildFile; fileRef = D7BEBA9E2CBD9CCA00F882E7 /* MontereyElevation.dt2 */; settings = {ASSET_TAGS = (AddElevationSourceFromRaster, ); }; }; + D7BEBAC52CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BEBABF2CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift */; }; + D7BEBAC62CBDC11600F882E7 /* AddElevationSourceFromTilePackageView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7BEBABF2CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift */; }; + D7BEBAC92CBDC81200F882E7 /* MontereyElevation.tpkx in Resources */ = {isa = PBXBuildFile; fileRef = D7BEBAC72CBDC81200F882E7 /* MontereyElevation.tpkx */; settings = {ASSET_TAGS = (AddElevationSourceFromTilePackage, ); }; }; + D7BEBAD22CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BEBACE2CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift */; }; + D7BEBAD52CBDFE3900F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7BEBACE2CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift */; }; D7C16D1B2AC5F95300689E89 /* Animate3DGraphicView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7C16D1A2AC5F95300689E89 /* Animate3DGraphicView.swift */; }; D7C16D1C2AC5F96900689E89 /* Animate3DGraphicView.swift in Copy Source Code Files */ = {isa = PBXBuildFile; fileRef = D7C16D1A2AC5F95300689E89 /* Animate3DGraphicView.swift */; }; D7C16D1F2AC5FE8200689E89 /* Pyrenees.csv in Resources */ = {isa = PBXBuildFile; fileRef = D7C16D1E2AC5FE8200689E89 /* Pyrenees.csv */; settings = {ASSET_TAGS = (Animate3DGraphic, ); }; }; @@ -553,9 +566,14 @@ dstSubfolderSpec = 7; files = ( D75E5EE92CC0342700252595 /* ListContentsOfKMLFileView.swift in Copy Source Code Files */, + D7BE7E722CC19CE5006DDB0C /* AddTiledLayerView.swift in Copy Source Code Files */, + D7BEBAD52CBDFE3900F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift in Copy Source Code Files */, + D7BEBAC62CBDC11600F882E7 /* AddElevationSourceFromTilePackageView.swift in Copy Source Code Files */, + D7848F012CBD987B00F6F546 /* AddElevationSourceFromRasterView.swift in Copy Source Code Files */, D7848EDB2CBD85D100F6F546 /* AddPointSceneLayerView.swift in Copy Source Code Files */, D7DFA0ED2CBA0260007C31F2 /* AddMapImageLayerView.swift in Copy Source Code Files */, D7CDD38C2CB86F4A00DE9766 /* AddPointCloudLayerFromFileView.swift in Copy Source Code Files */, + D713C6D82CB990800073AA72 /* AddKMLLayerView.swift in Copy Source Code Files */, 95E0DBCA2C503E2500224A82 /* ShowDeviceLocationUsingIndoorPositioningView.swift in Copy Source Code Files */, 95E0DBCB2C503E2500224A82 /* ShowDeviceLocationUsingIndoorPositioningView.Model.swift in Copy Source Code Files */, D71C90A52C6C252F0018C63E /* StyleGeometryTypesWithSymbolsView.Views.swift in Copy Source Code Files */, @@ -903,6 +921,8 @@ D710996F2A2802FA0065A1C1 /* DensifyAndGeneralizeGeometryView.SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DensifyAndGeneralizeGeometryView.SettingsView.swift; sourceTree = ""; }; D7114A0C2BDC6A3300FA68CA /* EditWithBranchVersioningView.Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditWithBranchVersioningView.Model.swift; sourceTree = ""; }; D71371752BD88ECC00EB2F86 /* MonitorChangesToLayerViewStateView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MonitorChangesToLayerViewStateView.swift; sourceTree = ""; }; + D713C6D12CB990600073AA72 /* AddKMLLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddKMLLayerView.swift; sourceTree = ""; }; + D713C6F52CB9B9A60073AA72 /* US_State_Capitals.kml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = US_State_Capitals.kml; sourceTree = ""; }; D718A1E62B570F7500447087 /* OrbitCameraAroundObjectView.Model.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrbitCameraAroundObjectView.Model.swift; sourceTree = ""; }; D718A1EA2B575FD900447087 /* ManageBookmarksView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ManageBookmarksView.swift; sourceTree = ""; }; D71C5F632AAA7A88006599FD /* CreateSymbolStylesFromWebStylesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateSymbolStylesFromWebStylesView.swift; sourceTree = ""; }; @@ -983,6 +1003,7 @@ D77BC5362B59A2D3007B49B6 /* StylePointWithDistanceCompositeSceneSymbolView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StylePointWithDistanceCompositeSceneSymbolView.swift; sourceTree = ""; }; D77D9BFF2BB2438200B38A6C /* AugmentRealityToShowHiddenInfrastructureView.ARSceneView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AugmentRealityToShowHiddenInfrastructureView.ARSceneView.swift; sourceTree = ""; }; D7848ED42CBD85A300F6F546 /* AddPointSceneLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddPointSceneLayerView.swift; sourceTree = ""; }; + D7848EFA2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddElevationSourceFromRasterView.swift; sourceTree = ""; }; D78666AC2A2161F100C60110 /* FindNearestVertexView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FindNearestVertexView.swift; sourceTree = ""; }; D78FA4932C3C88880079313E /* CreateDynamicBasemapGalleryView.Views.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateDynamicBasemapGalleryView.Views.swift; sourceTree = ""; }; D79482D02C35D872006521CD /* CreateDynamicBasemapGalleryView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreateDynamicBasemapGalleryView.swift; sourceTree = ""; }; @@ -997,6 +1018,11 @@ D7BA8C432B2A4DAA00018633 /* Array.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Array.swift; sourceTree = ""; }; D7BA8C452B2A8ACA00018633 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; D7BB3DD02C5D781800FFCD56 /* SaveTheBay.geodatabase */ = {isa = PBXFileReference; lastKnownFileType = file; path = SaveTheBay.geodatabase; sourceTree = ""; }; + D7BE7E6B2CC19CC3006DDB0C /* AddTiledLayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddTiledLayerView.swift; sourceTree = ""; }; + D7BEBA9E2CBD9CCA00F882E7 /* MontereyElevation.dt2 */ = {isa = PBXFileReference; lastKnownFileType = text; path = MontereyElevation.dt2; sourceTree = ""; }; + D7BEBABF2CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddElevationSourceFromTilePackageView.swift; sourceTree = ""; }; + D7BEBAC72CBDC81200F882E7 /* MontereyElevation.tpkx */ = {isa = PBXFileReference; lastKnownFileType = file; path = MontereyElevation.tpkx; sourceTree = ""; }; + D7BEBACE2CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayAlternateSymbolsAtDifferentScalesView.swift; sourceTree = ""; }; D7C16D1A2AC5F95300689E89 /* Animate3DGraphicView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Animate3DGraphicView.swift; sourceTree = ""; }; D7C16D1E2AC5FE8200689E89 /* Pyrenees.csv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Pyrenees.csv; sourceTree = ""; }; D7C16D212AC5FE9800689E89 /* GrandCanyon.csv */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GrandCanyon.csv; sourceTree = ""; }; @@ -1178,15 +1204,19 @@ 0000FB6D2BBDB17600845921 /* Add 3D tiles layer */, 79D84D0C2A815BED00F45262 /* Add custom dynamic entity data source */, 4D2ADC3E29C26D05003B367F /* Add dynamic entity layer */, + D7848EFD2CBD986400F6F546 /* Add elevation source from raster */, + D7BEBAC22CBDC0F800F882E7 /* Add elevation source from tile package */, 9537AFB52C2208CD000923C5 /* Add ENC exchange set */, 00D4EF7E2863840D00B9CC30 /* Add feature layers */, D7F8C0342B60564D0072BFA7 /* Add features with contingent values */, + D713C6D42CB990600073AA72 /* Add KML layer */, D7DFA0E92CBA0242007C31F2 /* Add map image layer */, D7CDD3882CB86F0A00DE9766 /* Add point cloud layer from file */, D7848ED72CBD85A300F6F546 /* Add point scene layer */, F19A316128906F0D003B7EF9 /* Add raster from file */, 955271622C0E6750009B1ED4 /* Add raster from service */, E066DD3E28610F3F004D3D5B /* Add scene layer from service */, + D7BE7E6E2CC19CC3006DDB0C /* Add tiled layer */, 3E54CF202C66AFA400DD2F18 /* Add web tiled layer */, D7E557602A1D743100B9FB09 /* Add WMS layer */, 1C3B7DC22A5F64FC00907443 /* Analyze network with subnetwork trace */, @@ -1221,6 +1251,7 @@ D71C5F602AAA7854006599FD /* Create symbol styles from web styles */, E000E761286A0B07005D87C5 /* Cut geometry */, D71099692A27D8880065A1C1 /* Densify and generalize geometry */, + D7BEBAD12CBDFE1C00F882E7 /* Display alternate symbols at different scales */, D7AE861A2AC39D750049B626 /* Display annotation */, D7635FEA2B9272CB0044AB97 /* Display clusters */, 00A7A1422A2FC58300F035F7 /* Display content of utility network container */, @@ -1428,10 +1459,12 @@ 00D4EF8328638BF100B9CC30 /* 15a7cbd3af1e47cfa5d2c6b93dc44fc2 */, D7CE9F992AE2F575008F7A5F /* 22c3083d4fa74e3e9b25adfc9f8c0496 */, D7CDD38E2CB872EA00DE9766 /* 34da965ca51d4c68aa9b3a38edb29e00 */, + D7BEBAC82CBDC81200F882E7 /* 52ca74b4ba8042b78b3c653696f34a9c */, 00D4EF8E28638BF100B9CC30 /* 68ec42517cdd439e81b036210483e8e7 */, D762AF642BF6A96100ECE3C7 /* 74c0c9fa80f4498c9739cc42531e9948 */, D76000B52AF19FC900B3084D /* 260eb6535c824209964cf281766ebe43 */, D7C16D202AC5FE9800689E89 /* 290f0c571c394461a8b58b6775d0bd63 */, + D713C6F62CB9B9A60073AA72 /* 324e4742820e46cfbe5029ff2c32cb1f */, 1C965C4629DBA879002F8536 /* 681d6f7694644709a7c830ec57a2d72b */, 004A2B962BED454300C297CE /* 740b663bff5e4198b9b6674af93f638a */, D7CE9F9C2AE2F585008F7A5F /* 3424d442ebe54f3cbf34462382d3aebe */, @@ -1440,6 +1473,7 @@ D7BB3DD12C5D781800FFCD56 /* 43809fd639f242fd8045ecbafd61a579 */, 10D321912BDB187400B39B1B /* 85282f2aaa2844d8935cdb8722e22a93 */, D73F8CF22AB1089900CD39DA /* 751138a2e0844e06853522d54103222a */, + D7BEBA9F2CBD9CCA00F882E7 /* 98092369c4ae4d549bbbd45dba993ebc */, D721EEA62ABDFF550040BE46 /* 174150279af74a2ba6f8b87a567f480b */, 792222DB2A81AA5D00619FFE /* a8a942c228af4fac96baa78ad60f511f */, D7464F202ACE0910007FEE88 /* b5f977c78ec74b3a8857ca86d1d9b318 */, @@ -1985,6 +2019,22 @@ path = "Monitor changes to layer view state"; sourceTree = ""; }; + D713C6D42CB990600073AA72 /* Add KML layer */ = { + isa = PBXGroup; + children = ( + D713C6D12CB990600073AA72 /* AddKMLLayerView.swift */, + ); + path = "Add KML layer"; + sourceTree = ""; + }; + D713C6F62CB9B9A60073AA72 /* 324e4742820e46cfbe5029ff2c32cb1f */ = { + isa = PBXGroup; + children = ( + D713C6F52CB9B9A60073AA72 /* US_State_Capitals.kml */, + ); + path = 324e4742820e46cfbe5029ff2c32cb1f; + sourceTree = ""; + }; D718A1E92B575FD900447087 /* Manage bookmarks */ = { isa = PBXGroup; children = ( @@ -2470,6 +2520,14 @@ path = "Add point scene layer"; sourceTree = ""; }; + D7848EFD2CBD986400F6F546 /* Add elevation source from raster */ = { + isa = PBXGroup; + children = ( + D7848EFA2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift */, + ); + path = "Add elevation source from raster"; + sourceTree = ""; + }; D78666A92A21616D00C60110 /* Find nearest vertex */ = { isa = PBXGroup; children = ( @@ -2544,6 +2602,46 @@ path = 43809fd639f242fd8045ecbafd61a579; sourceTree = ""; }; + D7BE7E6E2CC19CC3006DDB0C /* Add tiled layer */ = { + isa = PBXGroup; + children = ( + D7BE7E6B2CC19CC3006DDB0C /* AddTiledLayerView.swift */, + ); + path = "Add tiled layer"; + sourceTree = ""; + }; + D7BEBA9F2CBD9CCA00F882E7 /* 98092369c4ae4d549bbbd45dba993ebc */ = { + isa = PBXGroup; + children = ( + D7BEBA9E2CBD9CCA00F882E7 /* MontereyElevation.dt2 */, + ); + path = 98092369c4ae4d549bbbd45dba993ebc; + sourceTree = ""; + }; + D7BEBAC22CBDC0F800F882E7 /* Add elevation source from tile package */ = { + isa = PBXGroup; + children = ( + D7BEBABF2CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift */, + ); + path = "Add elevation source from tile package"; + sourceTree = ""; + }; + D7BEBAC82CBDC81200F882E7 /* 52ca74b4ba8042b78b3c653696f34a9c */ = { + isa = PBXGroup; + children = ( + D7BEBAC72CBDC81200F882E7 /* MontereyElevation.tpkx */, + ); + path = 52ca74b4ba8042b78b3c653696f34a9c; + sourceTree = ""; + }; + D7BEBAD12CBDFE1C00F882E7 /* Display alternate symbols at different scales */ = { + isa = PBXGroup; + children = ( + D7BEBACE2CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift */, + ); + path = "Display alternate symbols at different scales"; + sourceTree = ""; + }; D7C16D172AC5F6C100689E89 /* Animate 3D graphic */ = { isa = PBXGroup; children = ( @@ -2995,9 +3093,12 @@ BuildIndependentTargetsInParallel = 1; KnownAssetTags = ( AddCustomDynamicEntityDataSource, + AddElevationSourceFromRaster, + AddElevationSourceFromTilePackage, AddEncExchangeSet, AddFeatureLayers, AddFeaturesWithContingentValues, + AddKmlLayer, AddPointCloudLayerFromFile, AddRasterFromFile, Animate3DGraphic, @@ -3076,6 +3177,7 @@ 00C94A0D28B53DE1004E42D9 /* raster-file in Resources */, D7464F2B2ACE0965007FEE88 /* SA_EVI_8Day_03May20 in Resources */, 004FE87129DF5D8700075217 /* Bristol in Resources */, + D713C6F72CB9B9A60073AA72 /* US_State_Capitals.kml in Resources */, D7C16D252AC5FEA600689E89 /* Snowdon.csv in Resources */, D73F8CF42AB1089900CD39DA /* Restaurant.stylx in Resources */, D7BB3DD22C5D781800FFCD56 /* SaveTheBay.geodatabase in Resources */, @@ -3091,6 +3193,7 @@ 00D4EF9A28638BF100B9CC30 /* AuroraCO.gpkg in Resources */, D7C16D282AC5FEB700689E89 /* Hawaii.csv in Resources */, D73571D72CB613220046A433 /* hydrography in Resources */, + D7BEBAC92CBDC81200F882E7 /* MontereyElevation.tpkx in Resources */, D7D1F3532ADDBE5D009CE2DA /* philadelphia.mspk in Resources */, 004A2B9D2BED455B00C297CE /* canyonlands in Resources */, 798C2DA72AFC505600EE7E97 /* PrivacyInfo.xcprivacy in Resources */, @@ -3102,6 +3205,7 @@ 00D4EFB12863CE6300B9CC30 /* ScottishWildlifeTrust_reserves in Resources */, D7781D492B7EB03400E53C51 /* SanDiegoTourPath.json in Resources */, D7C16D222AC5FE9800689E89 /* GrandCanyon.csv in Resources */, + D7BEBAA02CBD9CCA00F882E7 /* MontereyElevation.dt2 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3229,6 +3333,7 @@ D73723792AF5ADD800846884 /* FindRouteInMobileMapPackageView.MobileMapView.swift in Sources */, E004A6E028466279002A1FE6 /* ShowCalloutView.swift in Sources */, E000E763286A0B18005D87C5 /* CutGeometryView.swift in Sources */, + D7BE7E6F2CC19CC3006DDB0C /* AddTiledLayerView.swift in Sources */, D7705D582AFC244E00CC0335 /* FindClosestFacilityToMultiplePointsView.swift in Sources */, D73FCFFF2B02C7630006360D /* FindRouteAroundBarriersView.Views.swift in Sources */, 3EEDE7CE2C5D73F700510104 /* SetSpatialReferenceView.swift in Sources */, @@ -3266,6 +3371,7 @@ E070A0A3286F3B6000F2B606 /* DownloadPreplannedMapAreaView.swift in Sources */, D79482D42C35D872006521CD /* CreateDynamicBasemapGalleryView.swift in Sources */, D77570C02A2942F800F490CD /* AnimateImagesWithImageOverlayView.swift in Sources */, + D7848EFE2CBD986400F6F546 /* AddElevationSourceFromRasterView.swift in Sources */, D7054AE92ACCCB6C007235BA /* Animate3DGraphicView.SettingsView.swift in Sources */, D7BA8C442B2A4DAA00018633 /* Array.swift in Sources */, D78FA4942C3C88880079313E /* CreateDynamicBasemapGalleryView.Views.swift in Sources */, @@ -3314,6 +3420,7 @@ D7C3AB4A2B683291008909B9 /* SetFeatureRequestModeView.swift in Sources */, 95D2EE0F2C334D1600683D53 /* ShowServiceAreaView.swift in Sources */, D7058FB12ACB423C00A40F14 /* Animate3DGraphicView.Model.swift in Sources */, + D7BEBAC52CBDC0F800F882E7 /* AddElevationSourceFromTilePackageView.swift in Sources */, D77D9C002BB2438200B38A6C /* AugmentRealityToShowHiddenInfrastructureView.ARSceneView.swift in Sources */, 0044CDDF2995C39E004618CE /* ShowDeviceLocationHistoryView.swift in Sources */, E041ABC0287CA9F00056009B /* WebView.swift in Sources */, @@ -3385,6 +3492,7 @@ E088E1742863B5F800413100 /* GenerateOfflineMapView.swift in Sources */, 0074ABC428174F430037244A /* Sample.swift in Sources */, 95E980712C26183000CB8912 /* BrowseOGCAPIFeatureServiceView.swift in Sources */, + D713C6D72CB990600073AA72 /* AddKMLLayerView.swift in Sources */, 00A7A14A2A2FC5B700F035F7 /* DisplayContentOfUtilityNetworkContainerView.Model.swift in Sources */, E004A6F0284E4B9B002A1FE6 /* DownloadVectorTilesToLocalCacheView.swift in Sources */, 00ABA94E2BF6721700C0488C /* ShowGridView.swift in Sources */, @@ -3401,6 +3509,7 @@ 0042E24528E4F82C001F33D6 /* ShowViewshedFromPointInSceneView.ViewshedSettingsView.swift in Sources */, D7DDF8532AF47C6C004352D9 /* FindRouteAroundBarriersView.swift in Sources */, 1C9B74D929DB54560038B06F /* ChangeCameraControllerView.swift in Sources */, + D7BEBAD22CBDFE1C00F882E7 /* DisplayAlternateSymbolsAtDifferentScalesView.swift in Sources */, D76000AE2AF19C2300B3084D /* FindRouteInMobileMapPackageView.swift in Sources */, 00273CF42A82AB5900A7A77D /* SamplesSearchView.swift in Sources */, D78666AD2A2161F100C60110 /* FindNearestVertexView.swift in Sources */, diff --git a/Shared/Samples/Add KML layer/AddKMLLayerView.swift b/Shared/Samples/Add KML layer/AddKMLLayerView.swift new file mode 100644 index 00000000..11570344 --- /dev/null +++ b/Shared/Samples/Add KML layer/AddKMLLayerView.swift @@ -0,0 +1,109 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ArcGIS +import SwiftUI + +struct AddKMLLayerView: View { + /// The view model for the sample. + @StateObject private var model = Model() + + /// The viewpoint used to update the map view. + @State private var viewpoint: Viewpoint? + + /// The KML layer source selected by the picker. + @State private var selectedLayerSource = KMLLayerSource.url + + var body: some View { + MapView(map: model.map, viewpoint: viewpoint) + .toolbar { + ToolbarItem(placement: .bottomBar) { + Picker("KML Layer Source", selection: $selectedLayerSource) { + ForEach(KMLLayerSource.allCases, id: \.self) { source in + Text(source.label) + } + } + .onChange(of: selectedLayerSource, perform: setKMLLayer(forSource:)) + } + } + .task { + // Loads all the KML layers when the sample opens. + let kmlLayers = [model.urlLayer, model.localFileLayer, model.portalItemLayer] + await kmlLayers.load() + + setKMLLayer(forSource: selectedLayerSource) + } + } + + /// Sets a KML layer on the map. + /// - Parameter source: The source that was used to create the KML layer. + private func setKMLLayer(forSource source: KMLLayerSource) { + let kmlLayer = switch source { + case .url: model.urlLayer + case .localFile: model.localFileLayer + case .portalItem: model.portalItemLayer + } + + // Replaces the current KML layer on the map. + model.map.removeAllOperationalLayers() + model.map.addOperationalLayer(kmlLayer) + + // Zooms the map view's viewpoint to the layer. + guard let layerExtent = kmlLayer.fullExtent else { return } + let expandedExtent = layerExtent.withBuilder { $0.expand(by: 1.1) } + viewpoint = Viewpoint(boundingGeometry: expandedExtent) + } +} + +private extension AddKMLLayerView { + /// The view model that contains the map and KML layers. + final class Model: ObservableObject { + /// A map with a dark grey basemap. + let map = Map(basemapStyle: .arcGISDarkGrayBase) + + /// A KML layer created from a web URL. + let urlLayer: KMLLayer = { + let url = URL(string: "https://www.wpc.ncep.noaa.gov/kml/noaa_chart/WPC_Day1_SigWx.kml")! + let kmlDataset = KMLDataset(url: url) + return KMLLayer(dataset: kmlDataset) + }() + + /// A KML layer created from a local file in the bundle. + let localFileLayer: KMLLayer = { + let kmlDataset = KMLDataset(name: "US_State_Capitals", bundle: .main)! + return KMLLayer(dataset: kmlDataset) + }() + + /// A KML layer created from a portal item. + let portalItemLayer: KMLLayer = { + let portalID = PortalItem.ID("9fe0b1bfdcd64c83bd77ea0452c76253")! + let portalItem = PortalItem(portal: .arcGISOnline(connection: .anonymous), id: portalID) + return KMLLayer(item: portalItem) + }() + } + + /// A source that was used to create a KML layer. + enum KMLLayerSource: CaseIterable { + case url, localFile, portalItem + + /// A human-readable label for the KML layer source. + var label: String { + switch self { + case .url: "URL" + case .localFile: "Local File" + case .portalItem: "Portal Item" + } + } + } +} diff --git a/Shared/Samples/Add KML layer/README.md b/Shared/Samples/Add KML layer/README.md new file mode 100644 index 00000000..1666ec1b --- /dev/null +++ b/Shared/Samples/Add KML layer/README.md @@ -0,0 +1,41 @@ +# Add KML layer + +Display KML from a URL, portal item, or local KML file. + +![Screenshot of Add KML layer sample](add-kml-layer.png) + +## Use case + +Keyhole Markup Language (KML) is a data format used by Google Earth. KML is popular as a transmission format for consumer use and for sharing geographic data between apps. You can use the Maps SDKs to display KML files, with full support for a variety of features, including network links, 3D models, screen overlays, and tours. + +## How to use the sample + +Use the picker to select a source. A KML layer created from that source will then be displayed in the map. + +## How it works + +1. To create a KML layer from a URL, create a `KMLDataset` with the URL to the KML file. Then, create a `KMLLayer` using the dataset. +2. To create a KML layer from a portal item, create a `PortalItem` with a `Portal` and the KML portal item ID. Then, create a `KMLLayer` using the portal item. +3. To create a KML layer from a local file, create a `KMLDataset` using the absolute file path to the local KML file. Then, create a `KMLLayer` using the dataset. +4. Add the layer to the map with `addOperationalLayer(_:)`. + +## Relevant API + +* KMLDataset +* KMLLayer + +## Offline data + +This sample uses the [US State Capitals](https://www.arcgis.com/home/item.html?id=324e4742820e46cfbe5029ff2c32cb1f) KML file. It is downloaded from ArcGIS Online automatically. + +## About the data + +This sample displays three different KML files: + +* From URL: This is a map of the significant weather outlook produced by NOAA/NWS. It uses KML network links to always show the latest data. +* From local file: This is a map of U.S. state capitals. It doesn't define an icon, so the default pushpin is used for the points. +* From portal item: This is a map of U.S. states. + +## Tags + +keyhole, KML, KMZ, OGC diff --git a/Shared/Samples/Add KML layer/README.metadata.json b/Shared/Samples/Add KML layer/README.metadata.json new file mode 100644 index 00000000..fc95c3f7 --- /dev/null +++ b/Shared/Samples/Add KML layer/README.metadata.json @@ -0,0 +1,28 @@ +{ + "category": "Layers", + "description": "Display KML from a URL, portal item, or local KML file.", + "ignore": false, + "images": [ + "add-kml-layer.png" + ], + "keywords": [ + "KML", + "KMZ", + "OGC", + "keyhole", + "KMLDataset", + "KMLLayer" + ], + "offline_data": [ + "324e4742820e46cfbe5029ff2c32cb1f" + ], + "redirect_from": [], + "relevant_apis": [ + "KMLDataset", + "KMLLayer" + ], + "snippets": [ + "AddKMLLayerView.swift" + ], + "title": "Add KML layer" +} diff --git a/Shared/Samples/Add KML layer/add-kml-layer.png b/Shared/Samples/Add KML layer/add-kml-layer.png new file mode 100644 index 00000000..5f12fcf3 Binary files /dev/null and b/Shared/Samples/Add KML layer/add-kml-layer.png differ diff --git a/Shared/Samples/Add elevation source from raster/AddElevationSourceFromRasterView.swift b/Shared/Samples/Add elevation source from raster/AddElevationSourceFromRasterView.swift new file mode 100644 index 00000000..2d763fc4 --- /dev/null +++ b/Shared/Samples/Add elevation source from raster/AddElevationSourceFromRasterView.swift @@ -0,0 +1,61 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ArcGIS +import SwiftUI + +struct AddElevationSourceFromRasterView: View { + /// A scene with elevation for Monterey, California. + @State private var scene: ArcGIS.Scene = { + let scene = Scene(basemapStyle: .arcGISImagery) + + // Creates the raster elevation source using a URL. + let rasterElevationSource = RasterElevationSource(fileURLs: [.montereyElevation]) + + // Creates a surface to add the elevation source to the scene. + let surface = Surface() + surface.addElevationSource(rasterElevationSource) + scene.baseSurface = surface + + // Sets the scene's initial camera to showcase the elevation. + let camera = Camera( + latitude: 36.525, + longitude: -121.8, + altitude: 300, + heading: 180, + pitch: 80, + roll: 0 + ) + let viewpoint = Viewpoint(latitude: .nan, longitude: .nan, scale: .nan, camera: camera) + scene.initialViewpoint = viewpoint + + return scene + }() + + var body: some View { + // Displays the scene in a scene view. + SceneView(scene: scene) + } +} + +private extension URL { + /// The URL to the local DTED2 Raster file with elevation for Monterey, California. + static var montereyElevation: URL { + Bundle.main.url(forResource: "MontereyElevation", withExtension: "dt2")! + } +} + +#Preview { + AddElevationSourceFromRasterView() +} diff --git a/Shared/Samples/Add elevation source from raster/README.md b/Shared/Samples/Add elevation source from raster/README.md new file mode 100644 index 00000000..e6229602 --- /dev/null +++ b/Shared/Samples/Add elevation source from raster/README.md @@ -0,0 +1,50 @@ +# Add elevation source from raster + +Set the terrain surface with elevation described by a raster file. + +![Screenshot of Add elevation source from raster sample](add-elevation-source-from-raster.png) + +## Use case + +In a scene view, the terrain surface is what the basemap, operational layers, and graphics are draped onto. For example, when viewing a scene in a mountainous region, applying a terrain surface to the scene will help in recognizing the slopes, valleys, and elevated areas. + +## How to use the sample + +When opened, the sample displays a scene with a terrain surface applied. Pan and zoom to explore the scene and observe how the terrain surface allows visualizing elevation differences. + +## How it works + +1. Create a `Scene` and add it to a `SceneView`. +2. Create a `RasterElevationSource` with an array of raster file URLs. +3. Add the source to the scene's base surface. + +## Relevant API + +* RasterElevationSource +* Surface + +## Offline data + +This sample uses the [MontereyElevation](https://arcgisruntime.maps.arcgis.com/home/item.html?id=98092369c4ae4d549bbbd45dba993ebc) raster. It is downloaded from ArcGIS Online automatically. + +## Additional information + + Supported raster formats include: + +* ASRP/USRP +* CIB1, 5, 10 +* DTED0, 1, 2 +* GeoTIFF +* HFA +* HRE +* IMG +* JPEG +* JPEG 2000 +* NITF +* PNG +* RPF +* SRTM1, 2 + +## Tags + +3D, elevation, raster, surface, terrain diff --git a/Shared/Samples/Add elevation source from raster/README.metadata.json b/Shared/Samples/Add elevation source from raster/README.metadata.json new file mode 100644 index 00000000..f56153e1 --- /dev/null +++ b/Shared/Samples/Add elevation source from raster/README.metadata.json @@ -0,0 +1,29 @@ +{ + "category": "Scenes", + "description": "Set the terrain surface with elevation described by a raster file.", + "ignore": false, + "images": [ + "add-elevation-source-from-raster.png" + ], + "keywords": [ + "3D", + "elevation", + "raster", + "surface", + "terrain", + "RasterElevationSource", + "Surface" + ], + "offline_data": [ + "98092369c4ae4d549bbbd45dba993ebc" + ], + "redirect_from": [], + "relevant_apis": [ + "RasterElevationSource", + "Surface" + ], + "snippets": [ + "AddElevationSourceFromRasterView.swift" + ], + "title": "Add elevation source from raster" +} diff --git a/Shared/Samples/Add elevation source from raster/add-elevation-source-from-raster.png b/Shared/Samples/Add elevation source from raster/add-elevation-source-from-raster.png new file mode 100644 index 00000000..b37dda0c Binary files /dev/null and b/Shared/Samples/Add elevation source from raster/add-elevation-source-from-raster.png differ diff --git a/Shared/Samples/Add elevation source from tile package/AddElevationSourceFromTilePackageView.swift b/Shared/Samples/Add elevation source from tile package/AddElevationSourceFromTilePackageView.swift new file mode 100644 index 00000000..e8175963 --- /dev/null +++ b/Shared/Samples/Add elevation source from tile package/AddElevationSourceFromTilePackageView.swift @@ -0,0 +1,61 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ArcGIS +import SwiftUI + +struct AddElevationSourceFromTilePackageView: View { + /// A scene with elevation for Monterey, California. + @State private var scene: ArcGIS.Scene = { + let scene = Scene(basemapStyle: .arcGISImagery) + + // Creates the tiled elevation source using a URL. + let rasterElevationSource = ArcGISTiledElevationSource(url: .montereyElevationTilePackage) + + // Creates a surface to add the elevation source to the scene. + let surface = Surface() + surface.addElevationSource(rasterElevationSource) + scene.baseSurface = surface + + // Sets the scene's initial camera to showcase the elevation. + let camera = Camera( + latitude: 36.525, + longitude: -121.8, + altitude: 300, + heading: 180, + pitch: 80, + roll: 0 + ) + let viewpoint = Viewpoint(latitude: .nan, longitude: .nan, scale: .nan, camera: camera) + scene.initialViewpoint = viewpoint + + return scene + }() + + var body: some View { + // Displays the scene in a scene view. + SceneView(scene: scene) + } +} + +private extension URL { + /// The URL to the local tile package file with elevation data for Monterey, California. + static var montereyElevationTilePackage: URL { + Bundle.main.url(forResource: "MontereyElevation", withExtension: "tpkx")! + } +} + +#Preview { + AddElevationSourceFromTilePackageView() +} diff --git a/Shared/Samples/Add elevation source from tile package/README.md b/Shared/Samples/Add elevation source from tile package/README.md new file mode 100644 index 00000000..ec7ed43a --- /dev/null +++ b/Shared/Samples/Add elevation source from tile package/README.md @@ -0,0 +1,36 @@ +# Add elevation source from tile package + +Set the terrain surface with elevation described by a local tile package. + +![Screenshot of Add elevation source from tile package sample](add-elevation-source-from-tile-package.png) + +## Use case + +In a scene view, the terrain surface is what the basemap, operational layers, and graphics are draped onto. For example, when viewing a scene in a mountainous region, applying a terrain surface to the scene will help in recognizing the slopes, valleys, and elevated areas. + +## How to use the sample + +When loaded, the sample will show a scene with a terrain surface applied. Pan and zoom to explore the scene and observe how the terrain surface allows visualizing elevation differences. + +## How it works + +1. Create a `Scene` and add it to a `SceneView`. +2. Create an `ArcGISTiledElevationSource` with the path to the local tile package. +3. Add the source to the scene's base surface. + +## Relevant API + +* ArcGISTiledElevationSource +* Surface + +## Offline data + +This sample uses the [Monterey Elevation](https://arcgisruntime.maps.arcgis.com/home/item.html?id=52ca74b4ba8042b78b3c653696f34a9c) tile package, using CompactV2 storage format (.tpkx). It is downloaded from ArcGIS Online automatically. + +## Additional information + +The tile package must be a LERC (limited error raster compression) encoded TPK/TPKX. Details on the topic can be found in [Share a tile package](https://pro.arcgis.com/en/pro-app/help/sharing/overview/tile-package.htm) in the *ArcGIS Pro* documentation. + +## Tags + +3D, elevation, LERC, surface, terrain, tile cache diff --git a/Shared/Samples/Add elevation source from tile package/README.metadata.json b/Shared/Samples/Add elevation source from tile package/README.metadata.json new file mode 100644 index 00000000..69b9e31b --- /dev/null +++ b/Shared/Samples/Add elevation source from tile package/README.metadata.json @@ -0,0 +1,30 @@ +{ + "category": "Scenes", + "description": "Set the terrain surface with elevation described by a local tile package.", + "ignore": false, + "images": [ + "add-elevation-source-from-tile-package.png" + ], + "keywords": [ + "3D", + "LERC", + "elevation", + "surface", + "terrain", + "tile cache", + "ArcGISTiledElevationSource", + "Surface" + ], + "offline_data": [ + "52ca74b4ba8042b78b3c653696f34a9c" + ], + "redirect_from": [], + "relevant_apis": [ + "ArcGISTiledElevationSource", + "Surface" + ], + "snippets": [ + "AddElevationSourceFromTilePackageView.swift" + ], + "title": "Add elevation source from tile package" +} diff --git a/Shared/Samples/Add elevation source from tile package/add-elevation-source-from-tile-package.png b/Shared/Samples/Add elevation source from tile package/add-elevation-source-from-tile-package.png new file mode 100644 index 00000000..b6e2e639 Binary files /dev/null and b/Shared/Samples/Add elevation source from tile package/add-elevation-source-from-tile-package.png differ diff --git a/Shared/Samples/Add point cloud layer from file/AddPointCloudLayerFromFileView.swift b/Shared/Samples/Add point cloud layer from file/AddPointCloudLayerFromFileView.swift index bad3d02b..bae89303 100644 --- a/Shared/Samples/Add point cloud layer from file/AddPointCloudLayerFromFileView.swift +++ b/Shared/Samples/Add point cloud layer from file/AddPointCloudLayerFromFileView.swift @@ -60,6 +60,6 @@ private extension URL { /// A URL to the Terrain3D image server on ArcGIS REST. static var worldElevationService: URL { - URL(string: "https://elevation3d.arcgis.com/arcagis/rest/services/WorldElevation3D/Terrain3D/ImageServer")! + URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")! } } diff --git a/Shared/Samples/Add point scene layer/AddPointSceneLayerView.swift b/Shared/Samples/Add point scene layer/AddPointSceneLayerView.swift index 12b45a9d..85e07a90 100644 --- a/Shared/Samples/Add point scene layer/AddPointSceneLayerView.swift +++ b/Shared/Samples/Add point scene layer/AddPointSceneLayerView.swift @@ -45,7 +45,7 @@ private extension URL { /// A web URL to the Terrain3D image server on ArcGIS REST. static var worldElevationService: URL { - URL(string: "https://elevation3d.arcgis.com/arcagis/rest/services/WorldElevation3D/Terrain3D/ImageServer")! + URL(string: "https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer")! } } diff --git a/Shared/Samples/Add tiled layer/AddTiledLayerView.swift b/Shared/Samples/Add tiled layer/AddTiledLayerView.swift new file mode 100644 index 00000000..d57ae9f7 --- /dev/null +++ b/Shared/Samples/Add tiled layer/AddTiledLayerView.swift @@ -0,0 +1,54 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ArcGIS +import SwiftUI + +struct AddTiledLayerView: View { + /// A map with a "World Topographic Map" tiled layer. + @State private var map: Map = { + // A web URL to the "World_Topo_Map" map server on ArcGIS Online. + let worldTopographicMap = URL( + string: "https://services.arcgisonline.com/arcgis/rest/services/World_Topo_Map/MapServer" + )! + + // Creates a tiled layer using the URL. + let tiledLayer = ArcGISTiledLayer(url: worldTopographicMap) + + // Creates a basemap using the layer. + let basemap = Basemap(baseLayer: tiledLayer) + + // Creates a map using the basemap. + let map = Map(basemap: basemap) + + // Sets the initial viewpoint on the map to zoom in on the layer. + let extent = Envelope( + xRange: -18546390...(-1833410), + yRange: -10740120...18985720, + spatialReference: .webMercator + ) + map.initialViewpoint = Viewpoint(boundingGeometry: extent) + + return map + }() + + var body: some View { + // Displays the map using a map view. + MapView(map: map) + } +} + +#Preview { + AddTiledLayerView() +} diff --git a/Shared/Samples/Add tiled layer/README.md b/Shared/Samples/Add tiled layer/README.md new file mode 100644 index 00000000..86cb5e21 --- /dev/null +++ b/Shared/Samples/Add tiled layer/README.md @@ -0,0 +1,39 @@ +# Add tiled layer + +Load an ArcGIS tiled layer from a URL. + +![Screenshot of Add tiled layer sample](add-tiled-layer.png) + +## Use case + +An `ArcGISTiledLayer` consumes raster tiles provided by an ArcGIS service or a tile package (.tpk & .tpkx). Dividing a raster into tiles provides the user with relevant tiles and level of detail while panning and zooming, allowing for rapid map visualization and navigation. For example, say you wanted an application with a map containing all museums in your city so that you could share this with tourists. Since only the museums would need to support being identifiable or queryable within the app, all other contextual information required to orient and direct the tourists could be sourced from a single ArcGIS tiled layer, leading to faster performance and minimizing the time to load the map. + +## How to use the sample + +Open the sample to view the "World Topographic Map" tile layer as the basemap. + +## How it works + +1. Create an `ArcGISTiledLayer` object from a URL. +2. Create a `Basemap`, passing in the tiled layer. +3. Create a `Map` with the basemap. +4. Set the map on the `MapView`. + +## Relevant API + +* ArcGISTiledLayer +* Basemap +* Map +* MapView + +## About the data + +The application utilizes the "World Topographic Map" tile layer. This presents a simple yet powerful illustration of adding visualization context to a basemap through the use of an ArcGIS tiled layer. + +## Additional information + +An ArcGIS tiled layer can also be added to a map as a layer, but it's best practice to use it as a basemap since its purpose is to provide geographical context. ArcGIS tiled layers do not support reprojection, query, select, identify, or editing. + +## Tags + +basemap, layers, raster tiles, tiled layer, visualization diff --git a/Shared/Samples/Add tiled layer/README.metadata.json b/Shared/Samples/Add tiled layer/README.metadata.json new file mode 100644 index 00000000..1f74b452 --- /dev/null +++ b/Shared/Samples/Add tiled layer/README.metadata.json @@ -0,0 +1,30 @@ +{ + "category": "Layers", + "description": "Load an ArcGIS tiled layer from a URL.", + "ignore": false, + "images": [ + "add-tiled-layer.png" + ], + "keywords": [ + "basemap", + "layers", + "raster tiles", + "tiled layer", + "visualization", + "ArcGISTiledLayer", + "Basemap", + "Map", + "MapView" + ], + "redirect_from": [], + "relevant_apis": [ + "ArcGISTiledLayer", + "Basemap", + "Map", + "MapView" + ], + "snippets": [ + "AddTiledLayerView.swift" + ], + "title": "Add tiled layer" +} diff --git a/Shared/Samples/Add tiled layer/add-tiled-layer.png b/Shared/Samples/Add tiled layer/add-tiled-layer.png new file mode 100644 index 00000000..b752a998 Binary files /dev/null and b/Shared/Samples/Add tiled layer/add-tiled-layer.png differ diff --git a/Shared/Samples/Display alternate symbols at different scales/DisplayAlternateSymbolsAtDifferentScalesView.swift b/Shared/Samples/Display alternate symbols at different scales/DisplayAlternateSymbolsAtDifferentScalesView.swift new file mode 100644 index 00000000..83ab43e0 --- /dev/null +++ b/Shared/Samples/Display alternate symbols at different scales/DisplayAlternateSymbolsAtDifferentScalesView.swift @@ -0,0 +1,108 @@ +// Copyright 2024 Esri +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import ArcGIS +import SwiftUI + +struct DisplayAlternateSymbolsAtDifferentScalesView: View { + /// A map with a layer of the incidents in San Francisco, CA. + @State private var map: Map = { + let map = Map(basemapStyle: .arcGISTopographic) + + // Creates the feature layer from a URL and adds it to the map. + let featureTable = ServiceFeatureTable(url: .sf311IncidentsLayer) + let featureLayer = FeatureLayer(featureTable: featureTable) + map.addOperationalLayer(featureLayer) + + // Sets the render on the feature layer. + featureLayer.renderer = makeUniqueValueRenderer() + + let center = Point(x: -13631200, y: 4546830, spatialReference: .webMercator) + map.initialViewpoint = Viewpoint(center: center, scale: 7_500) + + return map + }() + + /// The current viewpoint of the map view. + @State private var viewpoint: Viewpoint? + + var body: some View { + MapView(map: map, viewpoint: viewpoint) + .onViewpointChanged(kind: .centerAndScale) { newViewpoint in + viewpoint = newViewpoint + } + .overlay(alignment: .top) { + Text("Scale: 1:\(viewpoint?.targetScale ?? 0, format: .number.rounded(increment: 1))") + .multilineTextAlignment(.center) + .frame(maxWidth: .infinity, alignment: .center) + .padding(8) + .background(.regularMaterial, ignoresSafeAreaEdges: .horizontal) + } + .toolbar { + ToolbarItem(placement: .bottomBar) { + Button("Reset Viewpoint") { + viewpoint = map.initialViewpoint + } + } + } + } + + /// Creates a unique value renderer with alternate symbols for different scales. + /// - Returns: A new `UniqueValueRenderer` object. + private static func makeUniqueValueRenderer() -> UniqueValueRenderer { + // The multilayer symbol for the low range scale. + let redTriangle = SimpleMarkerSymbol(style: .triangle, color: .red, size: 30) + .toMultilayerSymbol() + redTriangle.referenceProperties = SymbolReferenceProperties(minScale: 5_000, maxScale: 0) + + // The alternate multilayer symbol for the mid range scale. + let blueSquare = SimpleMarkerSymbol(style: .square, color: .blue, size: 30) + .toMultilayerSymbol() + blueSquare.referenceProperties = SymbolReferenceProperties(minScale: 10_000, maxScale: 5_000) + + // The alternate multilayer symbol for the high range scale. + let yellowDiamond = SimpleMarkerSymbol(style: .diamond, color: .yellow, size: 30) + .toMultilayerSymbol() + yellowDiamond.referenceProperties = SymbolReferenceProperties(minScale: 20_000, maxScale: 10_000) + + let uniqueValue = UniqueValue( + description: "unique values based on request type", + label: "unique value", + symbol: redTriangle, + values: ["Damaged Property"], + alternateSymbols: [blueSquare, yellowDiamond] + ) + + // The default symbol for values that don’t match the unique values. + let purpleDiamond = SimpleMarkerSymbol(style: .diamond, color: .purple, size: 15) + .toMultilayerSymbol() + + return UniqueValueRenderer( + fieldNames: ["req_type"], + uniqueValues: [uniqueValue], + defaultSymbol: purpleDiamond + ) + } +} + +private extension URL { + /// The web URL to the SF311 feature service "Incidents" layer on ArcGIS Online. + static var sf311IncidentsLayer: URL { + URL(string: "https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0")! + } +} + +#Preview { + DisplayAlternateSymbolsAtDifferentScalesView() +} diff --git a/Shared/Samples/Display alternate symbols at different scales/README.md b/Shared/Samples/Display alternate symbols at different scales/README.md new file mode 100644 index 00000000..f577622b --- /dev/null +++ b/Shared/Samples/Display alternate symbols at different scales/README.md @@ -0,0 +1,46 @@ +# Display alternate symbols at different scales + +Apply a unique value with alternate symbols at different scales. + +![Display alternate symbols at different scales sample](display-alternate-symbols-at-different-scales.gif) + +## Use case + +When a layer is symbolized with unique value symbology, you can specify the visible scale range for each unique value. This is an effective strategy to limit the amount of detailed data at smaller scales without having to make multiple versions of the layer, each with a unique definition query. + +Once scale ranges are applied to unique values, you can further refine the appearance of features within those scale ranges by establishing alternate symbols to different parts of the symbol class scale range. + +## How to use the sample + +Zoom in and out of the map to see alternate symbols at each scale. The symbology changes according to the following scale ranges: 0-5,000, 5,000-10,000, 10,000-20,000. To go back to the initial viewpoint, tap "Reset Viewpoint". + +## How it works + +1. Create a `FeatureLayer` using the service URL and add it to the map's list of operational layers. +2. Create two alternate symbols (a blue square and a yellow diamond) to be used as alternate symbols. To create an alternate symbol: + 1. Create a symbol using `SimpleMarkerSymbol`. + 2. Convert the simple marker symbol to an `MultilayerSymbol` using `SimpleMarkerSymbol.toMultilayerSymbol()`. + 3. Set the multilayer symbol's `referenceProperties` to the valid scale ranges with the blue square and yellow diamond. +3. Create a third multilayer symbol to be used to create a `UniqueValue` class. +4. Create a unique value using the red triangle from step 3 and the list of alternate symbols from step 2. +5. Create a `UniqueValueRenderer` and add the unique value from step 4 to it. +6. Create a purple diamond simple marker and convert it to a multilayer symbol to be used as the default symbol. +7. Set the unique value renderer's `defaultSymbol` property to the purple diamond from step 6. +8. Set the unique value renderer's `fieldNames` property to "req_type". +9. Apply this unique value renderer to the renderer on feature layer. + +## Relevant API + +* MultilayerSymbol +* SimpleMarkerSymbol +* SymbolReferenceProperties +* UniqueValue +* UniqueValueRenderer + +## About the data + +The [San Francisco 311 incidents layer](https://sampleserver6.arcgisonline.com/arcgis/rest/services/SF311/FeatureServer/0) in this sample displays point features related to crime incidents such as graffiti and tree damage that have been reported by city residents. + +## Tags + +alternate symbols, multilayer symbol, scale based rendering, simple marker symbol, symbol reference properties, symbology, unique value, unique value renderer diff --git a/Shared/Samples/Display alternate symbols at different scales/README.metadata.json b/Shared/Samples/Display alternate symbols at different scales/README.metadata.json new file mode 100644 index 00000000..0fc0c97d --- /dev/null +++ b/Shared/Samples/Display alternate symbols at different scales/README.metadata.json @@ -0,0 +1,35 @@ +{ + "category": "Visualization", + "description": "Apply a unique value with alternate symbols at different scales.", + "ignore": false, + "images": [ + "display-alternate-symbols-at-different-scales.gif" + ], + "keywords": [ + "alternate symbols", + "multilayer symbol", + "scale based rendering", + "simple marker symbol", + "symbol reference properties", + "symbology", + "unique value", + "unique value renderer", + "MultilayerSymbol", + "SimpleMarkerSymbol", + "SymbolReferenceProperties", + "UniqueValue", + "UniqueValueRenderer" + ], + "redirect_from": [], + "relevant_apis": [ + "MultilayerSymbol", + "SimpleMarkerSymbol", + "SymbolReferenceProperties", + "UniqueValue", + "UniqueValueRenderer" + ], + "snippets": [ + "DisplayAlternateSymbolsAtDifferentScalesView.swift" + ], + "title": "Display alternate symbols at different scales" +} diff --git a/Shared/Samples/Display alternate symbols at different scales/display-alternate-symbols-at-different-scales.gif b/Shared/Samples/Display alternate symbols at different scales/display-alternate-symbols-at-different-scales.gif new file mode 100644 index 00000000..2e63c35d Binary files /dev/null and b/Shared/Samples/Display alternate symbols at different scales/display-alternate-symbols-at-different-scales.gif differ diff --git a/Shared/Samples/Snap geometry edits/README.md b/Shared/Samples/Snap geometry edits/README.md index b3f166bf..d2749df3 100644 --- a/Shared/Samples/Snap geometry edits/README.md +++ b/Shared/Samples/Snap geometry edits/README.md @@ -25,7 +25,7 @@ To more clearly see how the vertex is snapped, long press to invoke the magnifie 3. Create a `GeometryEditor` and connect it to the map view. 4. Call `syncSourceSettings()` after the map's operational layers are loaded and the geometry editor is connected to the map view. 5. Set `SnapSettings.isEnabled` and each `SnapSourceSettings.isEnabled` to `true` for the `SnapSource` of interest. -6. Toggle geometry guides using `SnapSettings.isGeometryGuidesEnabled` and feature snapping using `SnapSettings.isFeatureSnappingEnabled`. +6. Toggle geometry guides using `SnapSettings.snapsToGeometryGuides` and feature snapping using `SnapSettings.snapsToFeatures`. 7. Start the geometry editor with a `GeometryType`. ## Relevant API diff --git a/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.GeometryEditorModel.swift b/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.GeometryEditorModel.swift index 51e2049f..665d4c73 100644 --- a/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.GeometryEditorModel.swift +++ b/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.GeometryEditorModel.swift @@ -23,7 +23,7 @@ extension SnapGeometryEditsView { let geometryEditor: GeometryEditor = { let geometryEditor = GeometryEditor() geometryEditor.snapSettings.isEnabled = true - geometryEditor.snapSettings.isGeometryGuidesEnabled = true + geometryEditor.snapSettings.snapsToGeometryGuides = true return geometryEditor }() diff --git a/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.SnapSettingsView.swift b/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.SnapSettingsView.swift index 6cb9b8d9..01de347f 100644 --- a/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.SnapSettingsView.swift +++ b/Shared/Samples/Snap geometry edits/SnapGeometryEditsView.SnapSettingsView.swift @@ -27,11 +27,11 @@ extension SnapGeometryEditsView { /// for the geometry editor. @State private var snappingEnabled = false - /// A Boolean value indicating whether snapping to geometry guides is enabled. - @State private var geometryGuidesEnabled = false + /// A Boolean value indicating whether the geometry editor snaps to geometry guides. + @State private var snapsToGeometryGuides = false - /// A Boolean value indicating whether snapping to features and graphics is enabled. - @State private var featureSnappingEnabled = false + /// A Boolean value indicating whether the geometry editor snaps to features and graphics. + @State private var snapsToFeatures = false /// An array of snap source names and their source settings. @State private var snapSources: [(name: String, sourceSettings: SnapSourceSettings)] = [] @@ -47,15 +47,15 @@ extension SnapGeometryEditsView { model.geometryEditor.snapSettings.isEnabled = newValue } - Toggle("Geometry Guides", isOn: $geometryGuidesEnabled) - .onChange(of: geometryGuidesEnabled) { newValue in - model.geometryEditor.snapSettings.isGeometryGuidesEnabled = newValue + Toggle("Geometry Guides", isOn: $snapsToGeometryGuides) + .onChange(of: snapsToGeometryGuides) { newValue in + model.geometryEditor.snapSettings.snapsToGeometryGuides = newValue } .disabled(!snappingEnabled) - Toggle("Feature Snapping", isOn: $featureSnappingEnabled) - .onChange(of: featureSnappingEnabled) { newValue in - model.geometryEditor.snapSettings.isFeatureSnappingEnabled = newValue + Toggle("Feature Snapping", isOn: $snapsToFeatures) + .onChange(of: snapsToFeatures) { newValue in + model.geometryEditor.snapSettings.snapsToFeatures = newValue } .disabled(!snappingEnabled) } @@ -68,7 +68,7 @@ extension SnapGeometryEditsView { } } } - .disabled(!snappingEnabled || !featureSnappingEnabled) + .disabled(!snappingEnabled || !snapsToFeatures) } .navigationTitle("Snap Settings") .navigationBarTitleDisplayMode(.inline) @@ -81,8 +81,8 @@ extension SnapGeometryEditsView { } .onAppear { snappingEnabled = model.geometryEditor.snapSettings.isEnabled - geometryGuidesEnabled = model.geometryEditor.snapSettings.isGeometryGuidesEnabled - featureSnappingEnabled = model.geometryEditor.snapSettings.isFeatureSnappingEnabled + snapsToGeometryGuides = model.geometryEditor.snapSettings.snapsToGeometryGuides + snapsToFeatures = model.geometryEditor.snapSettings.snapsToFeatures // Creates an array from snap source layers or graphics overlays // with their name and source settings.