Skip to content

Some Scattermapbox Symbols Not Available #1804

Closed

Description

This issue was first reported in #891, but it doesn't seem like it was fully understood or addressed. I found another post on the community forums about the same thing at https://community.plot.ly/t/solved-symbol-changes-not-showing-up-with-scattermapbox/1638

I am able to use only a subset of the icons found on https://labs.mapbox.com/maki-icons/. When I use "bus" or "embasssy" as the symbol, I see the icon without issue. When I change the symbol to "home" or "wheelchair", the icon is not rendered. It's as though only a subset of the mapbox icons are actually available. An excerpt from my code is copied below. This is intended to show a "wheelchair" icon, but it does not appear to work.

        vehicle_fig.add_trace(go.Scattermapbox(
            name='Stop',
            lat=stop_lat,
            lon=stop_lon,
            mode='markers',
            marker=go.scattermapbox.Marker(
                size=15,
                symbol='wheelchair'
            ),
            showlegend=False,
            text=stop_address,
            hoverinfo='text',
            hoverlabel=dict(bgcolor='#735139',
                            font=dict(color='white',
                                      size=20))
        ))

Activity

  1. theGreatRaphael commented on Dec 10, 2019

    @theGreatRaphael

    I'm facing the same problem right now.
    The icon heart e. g. is also not working.

  2. Joel-Wong0794 commented on May 18, 2020

    @Joel-Wong0794

    Hi,
    Has anyone found a solution? I am only able to plot points when I set symbol = "circle".

  3. mindless-bureaucrat commented on Jul 20, 2020

    @mindless-bureaucrat

    Same for me. I'm not connecting to a mapbox server, instead using WMS basemaps. Could that be the problem?

  4. BerserkerGaruk commented on Aug 28, 2020

    @BerserkerGaruk

    I found a solutions for this. Plotly/Dash uses the Maki icon set made by mapbox icons. Most of the icons in this icon set are not loaded into the default themes in mapbox such as monochrome. I was able to get icons other than circle to work by editing the theme I was using in mapbox studio by dragging the .svgs from the maki icon set into the browser window and then publishing the theme changes. After waiting for about 10 mins I was able to set and see icons other than the circle.

  5. khurramkhalil commented on Apr 27, 2022

    @khurramkhalil

    I am facing the exact same problem right now.
    The icon airport/airfield etc. are not working.

  6. nicolaskruchten commented on Apr 27, 2022

    @nicolaskruchten
    Contributor

    It's important to note that the special icon symbols only work when using a Mapbox-provided style, per the documentation: https://plotly.com/python/scattermapbox/#set-marker-symbols

  7. AIMPED commented on Mar 12, 2024

    @AIMPED

    Hey there,

    The graph provided in the link provided by @nicolaskruchten renders just fine with my mapbox token. However, if y change the "airport" icon to "cross", the cross is not rendered. See also this discussion on the plotly forums.

    https://community.plotly.com/t/scattermapbox-marker-symbol/82957

  8. self-assigned this
    on Jul 8, 2024
  9. removed their assignment
    on Aug 2, 2024
  10. gvwilson commented on Aug 12, 2024

    @gvwilson
    Contributor

    @archmoj will this be addressed by your recent work?

  11. amctier-i360 commented on Sep 5, 2024

    @amctier-i360

    @BerserkerGaruk How did you import your custom style after publishing? I can't find any documentation around importing custom styles from MapBox Studio.

    @gvwilson Do you have an estimate for when this might get addressed?

  12. emilykl commented on Aug 31, 2026

    @emilykl
    Contributor

    This issue is resolved with the addition of new Map traces (which use MapLibre) first added in plotly.py v5.24.0, which replace the Mapbox traces.

    Also, the Maki Icons version used by plotly was recently updated from v2 to v8, which should resolve any remaining issues with missing icons.

    In plotly.py v7.0.0, the following code (based on this example from the community forum):

    Show code
    import plotly.graph_objects as go
    
    icons = ['aerialway', 'airfield', 'airport', 'alcohol-shop', 'american-football', 'amusement-park', 'animal-shelter', 'aquarium', 'arrow', 'art-gallery', 'attraction', 'bakery', 'bank-JP', 'bank', 'bar', 'barrier', 'baseball', 'basketball', 'beach', 'beer', 'bicycle-share', 'bicycle', 'blood-bank', 'bowling-alley', 'bridge', 'building-alt1', 'building', 'bus', 'cafe', 'campsite', 'car-rental', 'car-repair', 'car', 'casino', 'castle-JP', 'castle', 'cemetery-JP', 'cemetery', 'charging-station', 'cinema', 'circle-stroked', 'circle', 'city', 'clothing-store', 'college-JP', 'college', 'commercial', 'communications-tower', 'confectionery', 'construction', 'convenience', 'cricket', 'cross', 'dam', 'defibrillator', 'dentist', 'diamond', 'doctor', 'dog-park', 'drinking-water', 'elevator', 'embassy', 'emergency-phone', 'entrance-alt1', 'entrance', 'farm', 'fast-food', 'fence', 'ferry-JP', 'ferry', 'fire-station-JP', 'fire-station', 'florist', 'fuel', 'furniture', 'gaming', 'garden-centre', 'garden', 'gate', 'gift', 'globe', 'golf', 'grocery', 'hairdresser', 'harbor', 'hardware', 'heart', 'heliport', 'highway-rest-area', 'historic', 'bbq', 'caution', 'danger', 'fitness-centre', 'home', 'logging', 'parking', 'ranger-station', 'school', 'teahouse', 'horse-riding', 'hospital-JP', 'hospital', 'hot-spring', 'ice-cream', 'industry', 'information', 'jewelry-store', 'karaoke', 'landmark-JP', 'landmark', 'landuse', 'laundry', 'library', 'lift-gate', 'lighthouse-JP', 'lighthouse', 'lodging', 'marker-stroked', 'marker', 'mobile-phone', 'monument-JP', 'monument', 'mountain', 'museum', 'music', 'natural', 'nightclub', 'observation-tower', 'optician', 'paint', 'park-alt1', 'park', 'parking-garage', 'parking-paid', 'pharmacy', 'picnic-site', 'pitch', 'place-of-worship', 'playground', 'police-JP', 'police', 'post-JP', 'post', 'prison', 'racetrack-boat', 'racetrack-cycling', 'racetrack-horse', 'racetrack', 'rail-light', 'rail-metro', 'rail', 'recycling', 'religious-buddhist', 'religious-christian', 'religious-jewish', 'religious-muslim', 'religious-shinto', 'residential-community', 'restaurant-bbq', 'restaurant-noodle', 'restaurant-pizza', 'restaurant-seafood', 'restaurant-sushi', 'restaurant', 'road-accident', 'roadblock', 'rocket', 'school-JP', 'scooter', 'shelter', 'shoe', 'shop', 'skateboard', 'skiing', 'slaughterhouse', 'slipway', 'snowmobile', 'soccer', 'square-stroked', 'square', 'stadium', 'star-stroked', 'star', 'suitcase', 'swimming', 'table-tennis', 'telephone', 'tennis', 'terminal', 'theatre', 'toilet', 'toll', 'town-hall', 'town', 'triangle-stroked', 'triangle', 'tunnel', 'veterinary', 'viewpoint', 'village', 'volcano', 'volleyball', 'warehouse', 'waste-basket', 'watch', 'water', 'waterfall', 'watermill', 'wetland', 'wheelchair', 'windmill', 'zoo']  # fmt: skip
    
    lon = [-105 + (i % 30) * 0.01 for i, _ in enumerate(icons)]
    lat = [40 - (i // 30) * 0.01 for i, _ in enumerate(icons)]
    
    fig = go.Figure(
        go.Scattermap(
            mode="markers+text",
            text=icons,
            lon=lon,
            lat=lat,
            marker={
                "size": 20,
                "symbol": icons,
                "color": "#1f77b4",
            },
        )
    )
    
    fig.update_layout(map_style="open-street-map", showlegend=False, height=800)
    
    fig.show()

    produces a map showing all the icons (you need to zoom in and pan around to see them all):

    Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions