You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to add a Point on Google Map in Jupyter Notebook as follows:
importgmapsAPI_Key='CJJUIIEaSyBpv6a'# This is not the legit key, I have not provided a real API key to avoid misuse and for security reasonsgmaps.configure(api_key=API_Key)
centroid_lat, centroid_long= (82.301581497344834, 110.89898182803991)
center_coordinates= (centroid_lat, centroid_long)
fig=gmaps.figure(center=center_coordinates, zoom_level=13.5)
P=gmaps.Point(center_coordinates)
point_layer=gmaps.drawing_layer(features=[P])
fig.add_layer(point_layer)
fig
However, I am getting following error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-35-baba23e890bf>in<module>
10 #driving_layer = gmaps.heatmap_layer(coordinates)
11 P = gmaps.Point(center_coordinates)
---> 12 point_layer = gmaps.drawing_layer(features=[P])
13 fig.add_layer(driving_layer)
14 fig
...~/anaconda3/envs/dbn/lib/python3.7/site-packages/ipykernel/jsonutil.py in json_clean(obj)
195
196 # we don't understand it, it's probably an unserializable object
--> 197 raise ValueError("Can't clean for JSON: %r" % obj)
ValueError: Can't clean for JSON: <gmaps.geotraitlets.Point object at 0x7fb6f1e3a490>
I don't understand error fully. Please help, if you have experience on using gmaps.
Thanks.
The text was updated successfully, but these errors were encountered:
I am trying to add a Point on Google Map in Jupyter Notebook as follows:
However, I am getting following error:
I don't understand error fully. Please help, if you have experience on using gmaps.
Thanks.
The text was updated successfully, but these errors were encountered: