Results 1 to 2 of 2

Thread: Rotate Ext.Map based on users heading

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    5

    Default Rotate Ext.Map based on users heading

    Hi All,

    We are building an app which acts like navigation app. For the map we use google maps though Ext.Map.

    Now the GPS tracking is all fine but the map which is shown allways shows NORTH at the top. We would like to rotate the map so that the users heading is at the top of the screen (instead of north). Does anybody know how to do that?

    I know we can get the heading from the location, but how to rotate the map?

    Best regards,

    Patrick

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    26

    Default

    I'm also trying to achieve this. I know theorically should work by doing:

    Code:
    object.style.webkitTransform ='rotate(45deg)';
    What I can't tell yet is how to do apply it to the entire Ext.Map object.

    Anyone any idea?

    --------

    Edit: just figured it out:

    Code:
    function rotate(map, heading){
            map.el.dom.style.webkitTransform ='rotate(' + heading + 'deg)';
    }
    Last edited by jdb; 16 Jul 2011 at 11:53 AM. Reason: got it

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •