Get geolocation from label info
I am building an app that stores the latitude and longitude when a record is saved. What i am trying to do with no sucess is show the location on a map with the user views the record. I get the alert text saying that it did not find it.
I have the Lat and Long displayed in hidden labels and I am using the following javascript on a button click on the screen.
var latlocation = Tiggr ('latDataView');
var longlocation = Tiggr ('longDataView');
if (latlocation.val() == ' ') {
alert ('Did not find Latitude in database.');
return;
}
if (longlocation.val() == ' ') {
alert ('Did not find Longitude in database.');
return;
}
var map = Tiggr('_viewgeolocation');
map.options['latitude'] = latlocation.val();
map.options['longitude'] = longlocation.val();
map.refresh();