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

Restrict POI's DataTemplate area

3 Answers 52 Views
Map
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 24 Apr 2015, 07:38 AM

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}" />

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 28 Apr 2015, 12:01 PM
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.

 
0
Thomas
Top achievements
Rank 1
answered on 28 Apr 2015, 01:17 PM

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

0
Pavel R. Pavlov
Telerik team
answered on 29 Apr 2015, 11:39 AM
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.

 
Tags
Map
Asked by
Thomas
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or