This project has moved. For the latest updates, please go here.

Rotation on EllipseGeometry

Jun 29, 2015 at 3:40 PM

First of all, many thanks for this great api.

I am trying to apply rotation to an EllipseGeometry doing like this :
<DataTemplate DataType="{x:Type al:EllipseVM}">
                    <RotateTransform Angle="45"/>

                <Path x:Name="start" 
                  map:MapPanel.Location="{Binding Center}" 
                        <EllipseGeometry RadiusX="{Binding SemiMajorAxis}" RadiusY="{Binding SemiMinorAxis}" 
                                     Transform="{Binding Path=ScaleTransform, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type map:Map}}}">
                <Canvas x:Name="polylineLabel"
                            map:MapPanel.Location="{Binding LabelLocation}"  
                    <views:TextPath Text="{Binding Label}" 
                                        FontSize="12" FontWeight="Normal"
                                        StrokeThickness="1" Stroke="Black" />

The rotation is ok but the Location is not.
If i zoom in the location change and follow the zoom.

I suppose i am not doing it correctly, could you please help me (i tried to apply the render transform to the MapPanel with no success) ?
Jun 29, 2015 at 3:59 PM
Edited Jun 29, 2015 at 3:59 PM
Hard to tell. Is that DataTemplate used as the ItemTemplate of a MapItemsControl? The top-level Canvas may probably be replaced by a MapPanel.
Jun 30, 2015 at 8:00 AM
Yes, the dataTemplateis used as the ItemTemplate of a MapItemsControl that refer to the style inside a ressource dictionary.
No change with your proposal.

I also tried this :
<map:Map x:Name="SurpolMap" Grid.Column="0" Grid.ColumnSpan="2"
                 Center="{Binding MapCenter, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}"
                 TargetCenter="{Binding MapVM.TargetMapCenter, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                 TargetZoomLevel="{Binding MapZoomLevel, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                 MaxZoomLevel="20" MinZoomLevel="1" 
                 TileLayer="{Binding MapVM.CurrentTileLayer}"

            <!-- The graticule for the map  -->
            <map:MapGraticule Opacity="0.6" 
                                Visibility="{Binding ShowGraticule, Converter={StaticResource BooleanToVisibilityConverter}, 
                                Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                            <RotateTransform Angle="45"/>
                        <Path x:Name="start" 
                      map:MapPanel.Location="54.3, 0.2" 
                                <EllipseGeometry RadiusX="1832000" RadiusY="832000" 
                                 Transform="{Binding Path=ScaleTransform, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type map:Map}}}"/>

With no success.
Jun 30, 2015 at 8:05 AM
New Test :

I added the only the path to the Map with a render Transform and everything goes fine.

It seems to be linked to the MapPanel and MapItemControl.
Jun 30, 2015 at 9:27 AM
Edited Jun 30, 2015 at 9:28 AM
map:MapPanel.Location="{Binding Center}" has to be set on the item container (i.e. a MapItem), not on an element in the ItemTemplate. You'll have to set it in an ItemContainerStyle for MapItem, as shown in the sample applications:
<Style x:Key="PointItemStyle" TargetType="map:MapItem">
    <Setter Property="map:MapPanel.Location" Value="{Binding Location}"/>
Jun 30, 2015 at 11:54 AM
Got it ;)

Thank you.

I also removed the MapPanel Container to complete.