Integrating Google maps with apps are quite popular. A business for example would like to see distributions of incidents on a map and combine this with workflow to show which areas require additional resources to clear task backlogs.
Integrating Google maps with K2 is very simple. Let’s start by creating a simple K2 SmartForm view that will host the Google map. Drag in a K2 data label that will contain the map’s image HTML code.
K2 Automated Testing Software
BenchQA allows full test automation of K2, including fully automated K2 SmartForms and K2 Workflow testing. It promotes test driven development for K2 and ensures continued quality assurance for K2 solutions. Easily apply changes to test cases to accommodate changes to K2 apps and ensure all apps are regression tested to avoid defects and assure continuous quality.
Next, drag in textboxs for the longitude and latitude coordinates. Also add a button that an event and K2 action can be associated with to load the Google map a K2 SmartForm.
Create a new K2 expression called Map URL. The value of this is created by using the standard Google map URL and appending the Longitude and Latitude coordinates’ values. Drag these from the right hand side context window into the K2 expression box.
Create another K2 expression called Map Image that contains the map’s HTML code and the Map URL as the src attribute’s value.
Now, on the host K2 View that contains the Google map, add a new K2 Data Transfer rule to the Load Map button’s click event. Drag the Map Image expression into the value of the Google Map Data Label.
Save the K2 SmartForm view and open the view, enter a longitude & latitude value and click on Load Map. The Google map displays in the K2 SmartForm
An enhancement to the feature is to derive he coordinates from an address. More about that in a next blog.
About Velocity IT
For more downloads and further information on K2 workflow and K2 SmartForm solutions, please visit Velocity IT