Maps - LoadKmlLayer Method

Official Content
This documentation is valid for:

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

Syntax

MapGrid.LoadKmlLayer(LayerId, &VarLayerData, AllowSelection)

Where:

MapGrid
   Is a grid whose Control Type property is set to Maps.

LayerIId
   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.
 

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)

Scope

Objects:  Panel
Generators:  Apple, Android

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 V17 U11, 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

Maps
Maps - DrawGeoLine Method (deprecated)