<?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: LabelDefinition with int parameter in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121248#M1340</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only properties that are explicitly described as expressions, such as the `labelExpressionInfo.expression` or the `labelAngleInfo.angleExpressionInfo.expression` can (and must) contain an Arcade expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 May 2019 20:42:19 GMT</pubDate>
    <dc:creator>MichaelBranscomb</dc:creator>
    <dc:date>2019-05-16T20:42:19Z</dc:date>
    <item>
      <title>LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121241#M1333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have following&amp;nbsp;StringBuilder:&lt;BR /&gt;{&lt;BR /&gt;"allowOverlapOfLabel": "allow" ,&lt;BR /&gt;"allowOverlapOfFeatureBoundary": "allow" ,&lt;BR /&gt;"allowOverlapOfFeatureInterior": "allow" ,&lt;BR /&gt;"labelExpressionInfo": {&lt;BR /&gt;"expression": "return $feature.Name;"},&lt;BR /&gt;"labelPlacement": "esriServerPointLabelPlacementCenterRight",&lt;BR /&gt;"multiPart": "labelPerFeature",&lt;BR /&gt;"minScale": "return $feature.MinScale;",&lt;BR /&gt;"maxScale": 0,&lt;BR /&gt;"symbol": {&lt;BR /&gt;"color": [255,255,255,255],&lt;BR /&gt;"haloColor": [51,51,51,255],&lt;BR /&gt;"haloSize": 1.5,&lt;BR /&gt;"font": {"size": 10, "weight": "bold"},&lt;BR /&gt;"type": "esriTS"}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My problem is that when doing LabelDefinition.FromJson method with this string, I get an invalid character exception on minScale&amp;nbsp;value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;MinScale attribute is a string defined in the attributes of each graphic and minScale key on the Json needs an integer. How can this conversion be done or how can I pass minScale value as a $feature value?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 11:07:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121241#M1333</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-02-08T11:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121242#M1334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gonzalo -&amp;nbsp;&lt;/P&gt;&lt;P&gt;You might want to take a look at the approach (and code) described in this blog:&amp;nbsp;&lt;A href="https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-net/blog/2018/03/29/label-features-the-easy-way"&gt;https://community.esri.com/community/developers/native-app-developers/arcgis-runtime-sdk-for-net/blog/2018/03/29/label-features-the-easy-way&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;In addition to making the code easier to work with and maintain, you have some control over how the values you're using are returned (int vs string, etc.).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thad&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;Sorry, after taking a closer look I see that the problem you're facing is getting the expression "return $Feature.MinScale" to provide an integer from the underlying string value.&lt;/P&gt;&lt;P&gt;I'm not sure, but it looks like the Arcade "Number" function might do the trick:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/function-reference/data_functions/#number" title="https://developers.arcgis.com/arcade/function-reference/data_functions/#number"&gt;Data Functions | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 20:37:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121242#M1334</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2019-02-08T20:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121243#M1335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the answer. I'm trying your recommendation using Number expresion like this just to test how it works and if I can use it. This is how I'm using it::&lt;BR /&gt; &lt;STRONG&gt;labelBuilder.AppendLine("\"minScale\": Number('700000','######'),");&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and I'm&amp;nbsp;getting following exception:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;"expecting NaN": Num : 303&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;What's the problem now?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:50:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121243#M1335</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-02-11T07:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121244#M1336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tested this a little on my end and I'm experiencing the same thing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's a nice tool here for testing Arcade expressions:&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/arcade/playground/" title="https://developers.arcgis.com/arcade/playground/"&gt;ArcGIS Arcade | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;and the `Number` expressions I tried were returning valid values. When I tried it in my labeling JSON, however, I got mixed results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I tried it in the labeling expression it worked. For example:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; color: #a31515;"&gt;"\"expression\": \" Number('1000000', '########') + ' meters';\"},"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the same expression fails when used for `minScale`:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 9.5pt; color: #a31515;"&gt;"\"minScale\": Number('1000000', '########'),"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure if the expression is supposed to work outside of the actual label expression. I'll look into that further and let you know what I find.&lt;/P&gt;&lt;P&gt;Thad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2019 17:53:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121244#M1336</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2019-02-14T17:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121245#M1337</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Arcade expressions are indeed only supported for use in label or rotation expressions. Other label properties (like minimum scale) cannot interpret Arcade. As ArcGIS Pro&amp;nbsp;enables more labeling properties to use expressions, ArcGIS Runtime will add support as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Feb 2019 18:11:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121245#M1337</guid>
      <dc:creator>ThadTilton</dc:creator>
      <dc:date>2019-02-14T18:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121246#M1338</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know when this functionality will be added?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Feb 2019 11:22:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121246#M1338</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-02-21T11:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121247#M1339</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any advance on this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 14:47:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121247#M1339</guid>
      <dc:creator>GonzaloMuöoz</dc:creator>
      <dc:date>2019-05-16T14:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: LabelDefinition with int parameter</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121248#M1340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only properties that are explicitly described as expressions, such as the `labelExpressionInfo.expression` or the `labelAngleInfo.angleExpressionInfo.expression` can (and must) contain an Arcade expression.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 May 2019 20:42:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/labeldefinition-with-int-parameter/m-p/121248#M1340</guid>
      <dc:creator>MichaelBranscomb</dc:creator>
      <dc:date>2019-05-16T20:42:19Z</dc:date>
    </item>
  </channel>
</rss>

