Click here to enter one of the following marquee zoom modes: PromptThe map is zoomed after you finish drawing the rectangle and click on the rectangle. The rectangle disappears and the map is not zoomed if you click on any other part of the map. The marquee zoom tool remains active until you stop it.Continuous The map is zoomed as soon as you finish drawing the rectangle. The marquee zoom tool remains active until you stop it.One time The map is zoomed as soon as you finish drawing the rectangle. Marquee zoom tool becomes inactive aftwards. Click here to enter marquee zoom mode with custom rectangle style |
And here is how the marqueeZoom mode is controlled.var mapview = null; var mode = "prompt" ; function showMap() { var baseURL = "http://"+document.location.host+"/mapviewer"; var mapCenterLon = -122.45; var mapCenterLat = 37.6706; var mapZoom = 4; var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,8307); mapview = new MVMapView(document.getElementById("map"), baseURL); mapview.addMapTileLayer(new MVMapTileLayer("mvdemo.demo_map")); mapview.setCenter(mpoint); mapview.setZoomLevel(mapZoom); mapview.addNavigationPanel("WEST"); mapview.display(); document.getElementById("promptbutton").checked = true ; } function marqueeZoom() { mapview.stopMarqueeZoom(); mapview.startMarqueeZoom(mode, new Object()); } function noMarqueeZoom() { mapview.stopMarqueeZoom(); } function setMode(button) { mode = button.value ; mapview.startMarqueeZoom(mode); } function marqueeZoomCustomStyle() { var rectStyle = new Object() ; rectStyle.borderColor = "#0000FF" ; rectStyle.borderWidth = 2 ; rectStyle.borderDashed = false ; rectStyle.fillColor = "#FF0000" ; rectStyle.fillOpacity = 0.5 ; mapview.stopMarqueeZoom(); mapview.startMarqueeZoom(mode, rectStyle); }
<a href="javascript:marqueeZoom()">Click here to enter one of the following marquee zoom modes:</a> <a href="javascript:noMarqueeZoom()">Click here to exit marquee zoom mode</a>