Google Maps
GoogleMap widget can be used for many purposes such as finding nearby places (restaurants, gas stations, etc), finding directions to a destination etc.
The implementation of google maps includes the following steps:
To enable users to use the map, the collection for map configuration and markers must be created
- Go to Database section from the Dashboard menu or the Navigation menu within the App Builder(left side of the screen).
- Click + New collection and create your collection (e.g. mapConfig).

- After, click on the + New Document.
- Insert document name.
- Click the + Add field button.
- In the key box, enter the name of the field and enter the value.
- Click Confirm Button.

Changing the Map style allows you to change the overall theme of the map.

When users open the map, it should show some location at first. Setting the initial location allows your users to see the map with a specific location or user's current location when it opens up.
To open a map with a specific location:
- Move to the Documents created earlier in CMS and enter the initialPositionLat and initialPositionLng properties.
- Enter the values in the respective properties.
To get the lat long values for any location, open to Google Map, right-click on any place and click on the first item from the list.

To change the initial zoom level of the map:
- Move to the Documents created earlier in CMS and enter the initialZoomLvl of Map property and enter the value.

A marker is an icon that appears over the map indicating a location. This section describes how to work with markers in your Teta project.
Adding markers to the map comprises the following steps:
- Go to Database section from the Dashboard menu or the Navigation menu within the App Builder(left side of the screen).
- Click + New collection and create your collection (e.g. mapMarkers).

- Click on the + New Document.
- Insert document name.
- Click the + Add field button.
- In the key box, enter the name of the field and enter the value.
- Click Confirm Button.

The Properties Panel can be used to customize the behavior of your Marker.
To set the Latitude/Longitude of the Marker:
- Move to the Documents created earlier in CMS and enter the Lat and Lng properties.
- Enter the values in the respective properties.

- Move to the Documents created earlier in CMS and enter the icon property.
- Enter the link of the image you want to use as a marker in the respective property.

To set the iconWidth / iconHeight of the Marker:
- Move to the Documents created earlier in CMS and enter the iconWidth and iconHeight properties.
- Enter the values in the respective properties.

To set the path from the user location to the marker:
- Move to the Documents created earlier in CMS and enter the drawDistance property.
- Enter the values in the respective properties.

To add the Google maps Controller widget in your project:
- Go to the Scaffold.
- Add a State and as type enter Google maps controller.
- Go to Google Maps.

-
- Find Collection and specify the name of the collection from which to take the map data.

- Find Collection and specify the name of the collection from which to take the markers data.

- Select Google Maps of the Tree Area.
- Find Map Config Datataset and select the widget from which to take the map data, MapConfig.
- Find the dropdown below related to the map and select the value you are interested in.

- Find Marker Datataset and select the widget from which to take the map data, mapMarkers.
- Find the dropdown below related to the markers and select the value you are interested in.

Last modified 6mo ago