GLM_GeoMap.createMap();
var lat = $("#lat").val();
var lon = $("#lon").val();
-// console.log('Lat: ' + lat);
-// console.log('Lon: ' + lon);
-// console.log('Loc:' + $("#loc").length);
var latDeg = $("#latDeg");
var lonDeg = $("#lonDeg");
var latDir = $("#latDir");
var lonMin = $("#lonMin");
var latSec = $("#latSec");
var lonSec = $("#lonSec");
-// console.log('Lat[deg]: ' + latDeg.val());
-// console.log('Lon[deg]: ' + lonDeg.val());
-// console.log('Lat[dir]: ' + latDir.val());
-// console.log('Lon[dir]: ' + lonDir.val());
-// console.log('Lat[min]: ' + latMin.val());
-// console.log('Lon[min]: ' + lonMin.val());
-// console.log('Lat[sec]: ' + latSec.val());
-// console.log('Lon[sec]: ' + lonSec.val());
var hemiLat = (latDir.val() == '1')
? LocationFormatter.NORTH
: LocationFormatter.SOUTH;
parseInt(lonSec.val()),
hemiLon
);
- console.log('Lat: ' + lat);
- console.log('Lon: ' + lon);
if ($("#loc").length > 0) {
var location = $("#loc").val();
if (lat && lon) {
GLM_GeoMap.createWithLatLon(lat, lon);
} else if (location) {
- console.log('Creating with location' + location);
GLM_GeoMap.createWithLocation(location);
} else if (street || city || state || zip) {
- console.log('Creating with street,city,state,zip');
GLM_GeoMap.createWithAddress(street, city, state, zip);
} else {
- console.log('Creating with client location');
GLM_GeoMap.createWithClientLocation();
}
},
createWithClientLocation: function() {
// Try HTML5 geolocation
if (navigator.geolocation) {
- console.log('Found location with HTML5');
navigator.geolocation.getCurrentPosition(function(position) {
var pos = new google.maps.LatLng(
position.coords.latitude,
};
LocationFormatter.DMSToDecimal = function(degrees, minutes, seconds, hemisphere) {
- console.log('DMSToDecimal: '
- + degrees + ' '
- + minutes + ' '
- + seconds + ' '
- + hemisphere);
var ddVal = degrees + minutes / 60 + seconds / 3600;
ddVal = (hemisphere == LocationFormatter.SOUTH || hemisphere == LocationFormatter.WEST) ? ddVal * -1 : ddVal;
return LocationFormatter.roundToDecimal(ddVal, 5);