dojo.connect(map, 'onLoad', function(theMap) { // resize the map when the browser resizes dojo.connect(dijit.byId('map'), 'resize', map,map.resize); // add the overview map overviewMapDijit = new esri.dijit.OverviewMap({ NLS_drag: "flyt til at broyta kort ekstentið", NLS_hide: "Goym yvirlitskortið", NLS_show: "Vís yvirlitskortið", map:map, visible: false, opacity: .25, attachTo:"top-right", color:"#FF0000", expandFactor: 4 // kortið zoomar í mesta lagið 4 ferðir størri enn overview kortið vísur. }); overviewMapDijit.startup(); var scalebar = new esri.dijit.Scalebar({ map: map, scalebarUnit:'metric' }); }); dojo.connect(map, "onZoomEnd", function(evt) { if (map.extent.xmax - map.extent.xmin < 150000) { overviewMapDijit.visible = true; overviewMapDijit.startup(); } if (map.extent.xmax - map.extent.xmin > 150000) { overviewMapDijit.visible = false; overviewMapDijit.startup(); } });
Solved! Go to Solution.