SqlGeospatialDataReader Select Points

4 posts, 1 answers
  1. Alexander
    Alexander avatar
    2 posts
    Member since:
    Jun 2012

    Posted 15 Feb 2015 Link to this post

    Hello!

    I am using SqlGeospatialDataReader as InformationLayer.Reader.     
                            
    <telerik:SqlGeospatialDataReader Source="{Binding Grundstücke}"
                                     GeospatialPropertyName="WKTGeo"
                                     ToolTipFormat="{}ID: {ID} {Riede} Reihen: {Reihen}">
        <telerik:SqlGeospatialDataReader.PointTemplate>
            <DataTemplate>
                <Ellipse Width="8" Height="8" Fill="Black" Stroke="White" StrokeThickness="1" />
            </DataTemplate>
        </telerik:SqlGeospatialDataReader.PointTemplate>
    </telerik:SqlGeospatialDataReader>

    Is there something like a Selected Point template? To visually see, what point is selected. My WKT data is Multipoint. I also would like every multipoint from a WKT beeing selected, when one is clicked. Can this be done with SqlGeospatialDataReader?

    And is it beeng synched with the selection of the underlaying QueryableEntityCollectionView thats the itemsource for the SqlGeospatialDataReader?

    greetings
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 19 Feb 2015 Link to this post

    Hello,

    We are currently working on this scenario. However, we will need more time to provide you with information. We will write back as soon as we have something to share.

    Regards,
    Pavel R. Pavlov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Answer
    Martin
    Admin
    Martin avatar
    1101 posts

    Posted 19 Feb 2015 Link to this post

    Hello Alexander,

    The map's InformationLayer does not have a built-in selection support, which mean that the data reader also does not provide a template for a selected point. In order to achieve such functionality you can write custom code that handles this scenario. For example you can attach for the mouse left button down event of the element in the PointTemplate and implement the selection there.

    Note that the map control provides two rendering engine packs - the old one consists of the the InformationLayer, VirtualizationLayer and DynamicaLayer. The new one is implemented through the VisualizationLayer and it has few new features, and also improved performance. One the those features is the built-in selection which you can use for your requirement. However, you will need to implement the logic for changing the color of all points. What you can do is basically to subscribe for the SelectionChanged event of the visualization layer and inside of its handle to change the colors and manually update your QueryableEntityCollectionView.

    For your convenience I prepared a project that includes an example implementation of such approach. You can find it in the attachment.

    You can also consider to wrap the data from the reader into view models. This will allow you more flexible control over the layer and its items.

    Regards,
    Martin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Alexander
    Alexander avatar
    2 posts
    Member since:
    Jun 2012

    Posted 21 Feb 2015 in reply to Martin Link to this post

    Hello Martin!

    Thanks for your example. I wrapped my data into a MapItem object and passed it to the VisualizationLayer.
    But this approach with looks better :-)

    I didn't know that i can access the other Properties of my Object via the ExtendedData. Thanks for your help!

    greetings
    Alexander
Back to Top