Official Content

Draws geometries given by a KML file in a Panel Grid whose Control Type property is set to Maps.

Syntax

GridControlName.LoadKmlLayer(LayerId, &VarLayerData, AllowSelection)

Where:

GridControlName
   Grid control name whose Control Type property is set to Maps.

LayerId
   Is the logical name of the KML file (Character data type).

&VarLayerData
   Is a variable with the KML file content (Longvarchar data type).

AllowSelection
   
Is a boolean value.

Scope

Objects:  Grid (Control Type: Maps)
Generators:  Apple, Android

Samples

&kmlString = '<kml>'
&kmlString += '<Document>'
&kmlString += '    <Style id="MyLine">'
&kmlString += '      <LineStyle>'
&kmlString += '       <color>802080ff</color>'
&kmlString += '       <width>6</width>'
&kmlString += '      </LineStyle>'
&kmlString += '    </Style>'
&kmlString += '     <Placemark>'
&kmlString += '        <LineString>'
&kmlString += '           <coordinates>-88.076680,43.945580 -88.077480,43.945930  -88.082470,43.942310 </coordinates>'
&kmlString += '        </LineString>'
&kmlString += '       <styleUrl>#MyLine</styleUrl>'
&kmlString += '     </Placemark>'
&kmlString += '</Document>'
&kmlString += '</kml>'

MapGrid.LoadKmlLayer("MyKml",&kmlString,false)
MapGrid.SetLayerVisible("MyKml",true)

Considerations

This method only applies to events on the client, such as user events.

To draw geometries on the server, use the Location Attribute property.

The Refresh event keeps the geometries drawn by this method.

To clear these geometries, use the Clear method or the SetLayerVisible method.

Availability

This method is available since GeneXus 17.

Compatibility

Since GeneXus 17 Upgrade 11, the Refresh method keeps the geometries drawn by LoadKmlLayer. Previous versions delete these geometries. In order to maintain the previous behavior, use the Grid.Clear method in the Refresh event.

Event Grid.Refresh()
      GridMaps.Clear()
EndEvent
This LoadKmlLayer Method is the same as the one named LoadKml in previous versions (since GeneXus X Evolution 3).

See Also

DrawGeography method

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant