Map mirrored in right to left flow direction

7 posts, 1 answers
  1. Sayyed Hossein
    Sayyed Hossein avatar
    27 posts
    Member since:
    Oct 2012

    Posted 20 Aug 2018 Link to this post

    i have two problems in using map control in right to left

    i am using a custom map tile provider

    the flow direction of my application is right to left when i open the map control my map tiles are mirrored all the streets and texts and ... are reverse as if i have put the image in front of a mirror. to relieve that issue i put the flow direction of the rad map to left to right. now i have my second problem! when i want to export the map view as a png file the exported file is mirrored!

    is this a known issues or am i doing something wrong ?

    thx in advance for your help

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1097 posts

    Posted 22 Aug 2018 Link to this post

    Hello Sayyed,

    Thank you for reporting this issue. It does seem like a bug at our end and that is why I've logged the following bug report in our feedback portal to which you can subscribe. As a thank you for your help in addressing this issue, I've awarded you with some Telerik points.

    I do hope you find the workaround of applying a LeftToRight FlowDirection to the RadMap control directly applicable for the time being.

    As for the related issue of the ExportToImage method flipping the image, you can work around that as well by changing the flow direction of the map prior to calling the method and switching it back afterwards.

    private void RadButton_Click(object sender, RoutedEventArgs e)
    {
        radMap.FlowDirection = FlowDirection.RightToLeft;
        radMap.ExportToImage("../../map-image.png", true, encoder: new PngBitmapEncoder());
        radMap.FlowDirection = FlowDirection.LeftToRight;
    }

    Please let me know whether such an approach works for you as well.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Sayyed Hossein
    Sayyed Hossein avatar
    27 posts
    Member since:
    Oct 2012

    Posted 02 Sep 2018 in reply to Dilyan Traykov Link to this post

    hi thank you very much for your answer

    this is the exact path i took after encountering this problem but then i hit another issue

    after changing map flow direction to right to left before exporting and then setting it back to left to right the resulted png file's map is ok (not mirrored) BUT...

    i have a visualization layer on top of the map with itemtemplate set to a usercontrol(forexample "testcontrol"). the "testcontrol"'s flow direction is right to left

    after export the map itself is ok but the items are now mirrored

  4. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1097 posts

    Posted 05 Sep 2018 Link to this post

    Hello Sayyed,

    Could you please also try setting the FlowDirection of the visualization layer itself prior to the export and bringing it back afterwards and see if that solves the issue?

    I will be awaiting your reply.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Sayyed Hossein
    Sayyed Hossein avatar
    27 posts
    Member since:
    Oct 2012

    Posted 22 Sep 2018 in reply to Dilyan Traykov Link to this post

    hi thank you for your reply and sorry for my delay

    i tested changing the flow direction of visualization layers prior to exporting and it didn't work(still mirrored objects on map).

    and after that i found out the after changing FlowDirection of the map control it actually changes flow direction of its visualization layers itself so there is no need to do it again manually

  6. Answer
    Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    1097 posts

    Posted 26 Sep 2018 Link to this post

    Hello Sayyed,

    After further investigating this I've come up with the following approach you can try.

    this.grid.FlowDirection = FlowDirection.LeftToRight;
     
    Dispatcher.BeginInvoke(new Action(() =>
    {
        radMap.ExportToImage("../../map-image.png", true, encoder: new PngBitmapEncoder());
     
        this.grid.FlowDirection = FlowDirection.RightToLeft;
    }), DispatcherPriority.Render);

    Note that "grid" in this case is the name of the parent control the RadMap is placed inside.

    Please give this a try and let me know if it solves the issue at your end.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  7. Sayyed Hossein
    Sayyed Hossein avatar
    27 posts
    Member since:
    Oct 2012

    Posted 29 Sep 2018 in reply to Dilyan Traykov Link to this post

    thank you very much dear dilyan this workaround fixed it.

    looking forward to the complete resolving of the bug

Back to Top