Skip to content

Commit 1e12ea5

Browse files
authored
Update GeoLocationForPhoneGap.js
position sometimes returns longitude or latitude with more than 8 decimal places. The longitude and latitude have to be saved to a decimal field, which as 8 decimal places maximum, so this will return an error. By fixing the longitude and latitude to 8 fixed places, this issue can be avoided. https://mendixsupport.zendesk.com/agent/tickets/61300
1 parent f950eea commit 1e12ea5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/GeoLocationForPhoneGap/widget/GeoLocationForPhoneGap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ define([
7878
},
7979

8080
_geolocationSuccess: function(position) {
81-
this._obj.set(this.latAttr, position.coords.latitude);
82-
this._obj.set(this.longAttr, position.coords.longitude);
81+
this._obj.set(this.latAttr, +position.coords.latitude.toFixed(8));
82+
this._obj.set(this.longAttr, +position.coords.longitude.toFixed(8));
8383
this._executeMicroflow();
8484
},
8585

0 commit comments

Comments
 (0)