I'm evaluating the XamMap class and need to be able to rotate the map view depending on a user-selectable orientation. However, I fail to find any property like e.g. 'Heading' in the XamMap- and associated classes. How do I set the rotation in XamMap ?
Regards,Leif
No response ? I guess that means that the XamMap does not support rotation in an easy way ? That will make the whole control useless for our purpose since I need to make the map orientation fit the way users want to display the overlay data on screen. I'm surprised if such an advanced control doesn't support such a scenario.
Hi Leif,
I'm sorry that I didn't get back to you sooner. Here is my sample using world shape files and RotateTransform to rotate the map 90 degrees with each click on the button.
Hope this helps. Please let me know if you have any questions.
Hi,
using a RotateTransform will rotate the map, but it will not fill up the view with data. I still want my view to be filled with map data at the same zoom level after rotation.
The attached zip-file contains several images explaining what I mean; The image 'ShapeRotated.jpg' shows the shape from your provided sample with a 10 degree rotation. Leaving the view with empty areas in the corners (and at a different scale) is not what I want.
The two other images in the attached zip-file show the XamMap in a side-by side comparison with the Open Source (but less featureful) Open Street Map control 'XAML Map Control' (http://xamlmapcontrol.codeplex.com/). This control has a 'Heading' property that sets how the map data is rotated/aligned in the View.
The 'BothApisUnrotated.jpg' image show both APIs with unrotated data for basically the same area. The 'BothApisRotated.jpg' show the same areas with a 10 degree rotation, using a RotateTransfom for the XamMap (left) and using the Heading property for the XamlMapControl (right). The XamlMapControl displays the data as expected, filling in missing areas at the corners with new downloaded tiles. The XamMap, however, just takes the data visible in the unrotated view and rotates this data. No tiles are downloaded to fill the areas in the corners.
I hope these images explains what I need to achieve with the XamMap control.
EDIT: Just to emphasize what we want to achieve: We have a compass rose in the upper right corner of the view that contains the XamMap. The compass rose is used to align the view so that the view's vertical axis corresponds to an arbitrary 'north' direction. The XamMap will be used as a background layer and its viewport will be controlled by the master view and not direct XamMap intercation.
I'm still looking into this question. I've contacted some of our developers for their suggestions and expect to be back to you tomorrow.
any news on this one ?
There is currently no setting that would rotate the map as you suggest. Using LayoutTransform or RenderTransform on the XamMap control, because of the when the size of the element is determine and the size and position of surrounding elements, is problematic as you suggested. This link may help explain the differences.
http://www.scottlogic.co.uk/blog/colin/2008/12/layouttransform-vs-rendertransform-whats-the-difference/
You might be able to use the LayoutTransform and shade the background to minimize the visual impact.
I have submitted an additional product idea for you with the details that we have discussed, directly to our Product Management team. Our product team chooses new product ideas for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products so as trends appear in product ideas, we can plan accordingly.
We value your input, and our philosophy is to enhance our toolset based on customer feedback. If your features are chosen for development you will be notified at that time. Your reference number is PI13030114.
If you would like to follow up on your product idea at a later point, you may contact Developer Support management via email. Please include the reference number of your product idea in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Please let me know if you need any further assistance.
I hadn’t heard back from you and I was wondering if you had further questions.
Please let me know if I can help further.
Thanks for posting your work around. It may be helpful to someone else until your product idea is incorporated into the control.
Please let me know if there is anything more I can help you with.
I hope this feature will be added to a soon upcoming version, as I see rotation as a very natural feature of a map control.
I seem to have found a workaround myself that puts the XamMap in a grid with a XamMap size that extends the size of the parent grid. I have to resize the XamMap when the parent grid is resized and the XamMap size depends on e.g. the Grid's aspect ratio to be able to apply a layout transform rotation with no visual artifacts. The XamMap's viewport must also be calculated to extend beyond the viewport that I actually want displayed on screen. This solution is not ideal as it e.g. means that I have to download tiles that may never be displayed on screen, but I can live with it for now.