Sample input ::
FieldValue = 51.467696956223364, -0.1153564453125;
function GetStringCoordinate (FieldValue) {
if (FieldValue != null && FieldValue != undefined && FieldValue != '') {
var coordinateArray = FieldValue.split(',');
if (coordinateArray.length == 2) {
var latFloat = parseFloat(coordinateArray[0]);
var lngFloat = parseFloat(coordinateArray[1]);
//latitude formatting
var latCh = coordinateArray[0] > 0 ? 'N' : 'S';
var latD = Math.trunc(coordinateArray[0]);
var latM = Math.trunc(coordinateArray[0] * 60 % 60)
var latS = Math.trunc((Math.abs(coordinateArray[0]) * 3600) % 60)
var latStr = latD + "° " + latM + "′ " + latS + "″ " + latCh;
//longitude formatting
var lngCh = coordinateArray[1] > 0 ? 'E' : 'W';
var lngD = Math.trunc(coordinateArray[1]);
var lngM = Math.trunc(coordinateArray[1] * 60 % 60)
var lngS = Math.trunc((Math.abs(coordinateArray[1]) * 3600) % 60)
var lngStr = lngD + "° " + lngM + "′ " + lngS + "″ " + lngCh;
}
return latStr + ', ' + lngStr;
}
return '';
};
Windows 7, Linux, Mac, JavaScript, jQuery, ExtJs, Angular, .NET, Java, Android, iOS, php, mysql, lucene and more...
Showing posts with label Google Maps. Show all posts
Showing posts with label Google Maps. Show all posts
Subscribe to:
Posts (Atom)
-
Recently I purchased nord-vpn for testing. But I could not use their service due to a technical reason. So I wanted to cancel and get my mo...
-
Hi All I couldn't debug my C# class library project due to this issue for last few month. So this is the fix. 1. Right mouse click on...
-
Lucene - Previous 1. Add Lucene.net to your application. Copy Lucene.Net project to your solution folder or copy Lucene.Net.dll to your ...