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.

This question relates to ESRI JSAPI and Google Maps V3 integration...

I've put together this fiddle http://jsfiddle.net/br4pk/1/ which demonstrates a mismatch between the LOD of the map and gmaps.GoogleMapsLayer instance. The map operates great until you introduce layers which specify an lod[0] with a level:0. I believe this is because the gmaps layer lod[0] looks like this:

{
    "level": 1, 
    "resolution": 78271.5169639999, 
    "scale": 295828763.795777
}

and the map lod[0] like this:

{
    "level": 0, 
    "resolution": 78271.5169639999, 
    "scale": 295828763.795777
}

Should the map lod contain a level:0 when the basemap does not specify a level:0 lod?
What is the solution to getting this to work with other layers which do specify a level:0?

I did find some success in modifying the lods of the gmap by adding a level 0 detail, and perhaps that is the answer (to modify http://gmaps-utility-gis.googlecode.com/svn/tags/gmapslayer/1.0/src/gmapslayer.js):

    { "level": 0, "resolution": 156543.033928, "scale": 591657527.591555 },
    { "level": 1, "resolution": 78271.5169639999, "scale": 295828763.795777 },
    { "level": 2, "resolution": 39135.7584820001, "scale": 147914381.897889 },
    { "level": 3, "resolution": 19567.8792409999, "scale": 73957190.948944 },
    { "level": 4, "resolution": 9783.93962049996, "scale": 36978595.474472 },
    { "level": 5, "resolution": 4891.96981024998, "scale": 18489297.737236 },
    { "level": 6, "resolution": 2445.98490512499, "scale": 9244648.868618 },
    { "level": 7, "resolution": 1222.99245256249, "scale": 4622324.434309 },
    { "level": 8, "resolution": 611.49622628138, "scale": 2311162.217155 },
    { "level": 9, "resolution": 305.748113140558, "scale": 1155581.108577 },
    { "level": 10, "resolution": 152.874056570411, "scale": 577790.554289 },
    { "level": 11, "resolution": 76.4370282850732, "scale": 288895.277144 },
    { "level": 12, "resolution": 38.2185141425366, "scale": 144447.638572 },
    { "level": 13, "resolution": 19.1092570712683, "scale": 72223.819286 },
    { "level": 14, "resolution": 9.55462853563415, "scale": 36111.909643 },
    { "level": 15, "resolution": 4.77731426794937, "scale": 18055.954822 },
    { "level": 16, "resolution": 2.38865713397468, "scale": 9027.977411 },
    { "level": 17, "resolution": 1.19432856685505, "scale": 4513.988705 },
    { "level": 18, "resolution": 0.597164283559817, "scale": 2256.994353 },
    { "level": 19, "resolution": 0.298582141647617, "scale": 1128.497176 }
share|improve this question
    
Seems when a basemap is added to an ESRI map the level is automatically set to zero. The compressed function _639 contains logic which intentionally overwrites the level specified in the basemap. This also happens when setting LOD via map constructor: map = new esri.Map("map", { extent: initExtent, lods: [{ "level": 1, "resolution": 78271.5169639999, "scale": 295828763.795777 }] }); alert(dojo.toJson(map.__tileInfo.lods[0], true)); –  ca0v Feb 22 '12 at 16:58
    
Qn: Should the map lod contain a level:0 when the basemap does not specify a level:0 lod? Ans: Yes, apparently so since ESRI is explicitly overwriting the level. Qn: What is the solution to getting this to work with other layers which do specify a level:0? Ans: Explicitly set the lod on the map constructor and select a suitable extent. This will resolve the issue. With this change the google map can be properly overlayed by an ESRI tiles as shown on this fiddle jsfiddle.net/br4pk/3. –  ca0v Feb 22 '12 at 18:30

1 Answer 1

This can be done by using the latest version of agsjs and setting the lods on the map directly. You can see it in action here: http://jsfiddle.net/br4pk/4/

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.