1 Context:
In this task, we want to add a Google Maps integration to our screen to display the geo-position of customers. To do so we will utilize the SimpleSwatMap object and configure it accordingly. In the previous chapter, we linked customers to orders. When we click on an order entry, the corresponding customer is selected, and, by the end of this task, the corresponding geo-location will be displayed.
2 Result:
3 Step by step guide:
- Create a new tab (âPageâ) for your âSimpleSwatTabbarâ and call it âGeo Dataâ. If you need help review chapter 90
- Search in the panel âLibrary of Objectsâ for the object âSimpleSwatMapâ and drag and drop it on the tab site âGeo Dataâ on panel âAâ and select âSaveâ
- Go to the âFlow viewâ and create a connection between the âCustomerDSOâ and the âSimpleSwatMapâ with connection type âDisplayâ and select âSaveâ
- Select the object âSimpleSwatMapâ and navigate to the panel âAttributesâ and search for the attribute âMapAddressâ. Insert the value âCountry,City,Addressâ there and select âSaveâ
- Change the MapName attribute to âCountry,City,Addressâ
- Now launch the screen to preview your changes
4 Explanation:
By entering the core attributes "Country, City, Address" from the customer table, the values are taken and packaged into a request to the Google Maps API. Google then provides the geodata for this request in the response, which is displayed in the control. Such a control is one of the many connectors provided by Build.One.