javascript - Setting predefined zoom levels -
i wondering how set predefined zoom levels in arc gis map. ultimate goal if user zooms out past level 5 turn off labels. other wise every thing under level 4 show labels. i've set zoom level 7 , initial load works correctly. when log zoom level console -1 , description of no predefined zoom levels. i'm missing here what, wouldnt log show zoom level of 7 since defined map?
function init() { esri.config.defaults.io.proxyurl = webroot + "proxy.ashx "; map = new esri.map("mapdiv", { basemap: "gray", sliderstyle: "large", center: [-95.625, 39.243], nav: false, logo: false, zoom: 7 });//end base map //create feature layer fl = new esri.layers.featurelayer(app.regionmap, { mode: esri.layers.featurelayer.mode_snapshot, outfields: ["fips"], opacity: 0.3, visibile: true });//ends feature layer //add feature layer map map.addlayer(fl);
you need set lods, or level of detail. array provided in options when initialise map, shown in documentation.
you can pull lods tiled map layer load, in this sample, or define them yourself, eg:
_lods : [ {"level" : 0, "resolution" : 156543.033928, "scale" : 591657527.591555}, {"level" : 1, "resolution" : 78271.5169639999, "scale" : 295828763.795777}, {"level" : 2, "resolution" : 39135.7584820001, "scale" : 147914381.897889}, //...etc ]
Comments
Post a Comment