Map
Description
Allows you to place an interactive geographical map of Google Maps on the form, with the ability to put on the map markers, lines and polygons (placing lines and polygons is done using scripts.).
You can map one or more markers, then save their locations to the database. This component is assigned to two database fields via the TableName properties, FieldLatitude and FieldLongitude. The database fields to be used must be of the type "REAL".
Put a marker on the map through the context menu of a component (right mouse click) or by using the form on which you can place components to assign additional data to the marker (FormMarker property).
Component properties
Property |
Description |
TableName |
Determines which database table a component belongs to. |
FieldLatitude |
Determines to which field of the database table belongs the latitude of the placed marker on the map. |
FieldLongitude |
Determines to which field of the database table belongs the longitude of the placed marker on the map. |
Name |
Specifies the name of the component. |
Left |
Specifies the horizontal coordinate of the left edge of a component relative to its parent. |
Top |
Specifies the Y coordinate of the upper-left corner of a control, relative to its parent or containing control in pixels. |
Width |
Specifies the horizontal size of the control in pixels. |
Height |
Specifies the vertical size of the control in pixels. |
TabOrder |
Indicates the position of the control in its parent's tab order. |
TabStop |
Determines if the user can tab to a control. |
Visible |
Specifies whether the component appears onscreen. |
Anchors |
Specifies how the control is anchored to its parent. More info. |
Additional properties
Property |
Description |
APIKey |
Optionally specify an API Key to identify the application with the Google Maps API. Get an API key from Google service |
Constraints |
Specifies the size constraints for the component. It makes sense when using the Anchors property. |
Enabled |
Controls whether the component responds to mouse and keyboard events. |
DefaultLatitude |
Sets the latitude value for the default position. |
DefaultLongitude |
Sets the longitude value for the default position. |
DefaultToCurrentLocation |
Sets the current location as the default position. DefaultLatitude and DefaultLongitude are ignored if set to true. |
DisableDoubleClickZoom |
When set to true, disables zoom functions when double-clicking. |
DisableMenu |
Allows you to disable the context menu. |
DisablePOI |
When set to true, disable display of the points of interest on the map. |
Draggable |
When set to true, the entire map can be moved around in the control. |
EnableKeyboard |
When set to true, enables the use of the keyboard for controlling panning in the map (or in street view mode). |
FormMarker |
Allows you to select the form to create/edit the marker, so you can specify additional information for the marker. More info. |
Language |
Allows you to select the interface language on the map. |
MapType |
Sets the type of map (roadmap, hybrid, satellite, topographic) |
MarkerIcon |
Set the path to the image file to use as a marker icon. More info. |
MarkersDraggable |
Allows you to move markers on the map with the mouse. |
MarkerInfoHTML |
Allows you to set the text of the tooltip, which will be shown when you click on the marker. Supports HTML and inserting data from the database. More info. |
ScrollWheel |
When set to true, enables the use of the scroll wheel. The scroll wheel can be used to zoom in and out on the map. |
ShowBicycling |
When set to true, and if available in your country, bicycle trail information can be displayed on the map. |
ShowTraffic |
When set to true, and if available in your country, traffic information can be displayed. |
ZoomMap |
Is to be used to set the default zoom at startup. The zoom value is a value between 1 and 21 with 21 being the highest zoom level. |
More information about putting markers on the map
Like other components, a map may contain information that can be stored in a database. Such information is the markers located on it. Thus, you can save to the database geographical coordinates of the object you need, which will be marked on the map as a marker.
To save the location of the marker on the map, you need to use two fields in the database simultaneously. Which is natural, because geographic coordinates consist of two parts, Latitude and Longitude.
Thus, to be able to put the marker on the map and save its location in the database, in the database table you need to create two fields with the type "REAL". Why is it a real number? Coordinates are represented as degrees, for example: 55.755831°, 37.617673°, which corresponds to this type of data.
You can map one or more markers. You can read more about this below.
Putting one marker on the map
In this case, using the component is no different from others. Just specify which database table and which database fields belong to this map using the TableName, FieldLatitude and FieldLongitude component properties. Then add this component to the list in the "Save Record" button settings.
Putting more than one marker on the map
To be able to put several markers on the map and save their location, you need to create a separate database table, which will store records of these markers.
These markers will be child records and in this table you must have a foreign key to the parent table.
Putting several markers on the map can be compared to using the "TableGrid" component to work with child records, i.e. in our case markers will be child records.
An example of a database structure, when a company may have several offices and they need to be marked on the map.