<?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 Arrows along a line in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510609#M5290</link>
    <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I have a GPS track and I would like to have directional arrows displayed along it. I see this has been done in the JS library:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/cim-line-arrows/" target="_blank"&gt;Arrows along a line | Sample Code | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have tried creating point symbols and orienting them, but it is messy because they would need to be moved at different zoom levels and are an expensive solution.&lt;/P&gt;&lt;P&gt;Is there a recommended way to do this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 14:18:09 GMT</pubDate>
    <dc:creator>JustinSteventon</dc:creator>
    <dc:date>2024-07-26T14:18:09Z</dc:date>
    <item>
      <title>Arrows along a line</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510609#M5290</link>
      <description>&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;I have a GPS track and I would like to have directional arrows displayed along it. I see this has been done in the JS library:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/cim-line-arrows/" target="_blank"&gt;Arrows along a line | Sample Code | ArcGIS Maps SDK for JavaScript 4.30 | Esri Developer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have tried creating point symbols and orienting them, but it is messy because they would need to be moved at different zoom levels and are an expensive solution.&lt;/P&gt;&lt;P&gt;Is there a recommended way to do this?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 14:18:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510609#M5290</guid>
      <dc:creator>JustinSteventon</dc:creator>
      <dc:date>2024-07-26T14:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Arrows along a line</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510875#M5291</link>
      <description>&lt;P&gt;Hi Justin,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can be achieved with Multilayer (CIM) symbols. You could take a few different avenues to get the end result. The simplest port of the JS samples is to take the Symbol JSON they used and use it in Maps SDK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example I tested with:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;auto builder = new PolylineBuilder(SpatialReference::wgs84(), this);
builder-&amp;gt;addPoint(0,0);
builder-&amp;gt;addPoint(0,10);
builder-&amp;gt;addPoint(0,20);
builder-&amp;gt;addPoint(30,30);
builder-&amp;gt;addPoint(50,50);
builder-&amp;gt;addPoint(60,50);

auto g = new Graphic(builder-&amp;gt;toGeometry(), this);
auto go = new GraphicsOverlay(this);
go-&amp;gt;graphics()-&amp;gt;append(g);
m_mapView-&amp;gt;graphicsOverlays()-&amp;gt;append(go);


auto symbol = R"({
    "type": "CIMSymbolReference",
    "symbol": {
      "type": "CIMLineSymbol",
      "symbolLayers": [{
        "type": "CIMSolidStroke",
        "enable": "true",
        "width": 1,
        "color": [0, 0, 0, 255]
      },
      {
        "type": "CIMVectorMarker",
        "enable": "true",
        "size": 5,
        "markerPlacement": {
          "type": "CIMMarkerPlacementAlongLineSameSize",
          "endings": "WithMarkers",
          "placementTemplate": [19.5],
          "angleToLine": "true"
        },
        "frame": {
          "xmin": -5,
          "ymin": -5,
          "xmax": 5,
          "ymax": 5
        },
        "markerGraphics": [{
          "type": "CIMMarkerGraphic",
          "geometry": {
            "rings": [
              [
                [-8, -5.47],
                [-8, 5.6],
                [1.96, -0.03],
                [-8, -5.47]
              ]
            ]
          },
          "symbol": {
            "type": "CIMPolygonSymbol",
            "symbolLayers": [{
              "type": "CIMSolidFill",
              "enable": "true",
              "color": [0, 0, 0, 255]
            }]
          }
        }]
      }]
    }
})";

auto s = Symbol::fromJson(symbol);    
g-&amp;gt;setSymbol(s);&lt;/LI-CODE&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="LucasDanzinger_0-1722027556473.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/110806iF6CF5EB0FB28B951/image-size/medium?v=v2&amp;amp;px=400" role="button" title="LucasDanzinger_0-1722027556473.png" alt="LucasDanzinger_0-1722027556473.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could further modify the CIM symbol JSON to your liking by referencing the &lt;A href="https://github.com/Esri/cim-spec" target="_self"&gt;CIM spec&lt;/A&gt;, or using a tool like the online &lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/developers/cim-symbol-builder/" target="_self"&gt;CIM Symbol Builder.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you don't want to sling JSON around, you could use our &lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-multilayersymbol.html" target="_self"&gt;MultilayerSymbol API&lt;/A&gt;, which provides a subset of the CIM spec in a higher level easier to use API, but it might not have all the functionality you need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A final option would be to use Pro to create a Symbol that you like, and export that to a style file that you can reference in your app. &lt;A href="https://community.esri.com/t5/arcgis-maps-sdks-native-blog/using-custom-pro-symbols-in-arcgis-runtime/ba-p/888699" target="_self"&gt;Here's a blog&lt;/A&gt; I wrote about this pattern.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 20:59:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510875#M5291</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2024-07-26T20:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: Arrows along a line</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510930#M5292</link>
      <description>&lt;P&gt;Thanks for the fast response, Lucas. I plugged this in, but the Symbol::fromJson(symbol) returns null. I verified that the JSON was well formed. I am using 100.15. I will try with the MultilayerSymbol API and report back.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 23:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510930#M5292</guid>
      <dc:creator>JustinSteventon</dc:creator>
      <dc:date>2024-07-26T23:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Arrows along a line</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510949#M5293</link>
      <description>&lt;P&gt;Reporting back. The line in the JSON that caused the failure was "angleToLine" - perhaps that was not supported in 100.15. In any case, that seems to be the default, so removing it was fine.&lt;/P&gt;&lt;P&gt;I had good luck creating the classes manually, but there seems to be no way to modify the marker placement. Did I miss something?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;auto geometricEffects = QList&amp;lt;GeometricEffect *&amp;gt; { new DashGeometricEffect(QList&amp;lt;double&amp;gt;{0.1, 10}, this) };
auto solidStrokeSymbolLayer = new SolidStrokeSymbolLayer(lineWidth, QColor(0, 0, 255, 200), geometricEffects, this);

auto simpleFillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle::Solid, QColor(0, 0, 255, 200), this);
auto arrowJson = R"({"rings": [[[-8, -5.47],[-8, 5.6], [1.96, -0.03], [-8, -5.47]]]})";
auto symbolElementPolygon = new VectorMarkerSymbolElement(Geometry::fromJson(arrowJson), simpleFillSymbol-&amp;gt;toMultilayerSymbol(this), this);
auto vectorMarkerSymbolLayer = new VectorMarkerSymbolLayer(QList&amp;lt;VectorMarkerSymbolElement*&amp;gt; {symbolElementPolygon}, this);

auto symbolLayers = QList&amp;lt;SymbolLayer*&amp;gt;{ solidStrokeSymbolLayer, vectorMarkerSymbolLayer };
auto multilayerSymbol = new MultilayerPolylineSymbol(symbolLayers, this);
graphic-&amp;gt;setSymbol(multilayerSymbol);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In any case, creating the structures from JSON is straightforward and easy to work with, so I am going to stick with that approach.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jul 2024 05:13:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/arrows-along-a-line/m-p/1510949#M5293</guid>
      <dc:creator>JustinSteventon</dc:creator>
      <dc:date>2024-07-28T05:13:31Z</dc:date>
    </item>
  </channel>
</rss>

