Adding tile layer from tile package not showing in map.

425
2
Jump to solution
01-31-2023 09:42 AM
DuanePfeiffer
New Contributor III

Using 100.x codebase as an example, I'm trying to add imagery to my map but am not seeing the layer show up.  Source of imagery is a .tpkx,  My map is loaded from a .mmpk

EDIT: Added layer.load()... still don't see on map.

    func ToggleImagery() async {

        do {

            if showImagery == true {

                let sourceURL = TPUDFacilityInspectorApp.documentsURL.appendingPathComponent(K.imageryTilePackageName)

                print(sourceURL)

                if FileManager.default.fileExists(atPath: sourceURL.path(percentEncoded: true)) {

                    appData.imageryLayer = ArcGISTiledLayer(url: sourceURL)

                    try await appData.imageryLayer.load()

                    appData.map.insertOperationalLayer(appData.imageryLayer, at:0)

                }

            } else {

                if appData.imageryLayer != nil {

                    appData.map.removeOperationalLayer(appData.imageryLayer)

                    appData.imageryLayer = nil

                }

            }

        } catch {

            ShowAlert(message: "\(error)")

        }

    }

0 Kudos
1 Solution

Accepted Solutions
DuanePfeiffer
New Contributor III

One of our GIS guys figured it out for me.  The imagery was projected in a different system than the mobile map package.

View solution in original post

2 Replies
DuanePfeiffer
New Contributor III

One of our GIS guys figured it out for me.  The imagery was projected in a different system than the mobile map package.

dfeinzimer
New Contributor

Hi Duane, happy to that you've found a solution.

0 Kudos