This is a migrated thread and some comments may be shown as answers.

MapEllipseGeometry Center property not updating

4 Answers 156 Views
Map
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 21 Jan 2011, 11:42 PM
I'm working with the MapEllipseGeometry to get the centering right per this thread: http://www.telerik.com/community/forums/silverlight/map/mapellipse-center.aspx

But I'm having problems with the MapEllipseGeometry center property not updating when properties change.

The Parent RadMap's center property (which is bound to the same ViewModel property that the MapEllipseGeometry's center binds to) updates fine  & the MapEllipseGeometry's RadiusY and RadiusX update fine as well (which are all databound to the same object in my ViewModel).

Here is the code for the MapEllipseGeometry & RadMap XAML and my ViewModel code for the properties associated with them
<telerik:RadMap x:Name="RadMap" Center="{Binding SelectedGeofenceCenter}" ZoomLevel="10" DistanceUnit="Mile" Height="389" VerticalAlignment="Top" Margin="-10,4,-6,0" >
                    <telerik:RadMap.Provider>
                        <telerik:BingMapProvider ApplicationId="" />
                    </telerik:RadMap.Provider>
                    <telerik:InformationLayer>
                       <telerik:MapPath Fill="Red" Opacity=".6"
                            Stroke="Orange" StrokeThickness="2" >
                            <telerik:MapPath.Data>
                                <telerik:MapEllipseGeometry x:Name="GeoEllipse" Center="{Binding SelectedGeofenceCenter}" RadiusX="{Binding SelectedGeofence.Radius}" RadiusY="{Binding  SelectedGeofence.Radius}"/>
                            </telerik:MapPath.Data>
                        </telerik:MapPath>
                    </telerik:InformationLayer>
                </telerik:RadMap>
//Last Location Center       
        public string LastLocationCenter
        {
            get
            {
                return String.Format("{0},{1}", LastLocation.Lat, LastLocation.Lon);
            }
             
        }
public LocationPoint LastLocation
        {
            get
            {
                return lastLocation;
            }
            set
            {
                lastLocation = value;
                RaisePropertyChanged("LastLocation");
                RaisePropertyChanged("LastLocationCenter");
            }
        }

I took out the ApplicationId.

Any suggestions of why this is happening?

4 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 25 Jan 2011, 12:13 PM
Hi Alex,

Thank you for the feedback.
This problem will be fixed during implementation of the following task in our PITS system:
http://www.telerik.com/support/pits.aspx#/public/silverlight/4352

As workaround you can remove and then to add the map path element to the information layer for correcting of the ellipse location.
The sample code is below.

<telerik:RadMap x:Name="RadMap" Center="{Binding SelectedGeofenceCenter}" ZoomLevel="10" DistanceUnit="Mile" Height="389" VerticalAlignment="Top" Margin="-10,4,-6,0"
    CenterChanged="RadMap_CenterChanged">
                    <telerik:RadMap.Provider>
                        <telerik:BingMapProvider ApplicationId="" />
                    </telerik:RadMap.Provider>
                    <telerik:InformationLayer x:Name="informationLayer">
                       <telerik:MapPath x:Name="GeoPath" Fill="Red" Opacity=".6"
                            Stroke="Orange" StrokeThickness="2" >
                            <telerik:MapPath.Data>
                                <telerik:MapEllipseGeometry x:Name="GeoEllipse" Center="{Binding SelectedGeofenceCenter}" RadiusX="{Binding SelectedGeofence.Radius}" RadiusY="{Binding  SelectedGeofence.Radius}"/>
                            </telerik:MapPath.Data>
                        </telerik:MapPath>
                    </telerik:InformationLayer>
                </telerik:RadMap>
private void RadMap_CenterChanged(object sender, EventArgs e)
{
    this.informationLayer.Items.Remove(this.GeoPath);
    this.informationLayer.Items.Add(this.GeoPath);
}


Kind regards,
Andrey Murzov
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Alex
Top achievements
Rank 1
answered on 25 Jan 2011, 05:07 PM
Thanks, that seems to do the trick! :)
0
Alex
Top achievements
Rank 1
answered on 09 Jun 2011, 04:10 PM
Hello,

I just updated my project with the latest release of telerik silverlight controls and it seemed to have broken this exact piece of code. It seems to be having problems with the Center property. To be specific coordinates "36,-111" which is what is returned from the web service I'm consuming.

I took the binding off the Center property to test with hard coded values. "0,0" works ok. But when I put  "36,-111" which is a completely valid set or coordinates, it gives me a "value does not fall between the expected range" ArgumentException 4004.

Can you guys help me out on this one please?

Update: Also the radiusX and radiusY is set to 4000. When I change it to 25 it seems to work regardless of the coordinates it binds to. Is there a limit on what size the radiusX and radiusY can be?
0
Andrey
Telerik team
answered on 14 Jun 2011, 12:51 PM
Hi Alex,

The RadiusX and RadiusY propertyes are set in the RadMap distance units (miles in your case). Do you really need ellipse with 4000 miles radius? This ellipse has North-West corner (which is a base for many internal calculations) far outside of the coordinate system supported by Mercator projection.

Regards,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Map
Asked by
Alex
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Alex
Top achievements
Rank 1
Share this question
or