mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Added classes MapOverlay and MapScale.
This commit is contained in:
parent
27cdfe77ae
commit
e52698586b
8 changed files with 461 additions and 232 deletions
|
|
@ -136,6 +136,7 @@
|
|||
ManipulationInertiaStarting="MapManipulationInertiaStarting"
|
||||
MouseMove="MapMouseMove" MouseLeave="MapMouseLeave">
|
||||
<map:MapGraticule Opacity="0.6"/>
|
||||
<map:MapScale Margin="4" Opacity="0.8"/>
|
||||
<map:MapItemsControl ItemsSource="{StaticResource Polylines}"
|
||||
ItemTemplate="{StaticResource PolylineItemTemplate}"/>
|
||||
<map:MapItemsControl ItemsSource="{StaticResource Points}"
|
||||
|
|
@ -152,7 +153,7 @@
|
|||
</MultiBinding>
|
||||
</map:Pushpin.Visibility>
|
||||
</map:Pushpin>
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="2,0,0,0" FontSize="10"
|
||||
<TextBlock HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="4" FontSize="10"
|
||||
Text="{Binding BaseTileLayer.Description, ElementName=map}"/>
|
||||
</map:Map>
|
||||
<Grid Grid.Row="1" Margin="2">
|
||||
|
|
|
|||
|
|
@ -10,17 +10,17 @@ namespace SampleApplication
|
|||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
Visibility visibility = Visibility.Visible;
|
||||
Visibility visibility = Visibility.Hidden;
|
||||
|
||||
if (values.Length == 2 && values[0] is Map && values[1] is Point? && ((Point?)values[1]).HasValue)
|
||||
{
|
||||
Map parentMap = (Map)values[0];
|
||||
Point position = ((Point?)values[1]).Value;
|
||||
|
||||
if (position.X < 0d || position.X > parentMap.ActualWidth ||
|
||||
position.Y < 0d || position.Y > parentMap.ActualHeight)
|
||||
if (position.X >= 0d && position.X <= parentMap.ActualWidth &&
|
||||
position.Y >= 0d && position.Y <= parentMap.ActualHeight)
|
||||
{
|
||||
visibility = Visibility.Hidden;
|
||||
visibility = Visibility.Visible;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue