Skip to content

[New] Sample: Download raster tiles to local cache#792

Open
chriswebb09 wants to merge 28 commits into
v.nextfrom
chrisw/download-raster-tile
Open

[New] Sample: Download raster tiles to local cache#792
chriswebb09 wants to merge 28 commits into
v.nextfrom
chrisw/download-raster-tile

Conversation

@chriswebb09

@chriswebb09 chriswebb09 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR implements Download raster tiles to local cache in Edit and Manage Data category.
URL to README:

Here

Linked Issue(s)

  • swift/issues/6910

Screenshot

download-raster-tiles-to-local-cache

@chriswebb09 chriswebb09 changed the title initial commit for sample [New] Sample: Download raster tiles to local cache Jun 25, 2026
@chriswebb09 chriswebb09 self-assigned this Jun 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Edit and Manage Data sample that demonstrates exporting raster tiles from a tiled map service into a local tile cache on-device, then previewing the downloaded cache in a separate map.

Changes:

  • Added a new SwiftUI sample view that runs an ExportTileCacheTask and previews the resulting TileCache.
  • Added sample documentation (README.md) and catalog metadata (README.metadata.json).
  • Registered the new sample source file/group in the Xcode project.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 6 comments.

File Description
Shared/Samples/Download raster tiles to local cache/README.metadata.json Adds sample catalog metadata (category, keywords, APIs, snippet reference).
Shared/Samples/Download raster tiles to local cache/README.md Adds end-user documentation for the new sample.
Shared/Samples/Download raster tiles to local cache/DownloadRasterTilesToLocalCacheView.swift Implements the tile export workflow + progress UI + preview sheet.
Samples.xcodeproj/project.pbxproj Adds the new sample file to the project/groups and build phases.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
Comment thread Samples.xcodeproj/project.pbxproj
Comment thread Samples.xcodeproj/project.pbxproj
chriswebb09 and others added 4 commits June 26, 2026 11:06
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@chriswebb09 chriswebb09 marked this pull request as ready for review June 26, 2026 18:14
@chriswebb09 chriswebb09 requested review from a team, philium and rolson and removed request for a team June 26, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.

Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
chriswebb09 and others added 2 commits June 26, 2026 13:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rolson rolson requested review from yo1995 and removed request for rolson June 26, 2026 20:07
@chriswebb09 chriswebb09 requested a review from Copilot June 26, 2026 20:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
Comment thread Shared/Samples/Download raster tiles to local cache/README.md Outdated
@chriswebb09 chriswebb09 requested a review from yo1995 June 26, 2026 22:51
chriswebb09 and others added 6 commits June 29, 2026 19:05
@chriswebb09 chriswebb09 requested a review from CalebRas June 30, 2026 20:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use license keys to grab the screenshot to remove watermark.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The screenshot still needs to be updated

@chriswebb09 chriswebb09 requested a review from yo1995 June 30, 2026 23:00

@yo1995 yo1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I build the project, I see lots of dangling swiftlint warnings. Do you see them as well?

Image

@State private var extentRect = CGRect.zero

var body: some View {
GeometryReader { _ in

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This GeometryReader can be removed now that you are using an onGeometryChange modifier.

/// Creates the export tile cache parameters.
/// - Parameter areaOfInterest: The area of interest to create the parameters for.
/// - Returns: An `ExportTileCacheParameters` if there are no errors.
private func makeExportTileCacheParameters(areaOfInterest: Envelope) async throws -> ExportTileCacheParameters {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private func makeExportTileCacheParameters(areaOfInterest: Envelope) async throws -> ExportTileCacheParameters {
private func makeExportTileCacheParameters(
areaOfInterest: Envelope
) async throws -> ExportTileCacheParameters {

This line is pretty long; consider breaking it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants