<?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 Create Routing Geometry for point clicked on map. in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031280#M3980</link>
    <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;Before I start I wanted to thank everyone for their help on a few questions I have posted lately. I really appreciated the help.&lt;/P&gt;&lt;P&gt;My question is creating geometry for a point clicked on the map. I want to solve a route from my current location to a feature or a point click on the map. I can get the current location working to a set point but can't get the point to work. At the moment I have this but coming up with the line not defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;stop2Geometry = ArcGISRuntimeEnvironment.createObject("Point", {                                                                                  y: mapView.mouse.mapPoint.position.y,                                                                                  x: mapView.mouse.mapPoint.position.x,                                                                                  spatialReference: SpatialReference.createWgs84()                                                                              });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on QML Runtime 100.8.&lt;/P&gt;&lt;P&gt;Also I would like this to work onClicked to automatically solve the route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eric&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Feb 2021 12:06:12 GMT</pubDate>
    <dc:creator>EricAtkinson1</dc:creator>
    <dc:date>2021-02-27T12:06:12Z</dc:date>
    <item>
      <title>Create Routing Geometry for point clicked on map.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031280#M3980</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;Before I start I wanted to thank everyone for their help on a few questions I have posted lately. I really appreciated the help.&lt;/P&gt;&lt;P&gt;My question is creating geometry for a point clicked on the map. I want to solve a route from my current location to a feature or a point click on the map. I can get the current location working to a set point but can't get the point to work. At the moment I have this but coming up with the line not defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="css"&gt;stop2Geometry = ArcGISRuntimeEnvironment.createObject("Point", {                                                                                  y: mapView.mouse.mapPoint.position.y,                                                                                  x: mapView.mouse.mapPoint.position.x,                                                                                  spatialReference: SpatialReference.createWgs84()                                                                              });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on QML Runtime 100.8.&lt;/P&gt;&lt;P&gt;Also I would like this to work onClicked to automatically solve the route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eric&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Feb 2021 12:06:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031280#M3980</guid>
      <dc:creator>EricAtkinson1</dc:creator>
      <dc:date>2021-02-27T12:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create Routing Geometry for point clicked on map.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031559#M3981</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/426765"&gt;@EricAtkinson1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I am unable to find a &lt;STRONG&gt;mouse&lt;/STRONG&gt; property for the&amp;nbsp;&lt;STRONG&gt;MapView&lt;/STRONG&gt; type but I think we can do this another way. The map view has an&amp;nbsp;&lt;STRONG&gt;onMouseClicked&lt;/STRONG&gt; signal handler for when you click on the map view. Within that you can do the following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;MapView {
  id: mapView

  onMouseClicked: {
    const clickedPoint = mapView.screenToLocation(mouse.x, mouse.y);

    const stopPoint = ArcGISRuntimeEnvironment.createObject("Stop", {geometry: clickedPoint});
  }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also reference our "Route around barriers" sample,&amp;nbsp;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-qt/blob/be0fc9486d53d8a87379065bf14095d518ea3ba7/ArcGISRuntimeSDKQt_QMLSamples/Routing/RouteAroundBarriers/RouteAroundBarriers.qml#L171-L205" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-qt/blob/be0fc9486d53d8a87379065bf14095d518ea3ba7/ArcGISRuntimeSDKQt_QMLSamples/Routing/RouteAroundBarriers/RouteAroundBarriers.qml#L171-L205&lt;/A&gt;. This sample demonstrates a similar workflow where it does solve the route every-time there is a click to add a stop to the map(for two or more stops). It does a few more really cool things like adding in barriers in which it will take those into account and optimize for the best route given those barriers and also can find the best sequence which will reorder stops to optimize the route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope you find this helpful!&lt;/P&gt;&lt;P&gt;- Jared&lt;/P&gt;</description>
      <pubDate>Mon, 01 Mar 2021 17:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031559#M3981</guid>
      <dc:creator>JaredCaccamo</dc:creator>
      <dc:date>2021-03-01T17:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create Routing Geometry for point clicked on map.</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031850#M3986</link>
      <description>&lt;P&gt;Thanks Jared that worked a treat!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 10:59:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/create-routing-geometry-for-point-clicked-on-map/m-p/1031850#M3986</guid>
      <dc:creator>EricAtkinson1</dc:creator>
      <dc:date>2021-03-02T10:59:09Z</dc:date>
    </item>
  </channel>
</rss>

