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

Support Bearing and Pitch parameters #43

Closed
lamuertepeluda opened this issue Jun 28, 2016 · 4 comments
Closed

Support Bearing and Pitch parameters #43

lamuertepeluda opened this issue Jun 28, 2016 · 4 comments

Comments

@lamuertepeluda
Copy link

Hi there,

while playing with this amazing library I found out that MapBoxGL bearing and pitch parameters are not well supported (also setting zoom causes the same troubles but that does not really make sense since we set the zoom level in the map constructor).

Looking at the plugin class constructor, it appears that all parameters are passed to the underlying MapBoxGL map instance (mapboxgl.Map). Sadly it seems that bearing and pitch parameters are not taken into account in the update function.

To make clearer what I mean, I prepared this fiddle: try to pan and/or zoom the map and the marker position gets screwed up. 😞 This fiddle uses the leaflet-master branch version but the same happens with the master version and/or using clusters.

That's a pity because one of the most amazing features in MapBox, which was missing in Leaflet (I saw some FR in the past) was the ability to rotate the map, for instance with the device orientation change event.

I would suggest to find a way to support bearing and pitch parameters in the map update function, since they are (together with other features) a plus on the plain Leaflet map rendering.
If unfortunately this wouldn't be possible, then I suggest to state this in the README, or even better to clean up the unsupported parameters passed to the mapboxgl.Map constructor.

Thanks,

Vito

@fnicollet
Copy link
Collaborator

Hello,

It is actually in the readme of the leaflet-master branch, in "Motivation" (
https://github.com/mapbox/mapbox-gl-leaflet/blob/leaflet-master/README.md),
it is said that this plugin comes with some drawbacks, including the fact
that there would be no rotation because leaflet doesn't support.
Bearing/pitch are not supported for the same reasons, so I updated the
readme

Fabien

On Tue, Jun 28, 2016 at 9:59 AM, Vito Macchia [email protected]
wrote:

Hi there,

while playing with this amazing library I found out that MapBoxGL
bearing and pitch parameters are not well supported (also setting
zoom causes the same troubles but that does not really make sense since
we set the zoom level in the map constructor).

Looking at the plugin class constructor, it appears that all parameters
are passed to the underlying MapBoxGL map instance (mapboxgl.Map). Sadly
it seems that bearing and pitch parameters are not taken into account in
the update function.

To make clearer what I mean, I prepared this fiddle
http://jsfiddle.net/kv9v8LmL/1/: try to pan and/or zoom the map and the
marker position gets screwed up. 😞 This fiddle uses the leaflet-master
branch version but the same happens with the master version and/or using
clusters.

That's a pity because one of the most amazing features in MapBox, which
was missing in Leaflet (I saw some FR in the past) was the ability to
rotate the map, for instance with the device orientation change event.

I would suggest to find a way to support bearing and pitch parameters in
the map update function, since they are (together with other features) a
plus on the plain Leaflet map rendering.
If unfortunately this wouldn't be possible, then I suggest to state this
in the README, or even better to clean up the unsupported parameters passed
to the mapboxgl.Map constructor.

Thanks,

Vito


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#43, or mute the
thread
https://github.com/notifications/unsubscribe/ABLtoZOBtY0YIF6KPl6Ourf2AYkB10lGks5qQNRNgaJpZM4I_1nL
.

Fabien Nicollet
Tel : +33 (0)6 60 54 72 20

@lamuertepeluda
Copy link
Author

I see but couldn't be this considered as a feature request for next releases? I mean isn't there any transformation matrix or magic trick to reposition the markers correctly taking rotation and/or pitch into account in the update function?

In MapBoxGL JS the main problem is that the markers use that awful binary format (which I'm sure it has some good technical reason to exist) which is unpractical, since it requires using MapBox studio which may be designer friendly but is programmer unfriendly.
Using HTML- or Canvas- (or even PNG/SVG) based ones would open to more customization, but perhaps I should make a FR on their repo.

I thought that using MBGL inside/together with Leaflet would enable to use Leaflet coolest features such as custom markers and other plugins while keeping the wonderful MapBox vector tiles features and rendering...

@fnicollet
Copy link
Collaborator

Yes, it can be considered a feature request, that's why this issue will stay opened.

Transformation matrix/magic tricks will be tough ones, but you are welcome to try :)

transducer pushed a commit to alliander-opensource/decentralized-auth that referenced this issue Jul 25, 2018
- Map over props
- Extract access-token
- Use Google Closure methods

Note: bearing and pitch are not possible in Leaflet
See mapbox/mapbox-gl-leaflet#43
Same for rotation.
See Leaflet/Leaflet#268
@jgravois jgravois closed this as completed Jul 1, 2019
@jgravois
Copy link
Collaborator

jgravois commented Jul 1, 2019

this leaflet plugin is on life-support, no additional features are likely.

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

No branches or pull requests

3 participants