Kml: How to set line width that changes with scale/zoom (support for gx:physicalWidth?)

599
0
05-12-2023 06:24 AM
SokoFromNZ
Occasional Contributor

Hi,

I successfully loaded KMLs in OperationalLayers and now try to change the stroke/line-width of some lines in there.

This works as expected: sets the line width to 150 pixel. Therefore the line has a constant width on a device...

<Placemark id="kml_3">
 <name>kml_3</name>
 <Style>
   <LineStyle>
    <color>ff0000ff</color>
    <width>150</width>
   </LineStyle>
  </Style>
 <LineString>
   <coordinates>6.47687246450881,51.759226245738,0.0 6.47686836555455,51.7592282453517,0.0</coordinates>
  </LineString>
</Placemark>

 

With https://developers.google.com/kml/documentation/kmlreference#gxphysicalwidth I am able to set the width of the line in meters:

<Placemark id="kml_3">
 <name>kml_3</name>
 <Style>
   <LineStyle>
    <color>ff0000ff</color>
    <gx:physicalWidth>10</gx:physicalWidth>
   </LineStyle>
  </Style>
 <LineString>
   <coordinates>6.47687246450881,51.759226245738,0.0 6.47686836555455,51.7592282453517,0.0</coordinates>
  </LineString>
</Placemark>

This works nicely on earth.google.com, but does not seem to have any effect if I load the KML into ArcGIS Runtime (doesn't matter if Windows, MAUI, etc.).

I did put the namespace xmlns:gx="http://www.google.com/kml/ext/2.2" as an attribute to kml as required...

Is there a special switch I have to activate so physicalWidth works? Or is it simply not supported? If not: Is there another way to set the line width (or a relative line width to other lines) which changes with scale/zoom?

Thanks

Soko

0 Kudos
0 Replies