Editable Geographies property

Official Content
This documentation is valid for:
Geography-derived map elements that can be edited at runtime.

Syntax

control. Editable Geographies

It can be configured in the property or in the code as follows:

MapGrid.EditableGeographies = EditMode.None
MapGrid.EditableGeographies = EditMode.Points
MapGrid.EditableGeographies = EditMode.Lines
MapGrid.EditableGeographies = EditMode.Polygons

Values

Lines It draws a line.
None Default value. No geography enabled to draw.
Points It draws a point.
Polygons It draws a polygon.

Scope

Controls: Grid (Control Type: Maps)

Description

It applies to Grids with their Control type property = Maps Control Type and allows drawing a specific geography at runtime.

The SaveEdition method and GeographySaved event allow programming geography editing. In addition, the SDT MapGeographies stores the geographies drawn.

Run-time/Design-time

This property applies both at run-time and at design-time.

Samples

A Panel object with a Maps grid could define four User Events (Points, Lines, Polygons, None), to change the geography to draw or turn off the edition. Another User Event (SaveEdition) stores the geographies drawn, 

Event 'Points'
    MapGrid.EditableGeographies = EditMode.Points
Endevent

Event 'Lines'
    MapGrid.EditableGeographies = EditMode.Lines
Endevent

Event 'Polygons'
    MapGrid.EditableGeographies = EditMode.Polygons
Endevent

Event 'None'  
   MapGrid.EditableGeographies = EditMode.None
Endevent

Event 'SaveEdition'
    MapGrid.SaveEdition()
Endevent

Event MapGrid.GeographySaved(&Geography , &GeographyId)
    composite
        &GeographySDT = new()
        &GeographySDT.Id = &GeographyId
        &GeographySDT.Feature = &Geography
        &Geographies.Add(&GeographySDT)
    endcomposite
Endevent

where the variable & Geographies is based on MapGeographies Collection and is where all geographies are stored.

If it is displayed, for example, in a user event, the content of & Geographies.Tojson () will look as follows:

[{"Feature": "POINT(-56.163397898 -34.653212890)", "Id":"4f9dc59...."};
  {"Feature":"LINESTRING(-56.163397898 -34.653212890, -56.163397898 -34.576488320)", "Id": "ec3f-...."};
  {"Feature":"POLYGON(-56.163397898 -34.653212890, -56.163397898 -34.576488320, ...)", "Id": "7918ad1-...."}]

How to apply changes

To apply the corresponding changes when the property value is configured, execute a Build with this Only of the object.

Availability

This property is available since GeneXus 17.

See Also

Maps Control Type
Layers in Maps

Maps - GeographySaved Event
Maps - MarkerDragStarted Event
Maps - MarkerDragEnd Event

Maps - SaveEdition Method
Maps - Clear Method