3

I have a GeoJson feature that is rendered with leaflet and proj4(ESPG:31467). Now I want to rotate that feature so that it NW corner points to NE, e.g. 90 deg rotation. Is there a way to do this? Or can you give me hints how to address this issue and develop a LL plugin for such functionality.

3
  • I could imagine that this is doable with Turf.js, but I am not sure. You might want to have a look at it. Jun 21, 2016 at 8:56
  • Do you know how to rotate coordinates mathematically using a matrix of sines and cosines?
    – Spacedman
    Jun 21, 2016 at 9:41
  • This is probably what you want: stackoverflow.com/a/35445682/895 Jun 21, 2016 at 10:37

1 Answer 1

1

For points you can do it using CSS, in the layer you can use the pointToLayer function and return a DivIcon with the CSS class you want. Then the CSS has the rotation applied. See http://davetimmins.com/2015/10/07/Rotated-icons-with-leaflet/ for more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.