Hello,
Again, not sure if I'm doing something wrong here or not. I am using OpenStreetMapProvider and binding an information layer to two Location points with a custom display template.
The DataTemplate is;
The information layer is bound to an ObservableCollection<MyObject> where MyObject has a Location property exposed.
When I initially load the UserControl (mapView_Loaded event handler), I "retrieve" the data. This populates the ObservableCollection in the view model and fires the notifypropertychanged event which I have attached a handler in the UserControl in order to execute the GetBestView of the information layer. My locations can be very close or opposite sides of the world, so want the map to auto-zoom. When the points are initially displayed, the positions/location of the elements is wrong. (see attached image startup_position.png). If I pan, the locations remain incorrect, however, if I zoom in one level and back, the positions adjust and are placed correctly (see attached image zoomin_out_position.png) and are then fine afterwards when panning and zooming. I tried different geo locations and zoom levels but it was the same. The very first view is incorrectly positioned. Obviously I can't have the users needing to trigger a zoom to correctly position the elements.
The version I am using is outdated (Q3 2010, 2010.3.1314.1040), and upgrading is a very hard sell at the moment, so I'm stuck with what I have. I'm hoping this is not an issue with this version. Is there something I'm doing wrong here, or is this a bug that has been resolved in a newer release?
Thanks.
Alex.
Again, not sure if I'm doing something wrong here or not. I am using OpenStreetMapProvider and binding an information layer to two Location points with a custom display template.
The DataTemplate is;
<
Grid
telerik:MapLayer.Location
=
"{Binding Path=Location}"
telerik:MapLayer.BaseZoomLevel
=
"1"
telerik:MapLayer.ZoomRange
=
"1,10"
>
<
telerik:MapLayer.HotSpot
>
<
telerik:HotSpot
Y
=
"1.0"
X
=
"0.0"
XUnits
=
"Fraction"
YUnits
=
"Fraction"
ElementName
=
"PART_HotSpot"
/>
</
telerik:MapLayer.HotSpot
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"12"
/>
<
ColumnDefinition
Width
=
"48"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"10"
/>
<
RowDefinition
Height
=
"12"
/>
<
RowDefinition
Height
=
"Auto"
/>
</
Grid.RowDefinitions
>
<
Image
x:Name
=
"PART_HotSpot"
Grid.Row
=
"1"
Grid.Column
=
"0"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Left"
Source
=
"{Binding Path=PinImageSource}"
/>
<
Border
Grid.Row
=
"0"
Grid.Column
=
"1"
Background
=
"#80000000"
BorderBrush
=
"Black"
BorderThickness
=
"1"
>
<
TextBlock
VerticalAlignment
=
"Center"
Text
=
"{Binding Path=PortName}"
FontSize
=
"7"
FontFamily
=
"Arial"
Foreground
=
"White"
/>
</
Border
>
</
Grid
>
The information layer is bound to an ObservableCollection<MyObject> where MyObject has a Location property exposed.
When I initially load the UserControl (mapView_Loaded event handler), I "retrieve" the data. This populates the ObservableCollection in the view model and fires the notifypropertychanged event which I have attached a handler in the UserControl in order to execute the GetBestView of the information layer. My locations can be very close or opposite sides of the world, so want the map to auto-zoom. When the points are initially displayed, the positions/location of the elements is wrong. (see attached image startup_position.png). If I pan, the locations remain incorrect, however, if I zoom in one level and back, the positions adjust and are placed correctly (see attached image zoomin_out_position.png) and are then fine afterwards when panning and zooming. I tried different geo locations and zoom levels but it was the same. The very first view is incorrectly positioned. Obviously I can't have the users needing to trigger a zoom to correctly position the elements.
The version I am using is outdated (Q3 2010, 2010.3.1314.1040), and upgrading is a very hard sell at the moment, so I'm stuck with what I have. I'm hoping this is not an issue with this version. Is there something I'm doing wrong here, or is this a bug that has been resolved in a newer release?
Thanks.
Alex.