Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fig.add_layer is not working #344

Open
abzakh opened this issue Aug 16, 2020 · 1 comment
Open

fig.add_layer is not working #344

abzakh opened this issue Aug 16, 2020 · 1 comment

Comments

@abzakh
Copy link

abzakh commented Aug 16, 2020

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'

@JPeroutek
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants