TPK with updated extent not displaying correctly

581
3
06-30-2013 10:55 PM
Labels (1)
MatthewBrown1
Occasional Contributor
Hi,

I have updated the imagery used in a TPK (using clip raster) and generated a new TPK. The extents of the TPK in the Runtime app have not updated, even though the imagery has. The old extents are still being used in the Runtime while the TPK opens in ArcMap with the correct extents for the cache tiles.

I'm using a tile scheme from an XML using WKID 2193 for all TPKs but this is the only one I'm having an issue with.

I've cleared a few of the obvious temp directories and renamed the TPK, but nothing has worked. Any ideas?

Thanks,

Matt
0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor
Hi Matt,

TPKs are read directly and are not cached anywhere on disk. Did you use the same MXD for both packages? - and if so did you update the full extent?

Cheers

Mike
0 Kudos
MatthewBrown1
Occasional Contributor
Hi Mike,

I used the same MXD and updated the extent to match the new image, but this did not change the extent of the TPK in the Runtime. When opening the TPK in a new instance of ArcMap, the display is centred on the top level tile, but I'm not sure if ArcMap checks the extent of the data and updates the display accordingly.

I also recalculated the statistics and rebuilt the pyramids, in case the TPK was somehow picking up the old extents from this, but it didn't change the display in the Runtime.

However, your post made me realise I had not tried creating a TPK from a NEW MXD... This worked!!

I had a look in the extracted package folders created when viewing the TPK in ArcMap, checked the mapserver.json file and noticed that the initial extent and full extent were different for the TPK I was having problems with. The initial extent is correct for the updated imagery, but the full extent matches the old imagery. So it seems that the Runtime was looking at the full extent when displaying the TPK.

I'm still not sure what caused this difference, but now I will make sure I start with a new MXD for TPKs.

Thanks,

Matt
0 Kudos
MatthewBrown1
Occasional Contributor
Mike,

Perhaps this should be a new thread, but this issue has made me wonder what the relationship between initial and full extent is. It seems that the default behaviour in the Runtime is to use the full extent (at least for TPKs and map services, not sure about feature services). Is there some documentation on this?

It would be great if there was an expanded code sample to read in the two extents from the service/map control and change the extent from full to initial on load.

http://resources.arcgis.com/en/help/runtime-wpf/concepts/index.html#/Navigating_the_map/01700000008m... hints at it.

If I use something like:
map.ZoomTo(TiledLayer.InitialExtent);


The value is null. But I might be calling it too soon.

UPDATE: Yes, of course I was....

 TiledLayer.Initialized += (s1, e1) =>
{
        map.ZoomTo(TiledLayer.InitialExtent);
};


Thanks,

Matt
0 Kudos