Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Here is my workflow for creating tiles and linking them to a layer.

1) load shapefile
2) grab layer representing shapefile
3) init & execute mapcruncher
4) turn on dynamic display
5) create dynamiccachelayermanager and init with my layer
6) save layer as layerfile

I've managed to successfully modify this sample: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000mm8000000

It creates my png files and a file called conf.xml. In conf.xml it has the following data:

<LODInfo xsi:type="typens:LODInfo">
<LevelID>1</LevelID> 
<Scale>485413.57628360949</Scale> 
<Resolution>0.0011550226764674709</Resolution> 
</LODInfo>

I thought if I set my mapScale to 485413.57628360949 then it would grab my generated tiles instead of regenerating them, but no luck, it still wants to regenerate them. I think its just a mapscale issue, do you know how to get the mapscale of the generated tiles so I can put it set it via the IMapControl.mapScale interface?


Here's what happened next:

1) I used mapcruncher to generate tiles, it also generated a conf.xml
2) I open conf.xml to get the mapscales
3) I hard coded those mapscales in as my zoom levels
4) Dynamically generate the tiles at my hard coded zoom level
5) compare the mapcruncher generated tiles to the tiles which are dynamically created

The MapCruncher files start at Level 0 - 8, and the images are numbered in an orderly fashion.

C0000000.png C0000001.png... etc.

But the dynamically generated pngs are in the following format

C0000003d.png even if only 1 png represents the whole map. One would expect C00000000.png here....

I am truely lost here.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I found another angle to solve my problem, but it doesn't use the MapCruncher sample. As far as I can tell MapCruncher is gigantic untested waste of time and it's my belief that it cannot be made to work. After analyzing the code there are not enough public variables for me to manipulate to give me a hope of solving the problem. But enough with that. Here's the workaround:

Basically you have a list of doubles which hold your desired mapscales.

for (int i = 0; i < this.mapScales.Count; i++)
{

  dynamicCacheLayerManager.Update(layer.AreaOfInterest, this.mapScales[i] - 1000, this.mapScales[i], esriMapCacheUpdateMode.esriMapCacheUpdateRecreateAll);
}

This sample starts quite a few threads and takes a while, so be patient.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.