How do I load Raster Mapcache data to my ArcGIS 10.2. SDK for Window Mobile application?

1246
1
Jump to solution
02-05-2016 01:00 PM
New Contributor III

I created the vector and raster mapcache data using the "Create Mobile Cache" tool of the "Mobile Tools" within ArcCatalog.

This application is created with ArcGIS 10.2.2 SDK for Windows Mobile.

I don’t have any problems loading the Vector mapcache data which are recognized as map layers.

But I’m having problems loading the Raster mapcache data which seem not to be map layer based.

'

' --- Load the Raster MapCache  -  Not Working

'

RasterMapCache.StoragePath = Trim(m_OrthoLocalStoragePath)

If RasterMapCache.CacheExists Then

   '

   ' --- Open the Raster MapCache

   '

   RasterMapCache.Open()

   '

   ' --- Add Raster MapCache to Map as (Map Layers)  -  ???

   '

   Me.Map1.MapLayers.Add(RasterMapCache)  'Not Working - Crashing at this statement  

   '

End If

'

' --- Load the Vector MapCache  -  Working Fine

'

VectorMapCache.StoragePath = Trim(m_MapCacheLocalStoragePath)

If VectorMapCache.CacheExists Then

   '

   ' --- Open the Vector MapCache

   '

   VectorMapCache.Open()

   '

   ' --- Add Vector MapCache to Map as Map Layers

   '

   Me.Map1.MapLayers.Add(VectorMapCache)

   '

End If

Reply
0 Kudos
1 Solution

Accepted Solutions
New Contributor III

To answer my own question.

Because our raster data is Tiled in ArcGIS 10.2.2 I had to modify my code.

'

' --- Tiled Mapcache Data

'

Try

'

' --- Assign path of Tile Cache location to string path object

'

 Dim TCMapLayer As TileCacheMapLayer = New TileCacheMapLayer(m_OrthoLocalStoragePath + "\Layers")

'

' --- Assign name of Tile Cache Maplayer and make it visible

'

TCMapLayer.Name = "2015 Orthos"

TCMapLayer.Visible = True

'

' --- Open the Tile Cache Maplayer

'

TCMapLayer.Open()

'

' --- Add the Tile Cache Maplayer to the map

'

Map1.MapLayers.Add(TCMapLayer)

'

Catch ex As Exception

MessageBox.Show("Cannot open map cache" & vbCr & vbCr & _

"Error Message: " & ex.ToString)

End Try

View solution in original post

Reply
0 Kudos
1 Reply
New Contributor III

To answer my own question.

Because our raster data is Tiled in ArcGIS 10.2.2 I had to modify my code.

'

' --- Tiled Mapcache Data

'

Try

'

' --- Assign path of Tile Cache location to string path object

'

 Dim TCMapLayer As TileCacheMapLayer = New TileCacheMapLayer(m_OrthoLocalStoragePath + "\Layers")

'

' --- Assign name of Tile Cache Maplayer and make it visible

'

TCMapLayer.Name = "2015 Orthos"

TCMapLayer.Visible = True

'

' --- Open the Tile Cache Maplayer

'

TCMapLayer.Open()

'

' --- Add the Tile Cache Maplayer to the map

'

Map1.MapLayers.Add(TCMapLayer)

'

Catch ex As Exception

MessageBox.Show("Cannot open map cache" & vbCr & vbCr & _

"Error Message: " & ex.ToString)

End Try

View solution in original post

Reply
0 Kudos