Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New] Download vector tiles to local cache #25

Merged
merged 38 commits into from
Aug 12, 2022

Conversation

clee088
Copy link
Contributor

@clee088 clee088 commented Jun 17, 2022

Description

This PR implements Download vector tiles to local cache in Layers category.
URL to README: URL

Linked Issue(s)

  • common-samples/issues/3587

How To Test

  1. Tap on "Download Vector Tiles"
  2. Wait for the results to download and present a new map view.
  3. Rotate the device to see if it crashes

To Discuss

EDIT: No longer an issue. Sample crashes when rotating device in the results sheet Looks like it traces back to the map's basemap.
error occurred: code: 24
error message: Object is already owned.
error additional message: Already owned.
ArcGIS/Basemap+Generated.swift:199: Fatal error: Unexpectedly found nil while unwrapping an Optional value
2022-06-17 11:42:42.039463-0400 Samples[17109:12324466] ArcGIS/Basemap+Generated.swift:199: Fatal error: Unexpectedly found nil while unwrapping an Optional value

Results sheet viewpoint

When the results sheet is presented, the viewpoint doesn't seem to be set to the extent or I am unable to make it show the center of the exported tiles.

Area of interest set by geometry
I'm not sure if this is the best way to set the area of interest/extent. The iOS samples app just has a fixed UIView and then converts the view to an envelope.

@clee088 clee088 self-assigned this Jun 20, 2022
@clee088 clee088 requested a review from yo1995 June 22, 2022 19:03
@clee088 clee088 marked this pull request as ready for review July 4, 2022 16:18
Copy link
Collaborator

@yo1995 yo1995 left a comment

Choose a reason for hiding this comment

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

I realized that I didn't submit previous comments... will add more soon.

1. Create an `ExportVectorTilesTask` object, passing in the `PortalItem` for the vector tiled layer. Since vector tiled layers are premium content, you must first authenticate with the Portal.
2. Create parameters for the export by using the task's method, `ExportVectorTilesTask.createDefaultExportVectorTilesParameters(areaOfInterest:maxScale:)`, specifying the area of interest and max scale.
3. Create an `ExportVectorTileJob` by using the task's method, `ExportVectorTilesTask.exportVectorTiles(parameters:vectorTileCacheURL:itemResourceCacheURL:)`, passing in the parameters and specifying a vector tile cache path and an item resource path. The resource path is required if you want to export the tiles with the style.
4. Start the job, then await the job's results.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I feel like the sentence can be rephrased, but will leave it to other reviewers.

Copy link
Collaborator

@yo1995 yo1995 left a comment

Choose a reason for hiding this comment

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

Looking good. We can wait for the replies from #31 before proceeding with the review on this PR.

yo1995
yo1995 previously approved these changes Aug 4, 2022
@yo1995 yo1995 requested a review from mhdostal August 4, 2022 19:15
yo1995
yo1995 previously approved these changes Aug 8, 2022
yo1995
yo1995 previously approved these changes Aug 8, 2022
@yo1995 yo1995 requested review from dfeinzimer and removed request for mhdostal August 10, 2022 20:36
Copy link
Contributor

@dfeinzimer dfeinzimer left a comment

Choose a reason for hiding this comment

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

I'm getting a build error in DisplayFeatureLayersView.swift at line 68. Please merge in latest from v.next if possible.

clee088 and others added 2 commits August 11, 2022 11:37
Co-authored-by: David Feinzimer <dfeinzimer@gmail.com>
Co-authored-by: David Feinzimer <dfeinzimer@gmail.com>
yo1995
yo1995 previously approved these changes Aug 11, 2022
@yo1995 yo1995 requested a review from dfeinzimer August 12, 2022 07:28
@clee088 clee088 merged commit 1919c54 into v.next Aug 12, 2022
@clee088 clee088 deleted the clee/New-DownloadVectorTilesToLocalCache branch August 12, 2022 16:42
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.

None yet

3 participants