-
Notifications
You must be signed in to change notification settings - Fork 664
How to read from CSV for Google Maps
agershun edited this page Dec 28, 2014
·
4 revisions
Source: StackOverflow.com
The CSV file is as follows : data.csv
'Chicago', 41.878113, -87.629798, 4
'New York', 40.714352, -74.005973, 5
'Los Angeles', 34.052234, -118.243684, 3
'Phoenix', 33.4483771, -112.0740373, 2
'Dallas', 32.7802618, -96.8009781, 5
I am reading the csv (data.csv) and copying it into an array data, and copying data to citymap.
I recommend use more complicated CVS parser for CVS parsing. Alasql library can loading and parsing CSV files (XLSX as well):
alasql('SELECT MATRIX * FROM CVS("data.csv", {headers:false})',[],function(data){
// process data array
});
This is working at jsFiddle.
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo