var input = document.getElementById('Files');
var files = input.files;
for(var i = 0; i < files.length; i++)
{
var file = files[0];
var reader = new FileReader; // use HTML5 file reader to get the file
reader.onloadend = function () {
// get EXIF data
var exif = EXIF.readFromBinaryFile(new BinaryFile(this.result));
var lat = exif.GPSLatitude;
var lon = exif.GPSLongitude;
//Convert coordinates to WGS84 decimal
var latRef = exif.GPSLatitudeRef || "N";
var lonRef = exif.GPSLongitudeRef || "W";
lat = (lat[0] + lat[1]/60 + lat[2]/3600) * (latRef == "N" ? 1 : -1);
lon = (lon[0] + lon[1]/60 + lon[2]/3600) * (lonRef == "W" ? -1 : 1);
//Send the coordinates to your map
Map.AddMarker(lat,lon);
}
reader.readAsBinaryString(file);
}
https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=fl_featureCollection
Search thousands of free JavaScript snippets that you can quickly copy and paste into your web pages. Get free JavaScript tutorials, references, code, menus, calendars, popup windows, games, and much more.
Subscribe to:
Post Comments (Atom)
The 6 New Rules of Communicating
The era of teleprompters and talking points has come to an end ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ...
-
code.gs // 1. Enter sheet name where data is to be written below var SHEET_NAME = "Sheet1" ; // 2. Run > setup // // 3....
No comments:
Post a Comment