vnext
Paul Schneider 8 years ago
parent 795b1ce781
commit ce00e223c3
5 changed files with 5 additions and 182 deletions

@ -2,7 +2,7 @@ using System;
using Yavsc.Interfaces.Workflow;
using Yavsc.Models.Market;
namespace Yavsc.Models.Billing
namespace Yavsc.Models.Workflow
{
public class Query<P>: IBaseTrackedEntity where P : BaseProduct

File diff suppressed because one or more lines are too long

@ -2,7 +2,7 @@
using Xamarin.Forms;
using Xamarin.Forms.Maps;
namespace NightFlash
namespace ZicMoove
{
public class GeocoderPage : ContentPage
{
@ -41,4 +41,4 @@ namespace NightFlash
};
}
}
}
}

@ -1,64 +0,0 @@
using System;
using Xamarin.Forms;
namespace NightFlash
{
public class MapAppPage : ContentPage
{
// WARNING: when adding latitude/longitude values be careful of localization.
// European (and other countries) use a comma as the separator, which will break the request
public MapAppPage ()
{
var l = new Label {
Text = "These buttons leave the current app and open the built-in Maps app for the platform"
};
var openLocation = new Button {
Text = "Open location using built-in Maps app"
};
openLocation.Clicked += (sender, e) => {
if (Device.OS == TargetPlatform.iOS) {
//https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html
Device.OpenUri(new Uri("http://maps.apple.com/?q=394+Pacific+Ave+San+Francisco+CA"));
} else if (Device.OS == TargetPlatform.Android) {
// opens the Maps app directly
Device.OpenUri(new Uri("geo:0,0?q=394+Pacific+Ave+San+Francisco+CA"));
} else if (Device.OS == TargetPlatform.WinPhone) {
DisplayAlert("To Do", "Not yet implemented", "OK");
}
};
var openDirections = new Button {
Text = "Get directions using built-in Maps app"
};
openDirections.Clicked += (sender, e) => {
if (Device.OS == TargetPlatform.iOS) {
//https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/MapLinks/MapLinks.html
Device.OpenUri(new Uri("http://maps.apple.com/?daddr=San+Francisco,+CA&saddr=cupertino"));
} else if (Device.OS == TargetPlatform.Android) {
// opens the 'task chooser' so the user can pick Maps, Chrome or other mapping app
Device.OpenUri(new Uri("http://maps.google.com/?daddr=San+Francisco,+CA&saddr=Mountain+View"));
} else if (Device.OS == TargetPlatform.WinPhone) {
DisplayAlert("To Do", "Not yet implemented", "OK");
}
};
Content = new StackLayout{
Padding = new Thickness (5, 20, 5, 0),
HorizontalOptions = LayoutOptions.Fill,
Children = {
l,
openLocation,
openDirections
}
};
}
}
}

@ -1,113 +0,0 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Maps;
using System.Diagnostics;
namespace NightFlash
{
public class MapPage : ContentPage
{
Map map;
public MapPage ()
{
map = new Map {
IsShowingUser = true,
HeightRequest = 100,
WidthRequest = 960,
VerticalOptions = LayoutOptions.FillAndExpand
};
// You can use MapSpan.FromCenterAndRadius
// map.MoveToRegion (MapSpan.FromCenterAndRadius (
// new Position (37, -122), Distance.FromMiles (0.3)));
// or create a new MapSpan object directly
map.MoveToRegion (new MapSpan (new Position (0,0), 360, 360) );
// add the slider
var slider = new Slider (1, 18, 1);
slider.ValueChanged += (sender, e) => {
var zoomLevel = e.NewValue; // between 1 and 18
var latlongdegrees = 360 / (Math.Pow(2, zoomLevel));
Debug.WriteLine(zoomLevel + " -> " + latlongdegrees);
if (map.VisibleRegion != null)
map.MoveToRegion(new MapSpan (map.VisibleRegion.Center, latlongdegrees, latlongdegrees));
};
// create map style buttons
var street = new Button { Text = "Street" };
var hybrid = new Button { Text = "Hybrid" };
var satellite = new Button { Text = "Satellite" };
street.Clicked += HandleClicked;
hybrid.Clicked += HandleClicked;
satellite.Clicked += HandleClicked;
var segments = new StackLayout { Spacing = 30,
HorizontalOptions = LayoutOptions.CenterAndExpand,
Orientation = StackOrientation.Horizontal,
Children = {street, hybrid, satellite}
};
// put the page together
var stack = new StackLayout { Spacing = 0 };
stack.Children.Add(map);
stack.Children.Add (slider);
stack.Children.Add (segments);
Content = stack;
// for debugging output only
map.PropertyChanged += (sender, e) => {
Debug.WriteLine(e.PropertyName + " just changed!");
if (e.PropertyName == "VisibleRegion" && map.VisibleRegion != null)
CalculateBoundingCoordinates (map.VisibleRegion);
};
}
void HandleClicked (object sender, EventArgs e)
{
var b = sender as Button;
switch (b.Text) {
case "Street":
map.MapType = MapType.Street;
break;
case "Hybrid":
map.MapType = MapType.Hybrid;
break;
case "Satellite":
map.MapType = MapType.Satellite;
break;
}
}
/// <summary>
/// In response to this forum question http://forums.xamarin.com/discussion/22493/maps-visibleregion-bounds
/// Useful if you need to send the bounds to a web service or otherwise calculate what
/// pins might need to be drawn inside the currently visible viewport.
/// </summary>
static void CalculateBoundingCoordinates (MapSpan region)
{
// WARNING: I haven't tested the correctness of this exhaustively!
var center = region.Center;
var halfheightDegrees = region.LatitudeDegrees / 2;
var halfwidthDegrees = region.LongitudeDegrees / 2;
var left = center.Longitude - halfwidthDegrees;
var right = center.Longitude + halfwidthDegrees;
var top = center.Latitude + halfheightDegrees;
var bottom = center.Latitude - halfheightDegrees;
// Adjust for Internation Date Line (+/- 180 degrees longitude)
if (left < -180) left = 180 + (180 + left);
if (right > 180) right = (right - 180) - 180;
// I don't wrap around north or south; I don't think the map control allows this anyway
Debug.WriteLine ("Bounding box:");
Debug.WriteLine (" " + top);
Debug.WriteLine (" " + left + " " + right);
Debug.WriteLine (" " + bottom);
}
}
}
Loading…