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

Custom MapShape?

1 Answer 48 Views
Map
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 16 Aug 2013, 10:40 AM
On my RadMap I have some InformationLayers and one of them is showing some objects as MapShape type "MapLine". Point1 and Point2 are set so the lines are displayed correctly. Now I have to extend those lines.

Our customer wants to see little bubbles at start and end point of each line. It seems a combination of MapShapes is not possible inside ItemTemplate so using one "MapLine" and two "MapEllipse" objects is not possible, right? As far as I understand the documentation one possibility is to use a single MapShape (that's what I currently have) and the other is using a FrameworkElement. But I cannot use FrameworkElement because those objects do not have Properties for RadMap like Point1/Point2 or Location.

ItemTemplate now:
<DataTemplate>
  <tel:MapLine
    Visibility="{Binding Visibility}"
    StrokeThickness="{Binding LineThickness}"
    Point1="{Binding Point1}"
    Point2="{Binding Point2}" />
</DataTemplate>


What I expected as solution but didn't found:

<DataTemplate>
  <
tel:MapShapeCollectionOrSomethingLikeThat>
    <tel:MapEllipse tel:MapLayer.Location="{Binding Point1}" />
    <tel:MapLine
      Visibility="{Binding Visibility}"
      StrokeThickness="{Binding LineThickness}"
      Point1="{Binding Point1}"
      Point2="{Binding Point2}" />
    <tel:MapEllipse tel:MapLayer.Location="{Binding Point2}" />
  </tel:MapShapeCollectionOrSomethingLikeThat>
</DataTemplate>

1 Answer, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 21 Aug 2013, 06:26 AM
Hello Johannes,

Unfortunately those figures can't be created inside the data template using InformationLayer. It can be created in the code behind or in XAML. For example:

<telerik:MapPath Fill="#AF00FF00" Stroke="Blue" StrokeThickness="2">
    <telerik:MapPath.Data>
        <telerik:MapGeometryGroup>
            <telerik:MapEllipseGeometry Center="36.5,-121.5"
                        RadiusX="5"
                        RadiusY="5"/>
            <telerik:MapPathGeometry>                              
                <telerik:MapPathFigure StartPoint="36.5,-121.5">
                    <telerik:MapLineSegment Point="35.6,-119.8" />
                </telerik:MapPathFigure>
            </telerik:MapPathGeometry>
            <telerik:MapEllipseGeometry Center="35.6,-119.8"
                        RadiusX="5"
                        RadiusY="5"/>
        </telerik:MapGeometryGroup>
    </telerik:MapPath.Data>
</telerik:MapPath>

Unfortunately MapPath objects do not support binding inside geometry group or segments.

Regards,
Andrey Murzov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Map
Asked by
Johannes
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Share this question
or