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

RadMap InformationLayer MapEllipse Location Binding

2 Answers 191 Views
Map
This is a migrated thread and some comments may be shown as answers.
Aliaksei
Top achievements
Rank 1
Aliaksei asked on 14 Dec 2018, 04:56 PM

Hello,

Can anyone help by answering on question: Why using this code MapEllipse shape didn't show on RadMap InformationLayer>?

<telerik:RadMap x:Name="RadMap"
    ZoomLevel="{Binding MapZoomLevel}"
    Provider="{Binding MapProvider}"
    Center="{Binding MapCenter}"
    cal:Message.Attach="[Event MapMouseClick] = [Action RadMapClicked($source,$eventArgs)];
            <telerik:InformationLayer>
                <telerik:MapEllipse
                    telerik:MapLayer.Location="{Binding Location}"
                    Width="10"
                    Height="10"
                    Fill="Red"
                    Stroke="OrangeRed"
                    StrokeThickness="2">
                </telerik:MapEllipse>
            </telerik:InformationLayer>
          </telerik:RadMap>

 

 

private Location _location;
public Location Location
{
    get { return _location; }
    set
    {
        _location = value;
        NotifyOfPropertyChange(() => Location);
    }
}
 
public void RadMapClicked(object sender, MapMouseRoutedEventArgs eventArgs)
{
    Location = eventArgs.Location;
}

 

RadMapClicked event is triggered well and Location coordinates are correct wrote

 

Thank you!

2 Answers, 1 is accepted

Sort by
0
Aliaksei
Top achievements
Rank 1
answered on 14 Dec 2018, 05:02 PM
This code works well for me. But Binding don't work.

 

<telerik:InformationLayer>
                <telerik:MapEllipse
                    Location="58.060385, 35.736556"
                    Width="10"
                    Height="10"
                    Fill="Red"
                    Stroke="OrangeRed"
                    StrokeThickness="2">
                </telerik:MapEllipse>
            </telerik:InformationLayer>
0
Dinko | Tech Support Engineer
Telerik team
answered on 19 Dec 2018, 09:51 AM
Hi Aliaksei,

Thank you for the provided code snippets.

Can you try setting the binding mode of the Location attached property to TwoWay and try again on your side?
<telerik:RadMap x:Name="RadMap"
    ZoomLevel="{Binding MapZoomLevel}"
    Provider="{Binding MapProvider}"
    Center="{Binding MapCenter}"
    cal:Message.Attach="[Event MapMouseClick] = [Action RadMapClicked($source,$eventArgs)];
            <telerik:InformationLayer>
                <telerik:MapEllipse
                    telerik:MapLayer.Location="{Binding Location,Mode=TwoWay}"
                    Width="10"
                    Height="10"
                    Fill="Red"
                    Stroke="OrangeRed"
                    StrokeThickness="2">
                </telerik:MapEllipse>
            </telerik:InformationLayer>
          </telerik:RadMap>

Regards,
Dinko
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.
Tags
Map
Asked by
Aliaksei
Top achievements
Rank 1
Answers by
Aliaksei
Top achievements
Rank 1
Dinko | Tech Support Engineer
Telerik team
Share this question
or