Geography-derived map elements that can be edited at runtime.
control. Editable Geographies
It can be configured in the property or in the code as follows:
MapGrid.EditableGeographies = !"None"
MapGrid.EditableGeographies = !"Points"
MapGrid.EditableGeographies = !"Lines"
MapGrid.EditableGeographies = !"Polygons"
Lines | It draws a line. |
None | Default value. No geography enabled to draw. |
Points | It draws a point. |
Polygons | It draws a polygon. |
Controls: Grid (Control Type: Maps)
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.
This property applies both at runtime and at design time.
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. When one of this events is triggered, where changes the edit mode by code, the GeographySaved event is called
Another User Event (SaveEdition) invoke the Save Edition method which stores the geographies drawn. It means, this event, ends the edition of that geography.
Event 'Points'
MapGrid.EditableGeographies = !"Points"
Endevent
Event 'Lines'
MapGrid.EditableGeographies = !"Lines"
Endevent
Event 'Polygons'
MapGrid.EditableGeographies = !"Polygons"
Endevent
Event 'None'
MapGrid.EditableGeographies = !"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-...."}]
To apply the corresponding changes when the property value is configured, execute a Build with this Only of the object.
This property is available since GeneXus 17.
Maps Control Type
Layers in Maps
GeographySaved Event
MarkerDragStarted Event
MarkerDragEnd Event
SaveEdition method
Clear method in Grids with Control Type = Maps