POST
|
Hi, I want to develop zoom function (ZoomIn and ZoomOut) by using ScaleValue of those ZoomLevel. At first , I stored those scalevalue of zoomlevels in a array and I also create two button action (eg. ZoomIn and ZoomOut ) and 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 , 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 in arcgis runtime sdk in Java ". i have done some code for my application. double [] ZoomScaleValueArr = {5.91657527591555E8,2.95828763795777E8,1.47914381897889E8,7.3957190948944E7,3.6978595474472E7,1.8489297737236E7, 9244648.868618,4622324.434309,2311162.217155,1155581.108577,577790.554289, 288895.277144,144447.638572, 72223.819286,36111.909643, 18055.954822,9027.977411,4513.988705,2256.994353,1128.497176,564.248588 }; public void setZoom(int zoom) { if(minZoom <= zoom && zoom <= maxZoom) { double destScale = ZoomScaleValueArr[zoom]; //map do zooming to destinationScale map.setReferenceScale(destScale); Point centerPoint = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE).getTargetGeometry().getExtent().getCenter(); double currentReferenceScale = mapView.getMap().getReferenceScale(); Viewpoint newViewPoint = new Viewpoint(centerPoint, currentReferenceScale); mapView.setViewpoint(newViewPoint); System.out.println(currentReferenceScale); System.out.println(centerPoint); } } //zoomIn Function zoomInBtn.setOnAction(actionEvent -> { zoomOutBtn.setDisable(false); zoomValue++; map.setZoom(zoomValue); if (zoomValue >= 15) { zoomInBtn.setDisable(true); } }); //zoomOut Function zoomOutBtn.setOnAction(actionEvent -> { zoomInBtn.setDisable(false); zoomValue--; map.setZoom(zoomValue); if (zoomValue <= 5) { zoomOutBtn.setDisable(true); } });
... View more
09-24-2019
08:23 AM
|
0
|
1
|
550
|
POST
|
Hello Community, This is S M Maruf. At present , I am working as a intern for my master degree in a German Company named FusionSytems GmbH. My topic is routing and navigation and my task is to the development of an app for the visualisation of geo data. I am using ArcGIS Runtime SDK for Java for my map application . I am very happy to get myself introduced with you.
... View more
09-17-2019
04:03 AM
|
2
|
1
|
550
|
POST
|
Hi, I am trying to disable mouse wheel zoom at max zoom level 18 and min zoom level 3 . I created scroll event which disable zoombuttons at max zoom level and min zoom level when I do zoomIn and zoomOut at those level by using mouse wheel zoom. i also use "mapView.setEnableMouseZoom(false)" . what am i missing , i dont understand . so can anyone help me to figure out what is the wrong? // zoomIn and zoomOut by using mouse wheel. mapView.setOnScroll(new EventHandler<ScrollEvent>() { public void handle(ScrollEvent se) { // zoomIn by using mouse wheel and zooIn Button disable at zoom level at 18 while using mouse wheel zoomIn zoomOut.setDisable(false); map.zoomInFunction(); if (mapView.getMapScale() <= 2256.994353) { zoomIn.setDisable(true); mapView.setEnableMouseZoom(false); } // zoomOut by using mouse wheel and zoomOut Button disable at zoom level at 3 while using mouse wheel zoomOut if (se.getDeltaY()<0) { zoomIn.setDisable(false); map.zoomOutFunction(); if (mapView.getMapScale() >= 7.3957190948944E7) { zoomOut.setDisable(true); mapView.setEnableMouseZoom(false); } } public void zoomInFunction() { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); mapView.setViewpointAsync(zoomedIn); System.out.println(current.getTargetScale() / 2); } public void zoomOutFunction() { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedIn); System.out.println(current.getTargetScale() * 2); }
... View more
09-17-2019
03:41 AM
|
0
|
1
|
538
|
POST
|
I create this logic for mouse scroll/wheel zoom but when I am mouse_ scrolling both direction it works as a zoomIn function . how can i set up opposite scrolling for zoomOut Function. // zoomIn by using mouse wheel and zooIn Button disable at zoom level at 18 while using mouse wheel zoomIn mapView.setOnScroll(new EventHandler<ScrollEvent>() { public void handle(ScrollEvent se) { zoomOut.setDisable(false); map.zoomInFunction(); if (mapView.getMapScale() <= 2256.994353) { zoomIn.setDisable(true); } }});
... View more
09-16-2019
08:47 AM
|
0
|
1
|
434
|
POST
|
Hello , 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 mouse Wheel zooming that reach zoom level 18 and disable ZoomIn Button and samething happen when mouse wheel zooming reached zoom level 0 , 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 from you. @Override public void initialize(URL location, ResourceBundle resources) { this.mapView = new MapView(); this.map = new IJMSMap(this.mapView); zoomOut.setDisable(true); Scalebar scaleBar = new Scalebar(mapView); scaleBar.setSkinStyle(Scalebar.SkinStyle.GRADUATED_LINE); scaleBar.setUnitSystem(UnitSystem.METRIC); Color transparentWhite = new Color(1, 1, 1, 0.7); scaleBar.setBackground(new Background(new BackgroundFill(transparentWhite, new CornerRadii(5), Insets.EMPTY))); } this.PanButtonContainerPane.getChildren().addAll(mapView,scaleBar); this.PanButtonContainerPane.setAlignment(scaleBar, Pos.TOP_LEFT); this.movePanNorth.toFront(); this.movePanEast.toFront(); this.MovePanSouth.toFront(); this.movePanWest.toFront(); this.zoomBtnVbox.toFront(); } #ActionEvent for ZoomIn function public void zoomInAction(ActionEvent event) { zoomOut.setDisable(false); map.zoomInFunction(); if (mapView.getMapScale() <= 2256.994353) { zoomIn.setDisable(true); } } #ActionEvent for ZoomOut function public void zoomOutAction(ActionEvent event) { zoomIn.setDisable(false); map.zoomOutFunction(); if (mapView.getMapScale() >= 7.3957190948944E7) { zoomOut.setDisable(true); } } #Method for zoomIn function public void zoomInFunction() { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); mapView.setViewpointAsync(zoomedIn); } #Method for zoomOut function public void zoomOutFunction() { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedIn); }
... View more
09-16-2019
03:46 AM
|
0
|
2
|
515
|
POST
|
Hi, This Scalebar's Viewpart is created from logic part but in my project all other map controls eg: zoombutton, pan Moving Button is created using JavaFx Fxml and secneBuilder . can you give me some direction how to develope Viewpart using Fxml or sceneBuilder for ScaleBar toolkit for my map application. it would be great to get some help.
... View more
09-10-2019
02:45 AM
|
0
|
1
|
633
|
POST
|
Hello guys , I want to use scalebar toolkit in my map application . there is any way to integrate arcgis runtime java scalebar toolkit in project without gradle or maven. in my project i dont use any gradle or maven .. there is other way how to use scalebar feautre in my project?
... View more
09-09-2019
07:22 AM
|
0
|
3
|
806
|
POST
|
hi i used different way to implement your code . but it doesnt working . i am little bit confused now where i put these code . i implemented in button action event but no result. my application is following decoupled way .can you check for where and what i am missing . also i am using javafxml to create view part of my map application. in my project button action event should be in another class. // this is my map class// public class IJMSMap implements MapInterface { private MapView mapView; private Point p; private ArcGISMap map ; @FXML private Button zoomOut; @FXML private Button zoomIn; ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer("http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer"); public IJMSMap(MapView mapView) { this.mapView = mapView; // create an ArcGISMap with the default imagery basemap this.map = new ArcGISMap(new Basemap(tiledLayer)); // display the map by setting the map on the map view mapView.setMap(this.map); Point envelope = new Point(0.0, 0.0, SpatialReferences.getWgs84()); mapView.setViewpointGeometryAsync(envelope); } // this is controller class which contains zoom button action event// public class MapLayOutController implements Initializable { @FXML private StackPane MapPane ; //private MapView MapView; //private IJMSMap map; @FXML private VBox controlVbox; @FXML private Button zoomOut; @FXML private Button zoomIn; private CheckBox layer; @FXML private HBox zoomBtnHbox; private MapView MapView = new MapView(); private IJMSMap map = new IJMSMap(this.MapView); ArcGISTiledLayer tiledLayer = new ArcGISTiledLayer("http://services.arcgisonline.com/arcgis/rest/services/Canvas/World_Light_Gray_Base/MapServer"); @FXML private StackPane PanButtonContainerPane; @Override public void initialize(URL location, ResourceBundle resources) { this.MapView = new MapView(); this.map = new IJMSMap(this.MapView); } this.PanButtonContainerPane.getChildren().add(MapView); this.movePanNorth.toFront(); this.movePanEast.toFront(); this.MovePanSouth.toFront(); this.movePanWest.toFront(); this.zoomBtnHbox.toFront(); } public void zoomIn(ActionEvent event) { tiledLayer.addDoneLoadingListener(() -> { var lods = tiledLayer.getTileInfo().getLevelsOfDetail(); zoomIn.setOnAction(a -> { Viewpoint current = MapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); MapView.setViewpointAsync(zoomedIn); }); MapView.addMapScaleChangedListener(s -> zoomIn.setDisable(MapView.getMapScale() <= lods.get(18).getScale())); }); } public void zoomOut(ActionEvent event) { tiledLayer.addDoneLoadingListener(() -> { var lods = tiledLayer.getTileInfo().getLevelsOfDetail(); zoomIn.setOnAction(a -> { Viewpoint current = MapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); MapView.setViewpointAsync(zoomedIn); }); MapView.addMapScaleChangedListener(s -> zoomIn.setDisable(MapView.getMapScale() >= lods.get(18).getScale())); }); }
... View more
09-05-2019
04:01 AM
|
0
|
0
|
742
|
POST
|
Hi , you code nicely working . i also need to disable zoomOut button disable in zoomlevel 0 . i write code under the zoomIn button disable code . my zoomOut button is not disable . am i some thing missing can you help me ? tiledLayer.addDoneLoadingListener(() -> { var lods = tiledLayer.getTileInfo().getLevelsOfDetail(); lods.forEach(lod -> System.out.println(lod.getLevel() + " " + lod.getScale() + " " + lod.getResolution())); //tiledLayer.setMinScale(lods.get(0).getScale()); //tiledLayer.setMaxScale(lods.get(18).getScale()); HBox box = new HBox(); borderPane.setBottom(box); Button zoomIn = new Button("Zoom in"); Button zoomOut = new Button("Zoom out"); zoomIn.setOnAction(a -> { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); }); zoomOut.setOnAction(a -> { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedOut = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedOut); }); box.getChildren().addAll(zoomIn, zoomOut); mapView.addMapScaleChangedListener(s -> zoomIn.setDisable(mapView.getMapScale() <= lods.get(18).getScale())); mapView.addMapScaleChangedListener(s -> zoomOut.setDisable(mapView.getMapScale() >= lods.get(0).getScale())); }); Basemap basemap = new Basemap(); basemap.getBaseLayers().add(tiledLayer); map.setBasemap(basemap); mapView.setMap(map); borderPane.setCenter(mapView); }
... View more
09-05-2019
02:35 AM
|
0
|
1
|
742
|
POST
|
i used your alternative apporach . but i get exception public void zoomControl(boolean zoom) { var lods = tiledLayer.getTileInfo().getLevelsOfDetail(); tiledLayer.setMaxScale(lods.get(18).getScale()); tiledLayer.setMinScale(lods.get(0).getScale()); double MaxZoomLevel = tiledLayer.getMaxScale(); double MinZoomLevel = tiledLayer.getMinScale(); //zoomIn.setDisable(false); //zoomOut.setDisable(false); if(zoom == true) { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); mapView.setViewpointAsync(zoomedIn); mapView.addMapScaleChangedListener(s -> zoomIn.setDisable(mapView.getMapScale() <= lods.get(18).getScale())); } else { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedOut = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedOut); mapView.addMapScaleChangedListener(s -> zoomOut.setDisable(mapView.getMapScale() >= lods.get(0).getScale())); } } ============================================================================== Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at iJMSFx/application.IJMSMap.lambda$1(IJMSMap.java:166) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapScaleChangedListenerRunnerImpl.run(MapScaleChangedListenerRunnerImpl.java:51) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapViewImpl$2.scaleChanged(MapViewImpl.java:101) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.jni.CoreMapView.onScaleChanged(CoreMapView.java:366) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.nativePulse(Native Method) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.pulse(RenderingContext.java:97) at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:803) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.PulseThread$1.handle(PulseThread.java:31) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$0(AnimationTimer.java:57) at java.base/java.security.AccessController.doPrivileged(AccessController.java:389) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:515) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:835) Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at iJMSFx/application.IJMSMap.lambda$1(IJMSMap.java:166) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapScaleChangedListenerRunnerImpl.run(MapScaleChangedListenerRunnerImpl.java:51) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapViewImpl$2.scaleChanged(MapViewImpl.java:101) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.jni.CoreMapView.onScaleChanged(CoreMapView.java:366) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.nativePulse(Native Method) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.pulse(RenderingContext.java:97) at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:803) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.PulseThread$1.handle(PulseThread.java:31) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$0(AnimationTimer.java:57) at java.base/java.security.AccessController.doPrivileged(AccessController.java:389) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:515) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:835) Exception in thread "JavaFX Application Thread" java.lang.NullPointerException at iJMSFx/application.IJMSMap.lambda$1(IJMSMap.java:166) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapScaleChangedListenerRunnerImpl.run(MapScaleChangedListenerRunnerImpl.java:51) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.MapViewImpl$2.scaleChanged(MapViewImpl.java:101) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.jni.CoreMapView.onScaleChanged(CoreMapView.java:366) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.nativePulse(Native Method) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.RenderingContext.pulse(RenderingContext.java:97) at java.base/java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:803) at com.esri.arcgisruntime/com.esri.arcgisruntime.internal.mapping.view.PulseThread$1.handle(PulseThread.java:31) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.lambda$handle$0(AnimationTimer.java:57) at java.base/java.security.AccessController.doPrivileged(AccessController.java:389) at javafx.graphics/javafx.animation.AnimationTimer$AnimationTimerReceiver.handle(AnimationTimer.java:56) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:357) at javafx.graphics/com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:515) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:499) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.pulseFromQueue(QuantumToolkit.java:492) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$11(QuantumToolkit.java:320) at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96) at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174) at java.base/java.lang.Thread.run(Thread.java:835)
... View more
09-04-2019
08:42 AM
|
0
|
1
|
3132
|
POST
|
Hi, I implement your idea . but it doesnt disable the button. can you help me to sort out where i am doing wrong ?? //zoomIn Button public void zoomIn(ActionEvent event) { map.zoomControl(true) ; } //zoomOut Button public void zoomOut(ActionEvent event) { map.zoomControl(false); } //zoomControl method public void zoomControl(boolean zoom) { var lods = tiledLayer.getTileInfo().getLevelsOfDetail(); tiledLayer.setMaxScale(lods.get(18).getScale()); tiledLayer.setMinScale(lods.get(0).getScale()); if(zoom == true) { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); mapView.setViewpointAsync(zoomedIn); if (this.equals(tiledLayer.getMaxScale())) { zoomIn.setDisable(true); } } else { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedOut = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedOut); if (this.equals(tiledLayer.getMinScale())) { zoomIn.setDisable(true); } } }
... View more
09-04-2019
05:07 AM
|
0
|
1
|
3132
|
POST
|
Hello, thank you for the helpful reply . i am still facing confusion that for zoom control . i explain now little bit why i need zoom level , for map application max zoom level will be 18 and when zoom level going 18 or 18 plus the zoomln button will be disable .for also zoomOut when zoomlevel 0 (min) will be reached then zoomOut button will be disable . for those i need to work with some how zoomlevel 18 and 0 for respective max and min and disable those two button on those two zoomlevel respectively. i am using Wmslayer Class in my map application. //zoomIn Button public void zoomIn(ActionEvent event) { map.zoomControl(true) ; } //zoomOut Button public void zoomOut(ActionEvent event) { map.zoomControl(false); } //zoomControl method public void zoomControl(boolean zoom) { if(zoom == true) { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedIn = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() / 2.0); mapView.setViewpointAsync(zoomedIn); }else { Viewpoint current = mapView.getCurrentViewpoint(Viewpoint.Type.CENTER_AND_SCALE); Viewpoint zoomedOut = new Viewpoint((Point) current.getTargetGeometry(), current.getTargetScale() * 2.0); mapView.setViewpointAsync(zoomedOut); } }
... View more
09-03-2019
05:12 AM
|
0
|
1
|
3132
|
POST
|
Hi, your hint is nicely working. but how can i implement that zoomlevel max 18 and zoomlevel min 0?
... View more
09-02-2019
07:51 AM
|
0
|
3
|
3131
|
POST
|
Hi , I am trying to develop zooControls like zoomIn and zoomOut. i give below the code about zoomIn and ZoomOut. public void zoomIn() { double x, y; x= mapView.getScaleX(); y= mapView.getScaleY(); mapView.setScaleX(x+1); mapView.setScaleY(y+1); } public void zoomOut() { double x, y; x= mapView.getScaleX(); y= mapView.getScaleY(); mapView.setScaleX(x-1); mapView.setScaleY(y-1); } but the problem is when i click zoomIn button the mapview is overlaping with other pane and when i click zoomOut , it is not working and mapview is not zoomout within its stackpane like mouse's zoomIn and zoomout. i attach some code snippet. For my map application, changes zoom level of map by +1 or -1 and default minimum zoom level is 0, default maximum zoom level is 18. so , there is another way to work with directly with mapview's zoom level?? above code is not working like mouse's zooming. can you guys give recommendation how to solve this problem?
... View more
09-02-2019
05:49 AM
|
1
|
12
|
4165
|
POST
|
Hello guys, I am trying fetch sublayer from WmsLayer for visible and invisible those layers . but problem is when i am using this code "this.layer.getSublayers().get(0).setVisible(this.visible);" and run the code I am getting bound exception "Index 0 out of bounds for length 0". and i am debugging this code i get the value of sublayer list as Null. can anybody help how to i am able to get sublayer from Wmslayer? what is the wrong in my code?
... View more
08-28-2019
07:23 AM
|
0
|
1
|
455
|
Title | Kudos | Posted |
---|---|---|
1 | 09-02-2019 05:49 AM | |
2 | 09-17-2019 04:03 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|