Restrict POI's DataTemplate area

4 posts, 0 answers
  1. Thomas
    Thomas avatar
    9 posts
    Member since:
    May 2012

    Posted 24 Apr 2015 Link to this post

    Hello,

    I'd like to restrict the size of my POI'S Datatemplate to be only shown in an explicit area so it won't get any bigger than this area.
    Maybe a LocationRect would be given and my DataTemplate automatically expands and fills this Rect.

    Can you tell me if there is a way to achieve anything similar to my requirements?

     See a simplified version of my DataTemplate below:

    <DataTemplate x:Key="ResizableTemplate">
        <Grid x:Name="ParentRoot"
                   Background="Transparent"
                   telerik:MapLayer.Location="{Binding Path=Location}">
            <StackPanel Orientation="Vertical" >
                  <TextBlock Text="{Binding Path=Title}" />
                  <TextBlock Text="{Binding Path=Description}" />
            </StackPanel>
        </Grid>
    </DataTemplate>

     VisualizationLayer:

    <telerik:VisualizationLayer x:Name="POILayer" ItemsSource="{Binding POICollection}" ItemTemplate="{StaticResource ResizableTemplate}" />

  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 28 Apr 2015 Link to this post

    Hi,

    I am not completely sure that I fully understand your scenario. Could you please be more specific about your requirement? Could you please clarify what you have in mind when you say "explicit area" do you refer to the physical pixels of your screen or you have in mind the geographic area which your POIS occupy? I understand that you need to somehow fix the size of the POIS. What I do not understand is where do you need to fix it to? To the screen or to the geographical area?

    Could you please elaborate more on the approach with using LocationRect? How do you imagine the behavior of the POI? How should it be defined?

    Regards,
    Pavel R. Pavlov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Thomas
    Thomas avatar
    9 posts
    Member since:
    May 2012

    Posted 28 Apr 2015 in reply to Pavel R. Pavlov Link to this post

    Hello Pavel,

    I am referring to the geographic area which my POIS can occupy.

    To LocationRect: I was thinking if it is possible to define a LocationRect with geographical values, place it on my Map and display my DataTemplate inside of it (This is more of a thought, nothing specific)

    The ideal behaviour: when zooming in or out, my POI only occupys the specified geopgraphical area in each zoomlevel and the content shrinks and growth depending on the zoomlevel

    Hopefully I was able to clear things up

    Regards,
    Thomas

  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 29 Apr 2015 Link to this post

    Hi,

    I suggest considering the possibility to use RectangleData to achieve your requirement. Please note that you can specify its Width and Height properties that will essentially define the area occupied by the object. You can also take a look at our SDK demo project. It demonstrates how the referenced object can be used.

    I hope this information is helpful.

    Regards,
    Pavel R. Pavlov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top