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

Add ability to set an angle correction #45

Merged
merged 1 commit into from
Feb 8, 2016
Merged

Conversation

daynin
Copy link
Contributor

@daynin daynin commented Feb 7, 2016

Hello, @bbecquet! Your plugin is very useful but It has no way to set angle correction in some specific cases.

For example, I have an image like following:

arrow-up

If I create a marker with following settings:

L.Symbol.marker({
  markerOptions: {
     icon: L.icon({
       iconSize: [50,15],
       iconUrl: './some-path/arrow-up.png'
     })
  }
});

I will get something like this:

2016-02-07 3 38 13

If I set "rotate: true", I'll get following:

2016-02-07 3 21 37

But I want to get something like this:

2016-02-07 3 20 44

In this PR I've already implemented a small addition to "L.Symbol.marker" API. Now we can set "angleCorrection: 90" (for example) to correct marker's angle.

L.Symbol.marker({
  markerOptions: {
     rotate: true,
     angleCorrection: 90,
     icon: L.icon({
       iconSize: [50,15],
       iconUrl: './some-path/arrow-up.png'
     })
  }
});

I think it will be useful not only for me.

@bbecquet
Copy link
Owner

bbecquet commented Feb 8, 2016

Thanks @daynin! Indeed that's a useful feature, as it doesn't require to have the image file in the correct direction.

I'll merge :)

@bbecquet bbecquet merged commit cbc2686 into bbecquet:master Feb 8, 2016
@daynin
Copy link
Contributor Author

daynin commented Feb 8, 2016

@bbecquet , thank you!

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