I am doing a project about web crawler.
I will got some point location include (Name, longitude, latitude)
Then point all of them in Google Map(use Google Map API)
First
I got some data from the website API. -- (300points locaiton)
Then use Python pandas DataFrame to export Json File
df = pd.DataFrame(total, columns=['name','lat', 'lng'])
df['lat'] = pd.to_numeric(df['lat'])
df['lng'] = pd.to_numeric(df['lng'])
jsonFile = df.to_json(orient='records')
with open('map.json','w') as f:
f.write(jsonFile)
json structure look like this
{
"name":"臺中女中",
"lat":24.13604,
"lng":120.6778
}
So here is the problem:
How can I import those of point to Google Map use Google Map API
I've tried to read the Google Map API Document, it just tell me to use
map.data.loadGeoJson('map.json');
Finally i got wrong. and the Error Message
uncaught exception: InvalidValueError: not a Feature or FeatureCollection
Is Google Map API only support GeoJson?
How can I change my json file to the GeoJson?
or how can I modify my json file that can use in Google Map API.
Thank you very much.