gmaps icon indicating copy to clipboard operation
gmaps copied to clipboard

fig.add_layer is not working

Open abzakh opened this issue 4 years ago • 1 comments

Hello,

I've been trying to plot some data on a map using gmaps, however with no luck..

This is the code I'm running:

locations = locations_df[['latitude','longitude']] weights = locations_df['category'] fig = gmaps.figure fig.add_layer(gmaps.heatmap_layer(locations, weights=weights)) fig

And this is output of that piece of code:

AttributeError Traceback (most recent call last) in 3 weights = locations_df['category'] 4 fig = gmaps.figure ----> 5 fig.add_layer(gmaps.heatmap_layer(locations, weights=weights)) 6 fig

AttributeError: 'function' object has no attribute 'add_layer'

abzakh avatar Aug 16 '20 19:08 abzakh

Line 4, you've not called the figure function, only assigned it to another variable. You need to add parenthesis after gmaps.figure.

JPeroutek avatar Jul 24 '21 17:07 JPeroutek