Skip to content

mapbox doesn't render points on jupyter notebook running on Databricks.  #192

@keval-ll

Description

@keval-ll

I am running jupyter notebook on a Databricks cluster and attempting to render a map. I tried the example from the documentation to test and it doesn't plot the points.

python 3.9
mapboxgl 0.10.2

# Load data from sample csv
 data_url = 'https://raw.githubusercontent.com/mapbox/mapboxgl-jupyter/master/examples/data/points.csv'
 df = pd.read_csv(data_url)
 
 # Must be a public token, starting with `pk`
 token = mapbox_token
 
 # Create a geojson file export from a Pandas dataframe
 df_to_geojson(df, filename='points.geojson',
               properties=['Avg Medicare Payments', 'Avg Covered Charges', 'date'],
               lat='lat', lon='lon', precision=3)
 
 # Generate data breaks and color stops from colorBrewer
 color_breaks = [0,10,100,1000,10000]
 color_stops = create_color_stops(color_breaks, colors='YlGnBu')
 
 # Create the viz from the dataframe
 viz = CircleViz('points.geojson',
                 access_token=token,
                 height='400px',
                 color_property = "Avg Medicare Payments",
                 color_stops = color_stops,
                 center = (-95, 40),
                 zoom = 3,
                 below_layer = 'waterway-label'
               )
 viz.show()


Screenshot 2023-03-31 at 5 10 31 PM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions