<?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 Re: How to move multiple coordinate MIL-STD252D symbols via mouse drag in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-move-multiple-coordinate-mil-std252d/m-p/1162972#M2571</link>
    <description>&lt;P&gt;I don't have any specific code to do what you are looking for, but I'd approach it something like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When you identify or get the geometry of say an arrow you you'll get back a &lt;A href="https://developers.arcgis.com/java/api-reference/reference/com/esri/arcgisruntime/geometry/Multipoint.html" target="_self"&gt;MultiPoint&lt;/A&gt;&amp;nbsp;which will contain the control points for your arrow.&lt;/LI&gt;&lt;LI&gt;You should be able to work out a delta x and y from your dragging operation.&lt;/LI&gt;&lt;LI&gt;You can create a new MultiPoint by looping through the points in the old geometry, apply the delta to each point and then set the new geometry to your graphic.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Does this help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2022 11:13:17 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2022-04-11T11:13:17Z</dc:date>
    <item>
      <title>How to move multiple coordinate MIL-STD252D symbols via mouse drag</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-move-multiple-coordinate-mil-std252d/m-p/1162394#M2570</link>
      <description>&lt;P&gt;Hi All, I am seeking advice on an approach to enable moving multiple coordinate symbols such as the arrow line below via the mouse. I have no issues moving single coordinate symbols. My current code for a single coordinate is below.&amp;nbsp; &amp;nbsp;Has someone developed or could share a method they have developed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rod182211_0-1649384669615.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/38411i43944AE310F437A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rod182211_0-1649384669615.png" alt="rod182211_0-1649384669615.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;identifyGraphics.addDoneListener(() -&amp;gt; {&lt;/P&gt;&lt;P&gt;try {&lt;BR /&gt;if (!identifyGraphics.get().getGraphics().isEmpty()) {&lt;BR /&gt;// get the first identified graphic&lt;BR /&gt;identifiedGraphic = identifyGraphics.get().getGraphics().get(0);&lt;BR /&gt;// select the identified graphic&lt;BR /&gt;identifiedGraphic.setSelected(true);&lt;BR /&gt;eventHandlersymbolfirstmove = new EventHandler&amp;lt;javafx.scene.input.MouseEvent&amp;gt;() {&lt;BR /&gt;@Override&lt;BR /&gt;public void handle(javafx.scene.input.MouseEvent event) {&lt;BR /&gt;&lt;BR /&gt;if (identifiedGraphic.isSelected() &amp;amp;&amp;amp; identifiedGraphic != null) {&lt;/P&gt;&lt;P&gt;// set the cursor to closed hand to indicate graphic dragging is active&lt;BR /&gt;sceneView.setCursor(Cursor.CLOSED_HAND);&lt;BR /&gt;//Get the selected graphic attributes and reference the current graphic ID&lt;BR /&gt;Map&amp;lt;String, Object&amp;gt; identified = identifiedGraphic.getAttributes();&lt;BR /&gt;identifiedGraphicid = (String) identified.get("_id");&lt;BR /&gt;//Get the current array of coordiates&lt;BR /&gt;// String identifiedGraphiccoordinates = (String) identified.get("_control_points");&lt;BR /&gt;&lt;BR /&gt;// System.out.println(identifiedGraphiccoordinates);&lt;BR /&gt;// create a point from the dragged location&lt;BR /&gt;mapViewPoint = new Point2D(event.getX(), event.getY());&lt;BR /&gt;Point mapPoint = sceneView.screenToLocation(mapViewPoint);&lt;BR /&gt;// update the location of the graphic to the dragged location&lt;BR /&gt;identifiedGraphic.setGeometry(mapPoint);&lt;BR /&gt;//Convert to lat long decimal&lt;BR /&gt;String latLonDecimalDegrees = CoordinateFormatter.toLatitudeLongitude(mapPoint,&lt;BR /&gt;CoordinateFormatter.LatitudeLongitudeFormat.DECIMAL_DEGREES, 4);&lt;BR /&gt;//Convert for my symbol attribute method&lt;BR /&gt;String coordinates = Tools.degreesToString(latLonDecimalDegrees);&lt;BR /&gt;// Concert to JSON for transmission across the network&lt;BR /&gt;updateonmap = mapPoint.toJson();&lt;BR /&gt;eventHandlersymbolmove = (javafx.scene.input.MouseEvent e1) -&amp;gt; {&lt;BR /&gt;identifiedGraphic.setSelected(false);&lt;BR /&gt;sceneView.setCursor(Cursor.DEFAULT);&lt;BR /&gt;// clear any selected graphic&lt;BR /&gt;graphicsOverlay.clearSelection();&lt;BR /&gt;sceneView.removeEventFilter(javafx.scene.input.MouseEvent.MOUSE_DRAGGED,&lt;BR /&gt;eventHandlersymbolfirstmove);&lt;BR /&gt;event.consume();&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;sceneView.addEventFilter(javafx.scene.input.MouseEvent.MOUSE_RELEASED,&lt;BR /&gt;eventHandlersymbolmove);&lt;/P&gt;&lt;P&gt;try {&lt;BR /&gt;/* send the move information over the network and updates the database with&lt;BR /&gt;the new information for the coordinates */&lt;BR /&gt;moveSymbolTransmission(coordinates, updateonmap);&lt;BR /&gt;/* update the database with the changes */&lt;BR /&gt;updateRecord.UpdateSymbol(identifiedGraphicid.trim(), coordinates.trim());&lt;/P&gt;&lt;P&gt;} catch (Exception e11) {&lt;BR /&gt;LOG.severe(e11, "Failed to move symbol and update database: %s",&lt;BR /&gt;e11.getMessage());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;event.consume();&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;};&lt;BR /&gt;sceneView.addEventFilter(javafx.scene.input.MouseEvent.MOUSE_DRAGGED,&lt;BR /&gt;eventHandlersymbolfirstmove);&lt;BR /&gt;}&lt;BR /&gt;} catch (InterruptedException e1) {&lt;BR /&gt;LOG.severe(e1, "Error graphic: %s", e1.getMessage());&lt;BR /&gt;e1.printStackTrace();&lt;BR /&gt;} catch (ExecutionException e1) {&lt;BR /&gt;new Alert(Alert.AlertType.ERROR, "Error identifying clicked graphic").show();&lt;BR /&gt;LOG.severe(e1, "Error identifying clicked graphic: %s", e1.getMessage());&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;});&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 02:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-move-multiple-coordinate-mil-std252d/m-p/1162394#M2570</guid>
      <dc:creator>rod182211</dc:creator>
      <dc:date>2022-04-08T02:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to move multiple coordinate MIL-STD252D symbols via mouse drag</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-move-multiple-coordinate-mil-std252d/m-p/1162972#M2571</link>
      <description>&lt;P&gt;I don't have any specific code to do what you are looking for, but I'd approach it something like this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;When you identify or get the geometry of say an arrow you you'll get back a &lt;A href="https://developers.arcgis.com/java/api-reference/reference/com/esri/arcgisruntime/geometry/Multipoint.html" target="_self"&gt;MultiPoint&lt;/A&gt;&amp;nbsp;which will contain the control points for your arrow.&lt;/LI&gt;&lt;LI&gt;You should be able to work out a delta x and y from your dragging operation.&lt;/LI&gt;&lt;LI&gt;You can create a new MultiPoint by looping through the points in the old geometry, apply the delta to each point and then set the new geometry to your graphic.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Does this help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2022 11:13:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-move-multiple-coordinate-mil-std252d/m-p/1162972#M2571</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2022-04-11T11:13:17Z</dc:date>
    </item>
  </channel>
</rss>

