Skip to content

enable changing the color of marker icons in a ScatterMapBox plot #6599

@serboba

Description

@serboba
<head>
	<!-- Load plotly.js into the DOM -->
	<script src='https://cdn.plot.ly/plotly-2.20.0.min.js'></script>
</head>

<body>
	<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
        <script>
        var data = [
	{
		type: "scattermapbox",
		mode: "markers+text+lines",
		lon: [-75, -80, -50],
		lat: [45, 20, -20],
                color:'red',
		marker: { size: 20, symbol: 'bus' },
		text: 'bus',
		textposition: "bottom right"
	}
];

var layout = {
	mapbox: { style: "outdoors", zoom: 0.7 },
	showlegend: false, height: 500, width: 700
};

var config = {mapboxAccessToken: mytoken};

Plotly.newPlot("myDiv", data, layout, config);

    </script>
</body>

I tried to change the color of the MAKI icons by trying to specify it inside marker dict but it does not work. However, changing the style of mapbox in the layout changes the color of the icons. So it should be possible to specify the color in the marker too (without changing the style). I could not find any information about this in the documentation.

Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions