Very often in mobile apps we have the need to either record the physical location of the device or we have a need to get the location of a device for other things such as showing maps, etc.

WebApp doesnt have built in support for GEO Location handling

StarZen Technologies built a custom control for WebApp that allows you to easily add GEO Location handling to your web applications

Adding support for GEO Location is very easy

Simply add an object of class cszGEOLocation

Object oGEOLocationHelper is a cszGEOLocation
	Set pbServerOnLocationChanged to True

	// automatically aquire location on creating the control on the client side?
	// this happens only the first time the control is created in the browser        
	// Set pbAutoLocation to True/False
	
	Procedure OnLocationChanged Integer iStatus String sLongitude String sLatitude
		String sErrorMessage sStatusTime
		Integer iLastErrorCode
		
		WebGet psStatusTime of oGEOLocationHelper to sStatusTime
		WebGet psLastError of oGEOLocationHelper to sErrorMessage
		WebGet piLastErrorCode of oGEOLocationHelper to iLastErrorCode
		
		WebSet psValue of oStatus to iStatus
		WebSet psValue of oStatusTime to sStatusTime
		WebSet psValue of oLongitude to sLongitude
		WebSet psValue of oLatitude to sLatitude

		WebSet psValue of oLastError to (trim(iLastErrorCode)+" - "+trim(sErrorMessage))
	End_Procedure   
End_Object

There is a property called pbAutoLocation that allows the user to control whether the GEO Location object will automatically attempt to get location on creation.

The class has an event called OnLocationChanged that fires whenever a location is found

The class also has a method called RequestGetLocation that asks the control to get a new location. This location will then be returned by a call to the OnLocationChanged event.

This class as well as others are available from StarZen Technologies, Inc.

Michael Salzlechner is the CEO of StarZen Technologies, Inc.

He was part of the Windows Team at Data Access Worldwide that created the DataFlex for Windows Product before joining StarZen Technologies. StarZen Technologies provides consulting services as well as custom Application development and third party products specifically for DataFlex developers