Skip to content

Commit

Permalink
Merge pull request #133 from Esri/antt0000-1027fixes
Browse files Browse the repository at this point in the history
Sample fixes based on feedback
  • Loading branch information
anttikajanus committed Feb 5, 2016
2 parents fe814bf + 92b9883 commit 0ac66b1
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ private async void MyMapView_MapViewTapped(object sender, MapViewInputEventArgs
var currentViewpoint = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry);
var viewpointExtent = currentViewpoint.TargetGeometry.Extent;

var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 2, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);
var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 5, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);

// Clears map of any highlights.
var overlay = MyMapView.GraphicsOverlays["Highlighter"] as GraphicsOverlay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,13 @@
<esri:ArcGISTiledMapServiceLayer ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
</esri:Map>
</esri:MapView>
<Border Background="White" BorderBrush="Black" BorderThickness="1"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="30" Padding="20" Width="355">
<StackPanel>
<TextBlock Text="Click to add two points to the map. The graphic animates between the two points using a Quintic easing function."
TextAlignment="Left" TextWrapping="Wrap" />
</StackPanel>
</Border>
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
mc:Ignorable="d" >
<Grid>
<esri:SceneView x:Name="MySceneView" AmbientLight="Gray">
<esri:Scene>
<esri:Scene.Surface>
<esri:ServiceElevationSource ServiceUri="http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
<Grid>
<esri:SceneView x:Name="MySceneView" AmbientLight="Gray">
<esri:Scene>
<esri:Scene.Surface>
<esri:ServiceElevationSource ServiceUri="http://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"
IsEnabled="True" ID="elevationLayer" />
</esri:Scene.Surface>
<esri:ArcGISTiledMapServiceLayer ID="AGOLayer"
</esri:Scene.Surface>
<esri:ArcGISTiledMapServiceLayer ID="AGOLayer"
ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
<esri:SceneLayer ID="BostonSceneLayer"
ServiceUri="http://scene.arcgis.com/arcgis/rest/services/Hosted/Building_Berlin/SceneServer/layers/0"/>
</esri:Scene>
</esri:SceneView>
<Border Background="White" BorderBrush="Black" BorderThickness="1"
<esri:SceneLayer ID="BerlinSceneLayer"
ServiceUri="http://scene.arcgis.com/arcgis/rest/services/Hosted/Buildings_Berlin/SceneServer/layers/0"/>
</esri:Scene>
</esri:SceneView>
<Border Background="White" BorderBrush="Black" BorderThickness="1"
HorizontalAlignment="Left" VerticalAlignment="Top" Width="180"
Margin="20" Padding="20">
<StackPanel >
<Label Content="UTC Berlin:"/>
<Label x:Name="AnimateSunTimeLabel"/>
<ToggleButton x:Name="AnimateSunTimeButton" Height="30" Padding="5" Content="Animate Sun Time" Margin="0,5" Click="Animate_Click"/>
</StackPanel>
</Border>
</Grid>
<StackPanel >
<Label Content="UTC Berlin:"/>
<Label x:Name="AnimateSunTimeLabel"/>
<ToggleButton x:Name="AnimateSunTimeButton" Height="30" Padding="5" Content="Animate Sun Time" Margin="0,5" Click="Animate_Click"/>
</StackPanel>
</Border>
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,22 @@ private async Task SetupSymbolsAsync()
"Showcard Gothic", "Snap ITC", "Vivaldi", "Wingdings"
};

// Create symbols from font list
_symbols = fontFamilies
.Select(f => new TextSymbol()
{
Text = f,
Color = GetRandomColor(),
HorizontalTextAlignment = HorizontalTextAlignment.Center,
VerticalTextAlignment = VerticalTextAlignment.Bottom,
Font = new SymbolFont(f, 20)
})
.ToList();
// Check what fonts are installed and remove ones that aren't
var notFoundFonts = fontFamilies.Where(f => !Fonts.SystemFontFamilies.Any(fs => fs.Source == f)).ToList();
foreach (var notInstalledFont in notFoundFonts)
fontFamilies.Remove(notInstalledFont);

// Create symbols from font list
_symbols = fontFamilies
.Select(f => new TextSymbol()
{
Text = f,
Color = GetRandomColor(),
HorizontalTextAlignment = HorizontalTextAlignment.Center,
VerticalTextAlignment = VerticalTextAlignment.Bottom,
Font = new SymbolFont(f, 20)
})
.ToList();

// Create image swatches for the UI
Task<ImageSource>[] swatchTasks = _symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ private async void MyMapView_MapViewTapped(object sender, MapViewInputEventArgs
var layer = MyMapView.Map.Layers["ServiceRequests"] as ArcGISDynamicMapServiceLayer;
var task = new IdentifyTask(new Uri(layer.ServiceUri));
var mapPoint = MyMapView.ScreenToLocation(e.Position);
var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 2, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);
var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 10, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);

// Clears map of any highlights.
var overlay = MyMapView.GraphicsOverlays["Highlighter"] as GraphicsOverlay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ public MapOverlays()
this.InitializeComponent();
(MyMapView.Overlays.Items[0] as Grid).DataContext = new MapPoint(-117.19568, 34.056601, SpatialReferences.Wgs84);

MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
MyMapView.NavigationCompleted += MyMapView_NavigationCompleted;
}

void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
void MyMapView_NavigationCompleted(object sender, EventArgs e)
{
MyMapView.SpatialReferenceChanged -= MyMapView_SpatialReferenceChanged;

_clickOverlay = FindName("clickOverlay") as FrameworkElement;
_centerOverlay = FindName("centerOverlay") as FrameworkElement;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private async void MyMapView_MapViewTapped(object sender, MapViewInputEventArgs
// Get current viewpoints extent from the MapView
var currentViewpoint = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry);
var viewpointExtent = currentViewpoint.TargetGeometry.Extent;
var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 2, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);
var parameter = new IdentifyParameters(mapPoint, viewpointExtent, 10, (int)MyMapView.ActualHeight, (int)MyMapView.ActualWidth);

// Clears map of any highlights.
var overlay = MyMapView.GraphicsOverlays["Highlighter"] as GraphicsOverlay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,11 @@
<layers:ArcGISTiledMapServiceLayer ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
</esri:Map>
</esri:MapView>

<Border Background="#CC000000" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="30" Padding="20" Width="355">
<StackPanel>
<TextBlock Text="Click to add two points to the map. The graphic animates between the two points using a Quintic easing function." Margin="12,12,12,0" TextWrapping="Wrap" />
</StackPanel>
</Border>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ public MapOverlays()
this.InitializeComponent();
(MyMapView.Overlays.Items[0] as Grid).DataContext = new MapPoint(-117.19568, 34.056601, SpatialReferences.Wgs84);

MyMapView.SpatialReferenceChanged += MyMapView_SpatialReferenceChanged;
MyMapView.NavigationCompleted += MyMapView_NavigationCompleted;
}

void MyMapView_SpatialReferenceChanged(object sender, EventArgs e)
void MyMapView_NavigationCompleted(object sender, EventArgs e)
{
MyMapView.SpatialReferenceChanged -= MyMapView_SpatialReferenceChanged;

_clickOverlay = FindName("clickOverlay") as FrameworkElement;
_centerOverlay = FindName("centerOverlay") as FrameworkElement;

Expand Down

0 comments on commit 0ac66b1

Please sign in to comment.