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

custom colors for default markers #6416

Merged
merged 1 commit into from
Mar 29, 2018
Merged

custom colors for default markers #6416

merged 1 commit into from
Mar 29, 2018

Conversation

andrewharvey
Copy link
Collaborator

closes #6412

Launch Checklist

  • briefly describe the changes in this PR

Allows users to customize the color of the default Marker (option 1 at #6412 (comment))

  • write tests for all new functionality
  • document any changes to public APIs
  • post benchmark scores
  • manually test the debug page

selection_858

I haven't used the style-spec Color type as it outputs rgba and SVG doesn't accept alpha in the color, https://www.w3.org/TR/SVG/types.html#DataTypeColor

Copy link
Contributor

@jfirebaugh jfirebaugh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@jfirebaugh jfirebaugh merged commit daa737d into master Mar 29, 2018
@jfirebaugh jfirebaugh deleted the 6412-marker-color branch March 29, 2018 00:05
@qvs5010
Copy link

qvs5010 commented Mar 29, 2018

Hi

Outstanding !!!!, are the changes live, can we use, or must we wait for a version upgrade?

v0.44.1/mapbox-gl.js

    var r = Math.round(Math.random() * 255);
    var g = Math.round(Math.random() * 255);
    var b = Math.round(Math.random() * 255);

    var marker = new mapboxgl.Marker({
        color: `rgb(${r}, ${g}, ${b})`
    })

@qvs5010
Copy link

qvs5010 commented Mar 29, 2018

Oh, I basically answered my self... lol, "not yet"

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

Successfully merging this pull request may close these issues.

allow customization of the default marker color
3 participants