<?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 Handling Zooming function using Direct ScaleValue of Zoomlevel in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/handling-zooming-function-using-direct-scalevalue/m-p/168424#M468</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to develop zoom function (ZoomIn and ZoomOut)&amp;nbsp; by using ScaleValue of those ZoomLevel. At first , I stored those scalevalue of zoomlevels&amp;nbsp; in a array and I also create two button action (eg. &lt;SPAN&gt;ZoomIn and ZoomOut&amp;nbsp;&lt;/SPAN&gt;) and&amp;nbsp; &amp;nbsp;for ZoomIn fuction , i increase index number of array and for zoomOut function decrease index number of array to get map into desire zoom level. but in my map application , MapView is not zoomIn or Zoomout&amp;nbsp; ,&amp;nbsp; I use map.setReferenceScale() property but is not working , so my question is "is there any other property in which i use scaleValue of zoom levels for execute zoom function in&amp;nbsp;in arcgis runtime sdk in Java ".&amp;nbsp; i have done some code for my application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double [] ZoomScaleValueArr = {5.91657527591555E8,2.95828763795777E8,1.47914381897889E8,7.3957190948944E7,3.6978595474472E7,1.8489297737236E7,&lt;BR /&gt; 9244648.868618,4622324.434309,2311162.217155,1155581.108577,577790.554289, 288895.277144,144447.638572, 72223.819286,36111.909643,&lt;BR /&gt; 18055.954822,9027.977411,4513.988705,2256.994353,1128.497176,564.248588 };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public void setZoom(int zoom) {&lt;BR /&gt; if(minZoom &amp;lt;= zoom &amp;amp;&amp;amp; zoom &amp;lt;= maxZoom)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; double destScale = ZoomScaleValueArr[zoom];&lt;BR /&gt; //map do zooming to destinationScale&lt;BR /&gt; map.setReferenceScale(destScale);&lt;BR /&gt; Point centerPoint = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE).getTargetGeometry().getExtent().getCenter();&lt;BR /&gt; double currentReferenceScale = mapView.getMap().getReferenceScale();&lt;BR /&gt; Viewpoint newViewPoint = new Viewpoint(centerPoint, currentReferenceScale);&lt;BR /&gt; mapView.setViewpoint(newViewPoint);&lt;BR /&gt; System.out.println(currentReferenceScale);&lt;BR /&gt; System.out.println(centerPoint);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//zoomIn Function&lt;/P&gt;&lt;P&gt;zoomInBtn.setOnAction(actionEvent -&amp;gt; {&lt;BR /&gt; zoomOutBtn.setDisable(false);&lt;BR /&gt; zoomValue++;&lt;BR /&gt; map.setZoom(zoomValue);&lt;BR /&gt; if (zoomValue &amp;gt;= 15) {&lt;BR /&gt; zoomInBtn.setDisable(true);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt; &lt;SPAN&gt;//zoomOut Function&lt;/SPAN&gt;&lt;BR /&gt;zoomOutBtn.setOnAction(actionEvent -&amp;gt; {&lt;BR /&gt; zoomInBtn.setDisable(false);&lt;BR /&gt; zoomValue--;&lt;BR /&gt; map.setZoom(zoomValue); &lt;BR /&gt; &lt;BR /&gt; if (zoomValue &amp;lt;= 5) {&lt;BR /&gt; &lt;BR /&gt; zoomOutBtn.setDisable(true);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 24 Sep 2019 15:23:24 GMT</pubDate>
    <dc:creator>S_MMaruf</dc:creator>
    <dc:date>2019-09-24T15:23:24Z</dc:date>
    <item>
      <title>Handling Zooming function using Direct ScaleValue of Zoomlevel</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/handling-zooming-function-using-direct-scalevalue/m-p/168424#M468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I want&amp;nbsp; to develop zoom function (ZoomIn and ZoomOut)&amp;nbsp; by using ScaleValue of those ZoomLevel. At first , I stored those scalevalue of zoomlevels&amp;nbsp; in a array and I also create two button action (eg. &lt;SPAN&gt;ZoomIn and ZoomOut&amp;nbsp;&lt;/SPAN&gt;) and&amp;nbsp; &amp;nbsp;for ZoomIn fuction , i increase index number of array and for zoomOut function decrease index number of array to get map into desire zoom level. but in my map application , MapView is not zoomIn or Zoomout&amp;nbsp; ,&amp;nbsp; I use map.setReferenceScale() property but is not working , so my question is "is there any other property in which i use scaleValue of zoom levels for execute zoom function in&amp;nbsp;in arcgis runtime sdk in Java ".&amp;nbsp; i have done some code for my application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;double [] ZoomScaleValueArr = {5.91657527591555E8,2.95828763795777E8,1.47914381897889E8,7.3957190948944E7,3.6978595474472E7,1.8489297737236E7,&lt;BR /&gt; 9244648.868618,4622324.434309,2311162.217155,1155581.108577,577790.554289, 288895.277144,144447.638572, 72223.819286,36111.909643,&lt;BR /&gt; 18055.954822,9027.977411,4513.988705,2256.994353,1128.497176,564.248588 };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public void setZoom(int zoom) {&lt;BR /&gt; if(minZoom &amp;lt;= zoom &amp;amp;&amp;amp; zoom &amp;lt;= maxZoom)&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; double destScale = ZoomScaleValueArr[zoom];&lt;BR /&gt; //map do zooming to destinationScale&lt;BR /&gt; map.setReferenceScale(destScale);&lt;BR /&gt; Point centerPoint = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE).getTargetGeometry().getExtent().getCenter();&lt;BR /&gt; double currentReferenceScale = mapView.getMap().getReferenceScale();&lt;BR /&gt; Viewpoint newViewPoint = new Viewpoint(centerPoint, currentReferenceScale);&lt;BR /&gt; mapView.setViewpoint(newViewPoint);&lt;BR /&gt; System.out.println(currentReferenceScale);&lt;BR /&gt; System.out.println(centerPoint);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//zoomIn Function&lt;/P&gt;&lt;P&gt;zoomInBtn.setOnAction(actionEvent -&amp;gt; {&lt;BR /&gt; zoomOutBtn.setDisable(false);&lt;BR /&gt; zoomValue++;&lt;BR /&gt; map.setZoom(zoomValue);&lt;BR /&gt; if (zoomValue &amp;gt;= 15) {&lt;BR /&gt; zoomInBtn.setDisable(true);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; });&lt;BR /&gt; &lt;SPAN&gt;//zoomOut Function&lt;/SPAN&gt;&lt;BR /&gt;zoomOutBtn.setOnAction(actionEvent -&amp;gt; {&lt;BR /&gt; zoomInBtn.setDisable(false);&lt;BR /&gt; zoomValue--;&lt;BR /&gt; map.setZoom(zoomValue); &lt;BR /&gt; &lt;BR /&gt; if (zoomValue &amp;lt;= 5) {&lt;BR /&gt; &lt;BR /&gt; zoomOutBtn.setDisable(true);&lt;BR /&gt; &lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 15:23:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/handling-zooming-function-using-direct-scalevalue/m-p/168424#M468</guid>
      <dc:creator>S_MMaruf</dc:creator>
      <dc:date>2019-09-24T15:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Handling Zooming function using Direct ScaleValue of Zoomlevel</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/handling-zooming-function-using-direct-scalevalue/m-p/168425#M469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure that you want to be changing the reference scale of your map. &amp;nbsp;This is for working with annotation for example where you want to set the optimal scale for viewing your data on the map. &amp;nbsp;This doesn't change the scale of the map. &amp;nbsp;This explains why your app isn't functioning as you expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've not tried out your code, but I suspect you simply want to change the scale of your MapView. &amp;nbsp;So if you wanted to alter the scale of your MapView to 1:50000 for example you would use the following code:&lt;/P&gt;&lt;PRE style="color: #a9b7c6; background-color: #2b2b2b; font-size: 12pt;"&gt;&lt;SPAN style="color: #9876aa;"&gt;mapView&lt;/SPAN&gt;.setViewpointScaleAsync(&lt;SPAN style="color: #6897bb;"&gt;50000&lt;/SPAN&gt;)&lt;SPAN style="color: #cc7832;"&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;There are various methods on the MapView class which work with ViewPoints you can experiment with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointScaleAsync(double)" title="https://developers.arcgis.com/java/latest/api-reference/reference/com/esri/arcgisruntime/mapping/view/MapView.html#setViewpointScaleAsync(double)"&gt;MapView (ArcGIS Runtime SDK for Java 100.6.0)&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Sep 2019 21:08:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/handling-zooming-function-using-direct-scalevalue/m-p/168425#M469</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2019-09-24T21:08:40Z</dc:date>
    </item>
  </channel>
</rss>

