Select to view content in your preferred language

Create Map Cache manual

476
0
03-12-2013 01:06 AM
KevinGebhardt
Deactivated User
Hello,
I'm trying to generate Map Caches from MapServices.
The reason is, i need to generate caches for given extents automatically.
Here is my approach with ArcObjects for .NET:

IMapDocument mapDocument = new MapDocument();
                            mapDocument.Open("d:/arcgisdata/Sachsen/webline_sachsen_stamm_ALK_Nutzung.mxd");
                            IMap map = mapDocument.get_Map(0);
                            IMapCooker mapCooker = new MapCooker();

                            // Giving the MapCooker the Extent of a Feature
                            mapCooker.Extent = feature.Extent;
                            ILayer layer = map.get_Layer(0);
                            // ILayer and Map are not NULL
                            // Where do I get my IDisplay-Object from?
                            ESRI.ArcGIS.Display.IDisplay display = new ESRI.ArcGIS.ArcMapUI.AppDisplay();
                           
                            // Need I to add the Layer to the MapCooker?
                            mapCooker.AddLayer(layer.Name, layer);
                           
                            if (map != null && layer != null)
                            {
                                    mapCooker.Generate(map, layer, display, cancel);
                            }
                            else
                            {
                                Logger.Log("w", "Map und/oder Layer sind NULL. Cache konnte nicht erstellt werden.");
                            }
After calling mapCooker.Generate() i get the following error:
Exception HRESULT: 0x000000A. The data necessary to complete this operation is not yet available.

Has anyone an idea?

Thanks in advance.
0 Kudos
0 Replies