<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Mouse Wheel Zooming in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654104#M2016</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I develop two zoom buttons for zoomIn and zoomOut , they are disabled in zoom level 18 and zoomlevel 0 respectively and on starting the application zoomOut button disabled . However at present i am trying to develop someting about&amp;nbsp; mouse Wheel zooming that reach zoom level 18 and disable ZoomIn Button and samething happen when mouse wheel zooming reached zoom level 0 ,&amp;nbsp; zoomOut button will be disable at that certain level and activated zoomIn button while mouse wheel zoom will be going down (ZoomOut action happening). i attach the code what i have done till now . it would be great have a idea or procedure&amp;nbsp; from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public void initialize(URL location, ResourceBundle resources) {&lt;BR /&gt; this.mapView = new MapView();&lt;BR /&gt; this.map = new IJMSMap(this.mapView);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; zoomOut.setDisable(true);&lt;/STRONG&gt;&lt;BR /&gt; Scalebar scaleBar = new Scalebar(mapView);&lt;BR /&gt; scaleBar.setSkinStyle(Scalebar.SkinStyle.GRADUATED_LINE);&lt;BR /&gt; scaleBar.setUnitSystem(UnitSystem.METRIC);&lt;BR /&gt; Color transparentWhite = new Color(1, 1, 1, 0.7);&lt;BR /&gt; scaleBar.setBackground(new Background(new BackgroundFill(transparentWhite, new CornerRadii(5), Insets.EMPTY)));&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;this.PanButtonContainerPane.getChildren().addAll(mapView,scaleBar);&lt;BR /&gt; this.PanButtonContainerPane.setAlignment(scaleBar, Pos.TOP_LEFT);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; this.movePanNorth.toFront();&lt;BR /&gt; this.movePanEast.toFront();&lt;BR /&gt; this.MovePanSouth.toFront();&lt;BR /&gt; this.movePanWest.toFront();&lt;BR /&gt; this.zoomBtnVbox.toFront();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#ActionEvent for ZoomIn function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomInAction(ActionEvent event) {&lt;BR /&gt; zoomOut.setDisable(false);&lt;BR /&gt; &lt;STRONG&gt;map.zoomInFunction();&lt;/STRONG&gt;&lt;BR /&gt; if (mapView.getMapScale() &amp;lt;= 2256.994353) {&lt;BR /&gt; zoomIn.setDisable(true);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#ActionEvent for ZoomOut function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomOutAction(ActionEvent event) {&lt;BR /&gt; zoomIn.setDisable(false);&lt;BR /&gt; &lt;STRONG&gt;map.zoomOutFunction();&lt;/STRONG&gt;&lt;BR /&gt; if (mapView.getMapScale() &amp;gt;= 7.3957190948944E7) {&lt;BR /&gt; zoomOut.setDisable(true);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Method for zoomIn function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomInFunction() {&lt;BR /&gt;Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);&lt;/P&gt;&lt;P&gt;Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0);&lt;BR /&gt; mapView.setViewpointAsync(zoomedIn);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Method for zoomOut function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomOutFunction()&lt;BR /&gt; {&lt;BR /&gt; Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);&lt;/P&gt;&lt;P&gt;Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0);&lt;BR /&gt; mapView.setViewpointAsync(zoomedIn);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Sep 2019 10:46:35 GMT</pubDate>
    <dc:creator>S_MMaruf</dc:creator>
    <dc:date>2019-09-16T10:46:35Z</dc:date>
    <item>
      <title>Mouse Wheel Zooming</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654104#M2016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I develop two zoom buttons for zoomIn and zoomOut , they are disabled in zoom level 18 and zoomlevel 0 respectively and on starting the application zoomOut button disabled . However at present i am trying to develop someting about&amp;nbsp; mouse Wheel zooming that reach zoom level 18 and disable ZoomIn Button and samething happen when mouse wheel zooming reached zoom level 0 ,&amp;nbsp; zoomOut button will be disable at that certain level and activated zoomIn button while mouse wheel zoom will be going down (ZoomOut action happening). i attach the code what i have done till now . it would be great have a idea or procedure&amp;nbsp; from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public void initialize(URL location, ResourceBundle resources) {&lt;BR /&gt; this.mapView = new MapView();&lt;BR /&gt; this.map = new IJMSMap(this.mapView);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; zoomOut.setDisable(true);&lt;/STRONG&gt;&lt;BR /&gt; Scalebar scaleBar = new Scalebar(mapView);&lt;BR /&gt; scaleBar.setSkinStyle(Scalebar.SkinStyle.GRADUATED_LINE);&lt;BR /&gt; scaleBar.setUnitSystem(UnitSystem.METRIC);&lt;BR /&gt; Color transparentWhite = new Color(1, 1, 1, 0.7);&lt;BR /&gt; scaleBar.setBackground(new Background(new BackgroundFill(transparentWhite, new CornerRadii(5), Insets.EMPTY)));&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;this.PanButtonContainerPane.getChildren().addAll(mapView,scaleBar);&lt;BR /&gt; this.PanButtonContainerPane.setAlignment(scaleBar, Pos.TOP_LEFT);&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; this.movePanNorth.toFront();&lt;BR /&gt; this.movePanEast.toFront();&lt;BR /&gt; this.MovePanSouth.toFront();&lt;BR /&gt; this.movePanWest.toFront();&lt;BR /&gt; this.zoomBtnVbox.toFront();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#ActionEvent for ZoomIn function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomInAction(ActionEvent event) {&lt;BR /&gt; zoomOut.setDisable(false);&lt;BR /&gt; &lt;STRONG&gt;map.zoomInFunction();&lt;/STRONG&gt;&lt;BR /&gt; if (mapView.getMapScale() &amp;lt;= 2256.994353) {&lt;BR /&gt; zoomIn.setDisable(true);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#ActionEvent for ZoomOut function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomOutAction(ActionEvent event) {&lt;BR /&gt; zoomIn.setDisable(false);&lt;BR /&gt; &lt;STRONG&gt;map.zoomOutFunction();&lt;/STRONG&gt;&lt;BR /&gt; if (mapView.getMapScale() &amp;gt;= 7.3957190948944E7) {&lt;BR /&gt; zoomOut.setDisable(true);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Method for zoomIn function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomInFunction() {&lt;BR /&gt;Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);&lt;/P&gt;&lt;P&gt;Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0);&lt;BR /&gt; mapView.setViewpointAsync(zoomedIn);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#Method for zoomOut function&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;public void zoomOutFunction()&lt;BR /&gt; {&lt;BR /&gt; Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE);&lt;/P&gt;&lt;P&gt;Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0);&lt;BR /&gt; mapView.setViewpointAsync(zoomedIn);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 10:46:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654104#M2016</guid>
      <dc:creator>S_MMaruf</dc:creator>
      <dc:date>2019-09-16T10:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Mouse Wheel Zooming</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654105#M2017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;I&amp;nbsp; create this logic for mouse scroll/wheel&amp;nbsp; zoom but when I am mouse_ scrolling both direction it works as a zoomIn&amp;nbsp; function . how can i set up opposite scrolling for zoomOut Function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;// zoomIn by using mouse wheel and zooIn Button disable at zoom level at 18 while using mouse wheel zoomIn&lt;/STRONG&gt;&lt;BR /&gt; mapView.setOnScroll(new EventHandler&amp;lt;ScrollEvent&amp;gt;() {&lt;BR /&gt; public void handle(ScrollEvent se) {&lt;BR /&gt; &lt;BR /&gt; zoomOut.setDisable(false);&lt;BR /&gt; map.zoomInFunction();&lt;BR /&gt; if (mapView.getMapScale() &amp;lt;= 2256.994353) {&lt;BR /&gt; zoomIn.setDisable(true);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; }});&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 15:47:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654105#M2017</guid>
      <dc:creator>S_MMaruf</dc:creator>
      <dc:date>2019-09-16T15:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: Mouse Wheel Zooming</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654106#M2018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess would be that since you are using&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;setViewpointAsync&amp;nbsp;the scale is not reached until some time after the call to zoomInFunction rather than on the next line of code where you call getMapScale. Maybe try using setViewPoint which so not async to see if that helps.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Sep 2019 17:02:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/mouse-wheel-zooming/m-p/654106#M2018</guid>
      <dc:creator>ColinAnderson1</dc:creator>
      <dc:date>2019-09-17T17:02:33Z</dc:date>
    </item>
  </channel>
</rss>

