Adding Geolocation and Map view to your app

It is very easy to add full geo location and map view to an existing application.

Download Geo Location Sample

Add a 2 new columns to your existing table structure

Config.tables["defects"] = "id;name;geo;address;owner;date DATE";

Get the phone current location and address during new record creation

In the code to insert a new record,
function newDefect() {
    var values = { date:, owner:User.getName(), name:"new defect" };
    values.geo = Settings.getLocation();
    values.address = Settings.getAddress(values.geo);
    var id = Query.insert("defects", values);

Display the record on a map, with clickable pins

use Map.addItem(label, geo, onclick) and to display all records on a map with click links

function viewMap() {
    var defects ="defects", "id;name;geo");
    for (var i = 0; i < defects.length; i++) {
        var defect = defects[i];
        Map.addItem(, defect.geo, "viewDefect({})");