-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
rotation of map and contents to x degress. #268
Comments
It's not as easy as it sounds - besides the rotation itself, you need to extend all the projection logic for all events to work with rotated maps correctly, extend touch logic to allow rotation with fingers, change the tile loading algorithm (it will become more complex in rotated case than just a requesting rectangle of tiles), and many other nuances. I thought about that myself and at that time I came to conclusion that this feature isn't worth all the code overhead and complexity. It's nice to toy with but still rarely very practical. |
thanks for the comments .... appreciate it, i'll mark it down as something to do later then ... i've created an extension for the tile layer that allows the tiles to come from the web database .... works well on the iphone + titanium/phonegap ... i'll tidy it up and then send a pull request .... (the js will no doubt need tidying up though - i'm not an expert in that field yet) :p |
I'ts not so hard as it looks. Map rotation can be a graet thing when working with PhoneGap. as a test, just add the following the the CSS: "-webkit-transform: rotate(30deg);" This will show you the rotated map. Markers and tiles seam to work, but the canvas shoukd be expanded so it's a rectangular area with the size of the diagonal. |
It's not so simple as it looks either. :) You need to transform all mouse and touch events correctly according to rotation, you need to make it work with non-rotated markers and popups, you need to write completely different algorithms for detecting current geographical bounds, detecting tiles to load, different polygon and polyline clipping algorithms, etc. etc. etc. |
I tried it with the first example. It looks like the tiles are loaded correctly, but the mouse events should be changed, as well as the popups. The vector layers are placed correctly, but the marker image if rotated, of course. |
mourner, could you please advise me how to change the size and position of the map pane div? If I want to rotate the map, I must have a map that's larger then the real size so that no blank space is left on the courners. Could you direct me to the function responsible for the div size? Thanks! |
it looks like this isn't going to be included in leafletjs anytime soon, I guess, huh? haha |
I think this feature is becoming more of a need-to-have than a nice-to-have. Common mapping applications now offer rotation, so users are starting to expect it. It's been added to my product roadmap whether it's on leaflet's or not. Can we reconsider the map rotation feature? What would it take to build it, and what are the considerations? |
I can +1 here. I do need rotation for my application, too. I just made the change from ol3 to Leaflet / Mapbox.js because it is much easier to comprehend and does a lot of the stuff I want and need in just the way I thought it has to work. So it's very intuitive, thanks for that! |
me too, I could have used this feature recently too. It'd be awesome! |
+1 for me, being able to use the device orientation API to align the map with a mobile user would be brilliant! |
+1 |
wouldn't it be enough if the marker would change it's rotation with the device motion data you get from your phone in html5? so you could at least see where you stand - and in which direction you're looking right when you turn your device. |
Open layers 3 has this feature. |
Any updates on the possibility of this being implemented? Would be very much appreciated. |
Seems like OL3 is your best bet for now, or wait for WebGL. I know it's On Thu, Jun 5, 2014 at 7:27 PM, Ben L. [email protected] wrote:
|
this could be useful: |
@colllin Same here... In the end we switched to OL3 for our project. |
Same here. No map rotation is a deal breaker for us. |
@cgwyllie OpenLayers 3 support map rotation!!? |
@stefanocudini Yep! |
I also think that this feature should be the current #1 topic for leaflet. Please concider it, I think it is totally worth the effort. |
No, it doesn't. At least for Leaflet. |
👍 |
I would also love this. Leaflet is a fantastic framework and it is such a shame there is no plans to support this. |
Need rotation or need to look elsewhere...unfortunately |
👍 |
@webleaf Then spend some time and resources debugging the |
Yep rotation is definitely needed! Best example: a custom made map that changed it original orientation after georeferencing it. |
@mourner @fnicollet @hyperknot Is this planned to be merge to official version? I see a lot of people moving away from leaflet due to this feature which makes me sad, mainly because I like leaflet very much and because I feel that this feature will be needed in my project in the near future. |
This function is a must to have, I don't understand why @mourner considers this feature not important especially since almost all the others map libraries offer this function ! |
@RafikSM Then spend some time and resources debugging the |
does leaflet support rotate function???? |
@IvanSanchez Hi, first, thanks a lot for the amazing work of leaflet. I am wandering about whether to switch to other library for leaflet has no way to rotate map which is needed serious or not. So are there any new messages about this feature, and will this feature be supported by official library soon or maybe in future? I have tried a lot ways and have no luck with any hack to realize rotating my maps. |
@goforward01 if map rotation is a required feature for a project, then yes, I recommend you to switch to a different library. |
Thanks for feedback Ero.
We are using rc1 and the results are meeting our needs.
Em 12 de jun de 2016 06:33, "Zsolt Ero" <[email protected]> escreveu:
… @maceto2016 <https://github.com/maceto2016> I'll continue working on
rotate-rc1 and @IvanSanchez <https://github.com/IvanSanchez> is working
on Leaflet GL, which also supports rotation: https://github.com/
IvanSanchez/Leaflet.gl
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#268 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe/AS8-0fdhl7X2nVx48mdKj7ce68jp86-nks5qK9JbgaJpZM4BVuxg>
.
|
@hyperknot Okay, thanks for reply. BTW, I will keep an eye on leaflet, it's an awesome library. |
If people wondering, I have merged and have updated the old @IvanSanchez rotate branch to the latest of Leaflet in my fork. |
@va2ron1 I would very much like to test it, but I'm using angular-cli. is there a npm package I can use to test it? |
Hello,
There is no official plan to merge it to master anytime soon, consider it
experimental. There is no npm package for it either
Fabien
Le 20 mars 2018 19:57, "Harel M" <[email protected]> a écrit :
… @va2ron1 <https://github.com/va2ron1> I would very much like to test it,
but I'm using angular-cli. is there a npm package I can use to test it?
Assuming this will work as planned, will it be merged to the official
version? I really don't want to choose between rotation to other newly
implemented features if the branch gets out of sync...
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#268 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABLtoT-sJQnOUE8rAgDooI-9Wa101_D0ks5tgVEegaJpZM4BVuxg>
.
|
@HarelM like @fnicollet said, this is just experimental. If you want to try it with angular, just install the package like this: Edit: I hadn't include the distributions files, now will work with node. |
@va2ron1 I wanted to test your branch but I have an issue with markercluster so i can't currently test it: |
Ok, The problem was that this branch is using the esm version and does not export {
...
rotate = true,
...
}
...
map.setBearing(30); I have uploaded a version to the following address:
let northEast = this.mapService.map.getBounds().pad(0.2).getNorthEast();
let southWest = this.mapService.map.getBounds().pad(0.2).getSouthWest();
sending to server at first this works fine, but after a few panning and zooming I get incorrect response when calling this function. Polygons and poly-lines are correctly rotated, and even ant-path works :-) |
@HarelM If you don't mind, post this issue at my fork to leave this behind. Edit: Posted |
@mourner I know this issue is a bit old, any change to reconsider and opening so it will be added to leaflet officially? I've been using leaflet for the better part of the last five years and I really like it, I would hate to need to change the entire map presentation framework since this feature is not supported officially... |
@va2ron1 great work, thank you ! |
- 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
This is now "open" for too long. The relevant fork doesn't work well. I now use my site inside Cordova to allow native device usage such as background recording. It's been a hell of a ride leaflet, but it's time to move on... |
Hi @HarelM, While I think we all agree that supporting map rotation in Leaflet would be extremely useful for many people, it is also clear that the technical difficulty (as clearly explained by @mourner from the very beginning) makes it unbearable for the current Leaflet team and resources unfortunately. 😰 If you need this feature but @va2ron1's fork does not work right for you, the easiest solution for sure would be to change the mapping library. There are several open source alternatives with such feature. As this thread has been closed for 7 years and it currently does not seem to bring further value, I am going to lock it. Kind reminder: this is open source; we need your help! 🙏 If you can provide help, please feel free to submit PR's, publish your own plugin, or contact us if you are ready to provide some funding. |
Hi,
I have been using this on the iphone as a great mapping api for offline maps ... it rocks ...
I'm keen to extend the library to allow a method to be called to do a transformation of the map and it's contents (using the power of webkit ) to point north (assuming the user is using a phone with a compass api) ... i.e.
-webkit-transform: rotate(12deg);
can someone point me in the right direction where i should start ... or if this is a future feature ...
Cheers
coomsie
p.s. sorry if this is the wrong place to place new features requests ...
The text was updated successfully, but these errors were encountered: