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 “TrainingCustomerDSO” 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.