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.

I used ArcGIS javascript API 3.0 version and I use Bing map. I need to be able to zoom to 22., 23., 24., .. levels. So I was added an addNumLevels function to Map;

 esri.Map.prototype.addNumLevels =function(num){

    for(var i = 0; i < num; i++ ){
        var ln = this.__tileInfo.lods.length;
        this.__tileInfo.lods[ln] = {};
        this.__tileInfo.lods[ln].level = ln;
        this.__tileInfo.lods[ln].resolution = this.__tileInfo.lods[ln-1].resolution / 2;
        this.__tileInfo.lods[ln].startTileRow = this.__tileInfo.lods[ln-1].startTileRow;
        this.__tileInfo.lods[ln].startTileCol = this.__tileInfo.lods[ln-1].startTileCol;
        this.__tileInfo.lods[ln].endTileRow = this.__tileInfo.lods[ln-1].endTileRow * 2;
        this.__tileInfo.lods[ln].endTileCol = this.__tileInfo.lods[ln-1].endTileCol * 2;
    }
}

But I when I upgraded the ArcGIS js api to version 3.2, my addNumLevels function stopped working. Can anybody help me?

Thanks.

share|improve this question
add comment

2 Answers 2

up vote 0 down vote accepted

I solved my problem for ArcGIS javascript API 3.3 version with this function;

esri.Map.prototype.addNumLevels = function(num) {
    for(var i = 0; i < num; i++ ) {
        var ln = this.__tileInfo.lods.length;
        var newLod = new esri.layers.LOD();
        newLod.level = ln;
        newLod.resolution = this.__tileInfo.lods[ln-1].resolution / 2;
        newLod.startTileRow = this.__tileInfo.lods[ln-1].startTileRow * 2;
        newLod.startTileCol = this.__tileInfo.lods[ln-1].startTileCol * 2;
        newLod.endTileRow = this.__tileInfo.lods[ln-1].endTileRow * 2;
        newLod.endTileCol = this.__tileInfo.lods[ln-1].endTileCol * 2;
        /* this control for ex apis*/
        if(this.__tileInfo.lods[ln-1]._frameInfo) {
            newLod._frameInfo = new Array();
            newLod._frameInfo[0] = this.__tileInfo.lods[ln-1]._frameInfo[0] * 2;
            newLod._frameInfo[1] = this.__tileInfo.lods[ln-1]._frameInfo[1] * 2;
            newLod._frameInfo[2] = this.__tileInfo.lods[ln-1]._frameInfo[2] * 2;
            newLod._frameInfo[3] = this.__tileInfo.lods[ln-1]._frameInfo[3] * 2;
        }
        this.__tileInfo.lods[ln] = newLod;
    }
    /* They are new map params and we must set them*/
    this._params.lods = this.__tileInfo.lods;
    this._params.maxScale = this.__tileInfo.lods[this.__tileInfo.lods.length - 1].scale;
    this._params.maxZoom = this.__tileInfo.lods.length - 1;
};

Hope this helps. Thanks.

share|improve this answer
add comment

I haven't used this but would you not do this through the use of LOD (Level of Detail) on the map options parameter? Sample here

share|improve this answer
    
Thanks but this sample a visibility control between ArcGISTiledMapServiceLayer's levels. I can't zoom to level 20 or level 21. I have to go out of ArcGISTiledMapServiceLayer's levels, because i have another map layer that is a ArcGISDynamicMapServiceLayer and i have to zoom to map about 100 scale. –  hopelephant Nov 30 '12 at 9:55
add comment

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.