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

Respect img height/width in addImage api #4531

Merged

Conversation

AndyMoreland
Copy link
Contributor

@AndyMoreland AndyMoreland commented Apr 2, 2017

When the user passes an img tag with a height and width that differ from the native height and width of the source image, mapbox should respect the user's choice and draw the scaled image. Currently mapbox draws image at its native size and then clips it to fit the specified height/width, which is unintuitive.

Example:

I use addImage to add this image tag. It's a 64x64 png natively, but I want to pretend it's 32x32.

screen shot 2017-04-02 at 4 08 01 pm

When mapbox draws it, I see:

screen shot 2017-04-02 at 4 09 00 pm

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.

Thanks!

When the user passes an image tag with a height and width
that differ from the native height and width of the src,
mapbox should respect the user's choice and draw the scaled
image.
@jfirebaugh jfirebaugh force-pushed the respect-img-tag-height-and-width branch from f126a3b to 9be6e8f Compare April 3, 2017 14:05
@jfirebaugh jfirebaugh merged commit 5d0a8b7 into mapbox:master Apr 3, 2017
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.

2 participants