private void UpdateLocation() { double latitude, longitude; this.m_errorMessage = null; if (!double.TryParse(this.m_latitudeString, out latitude)) { if (!AngleUtils.TryParseDMS(this.m_latitudeString, out latitude)) { this.m_errorMessage = "Invalid latitude"; return; } } if (!double.TryParse(this.m_longitudeString, out longitude)) { if (!AngleUtils.TryParseDMS(this.m_longitudeString, out longitude)) { this.m_errorMessage = "Invalid longitude"; return; } } var location = new GlobalLocation(this.TargetLocation.Body, new Coordinates(latitude: latitude, longitude: longitude)); this.m_module.SetTargetLocation(location); Reset(); }
/// <summary> /// Views the will appear. /// </summary> /// <param name="animated">If set to <c>true</c> animated.</param> public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); GlobalLocation globalLocation = new GlobalLocation(this, true); //Current location FetchFriends(); //API call }
public void SetLocation(GlobalLocation location) { this.Location = location; if (location.Body.HasSurface()) { this.m_gameObject.transform.position = location.Position; } }
public ActionResult Login() { UsuarioModel model = new UsuarioModel(); model.EstadosList = GlobalLocation.GetStates("Brazil"); model.CidadesList = GlobalLocation.GetCities_BRA("RS"); return(View(model)); }
public VirtualTarget(GlobalLocation location) { this.Name = "Virtual Target"; this.Location = location; this.m_vessel = new Vessel() { id = Guid.NewGuid(), }; }
/// <summary> /// Views the did load. /// </summary> public override void ViewDidLoad() { base.ViewDidLoad(); unHideNavigationBar(this.NavigationController); setupNavigationBackground(this.NavigationController); this.NavigationController.NavigationBar.TintColor = UIColor.White; this.Title = "SOCIAL CIRCLE"; GlobalLocation globalLocation = new GlobalLocation(this, true); GradientBackgroundForButton(msgButton); msgButton.Layer.CornerRadius = 4; msgButton.ClipsToBounds = true; CornerRadius(35, addButton); NavigationController.NavigationBar.Translucent = false; if (!string.IsNullOrEmpty(Settings.UserLatSettings)) { GlobalLocation globalLocation_Local = new GlobalLocation(this, true); camera = CameraPosition.FromCamera(latitude: Convert.ToDouble(Settings.UserLatSettings), longitude: Convert.ToDouble(Settings.UserLongSettings), zoom: 12, bearing: 44, viewingAngle: 10); mapView = MapView.FromCamera(CGRect.Empty, camera); if (mapView != null) { mapView.MyLocationEnabled = true; mapView.Animate(camera); } } else { camera = CameraPosition.FromCamera(latitude: 30.7108, longitude: 76.7094, zoom: 12, bearing: 44, viewingAngle: 10); mapView = MapView.FromCamera(CGRect.Empty, camera); mapView.MyLocationEnabled = true; } var fitBoundsButton = new UIBarButtonItem("", UIBarButtonItemStyle.Plain, DidTapFitBounds); fitBoundsButton.Image = UIImage.FromBundle("Image-1"); NavigationItem.RightBarButtonItem = fitBoundsButton; customButton1.Frame = new CGRect(8, 5, 45, 45); customButton2.Frame = new CGRect(View.Frame.X + View.Frame.Width - 53, 5, 45, 45); customButton3.Frame = new CGRect(View.Frame.X + View.Frame.Width - 53, customButton2.Frame.Y + customButton2.Frame.Height + 5, 45, 45); msgButton.Frame = new CGRect(20, View.Frame.Height - 140, View.Frame.Width - 40, 45); addButton.Frame = new CGRect(View.Frame.X + View.Frame.Width - 80, View.Frame.Height - 230, addButton.Frame.Width, addButton.Frame.Height); mapView.Add(msgButton); mapView.Add(addButton); mapView.Add(customButton1); mapView.Add(customButton2); mapView.Add(customButton3); View = mapView; mapView.Delegate = new CustomMapDelegate(mapView); //Call Delegate of MapView markers = new List <Marker>(); // Initialize marker list HandleClicks(); //Button Clicks CreateCircle(); //Circle with static radius }
private static Location GetTown(Position position) { var seeds = new List <Seed>(); seeds.Add(Seed.Monster(123)); var loc = new GlobalLocation("Town", position, seeds); loc.Neighbours.Add(Position.FromString("001001001002")); loc.Neighbours.Add(Position.FromString("001001001003")); loc.ImageUrl = "town.png"; return(loc); }
/// <summary> /// Animates the camera. /// </summary> public void AnimateCamera() { GlobalLocation globalLocation_Local = new GlobalLocation(this, true); if (!string.IsNullOrEmpty(Settings.UserLatSettings)) { camera = CameraPosition.FromCamera(latitude: Convert.ToDouble(Settings.UserLatSettings), longitude: Convert.ToDouble(Settings.UserLongSettings), zoom: 12, bearing: 44, viewingAngle: 10); if (mapView != null) { mapView.MyLocationEnabled = true; mapView.Animate(camera); } } }
public static void DrawMapViewGroundMarker(GlobalLocation location, Color c, double rotation = 0, double radius = 0) { var body = location.Body; var coordinates = location.Coordinates; Vector3d up = location.SurfaceUpVector; var height = body.pqsController.GetSurfaceHeight(QuaternionD.AngleAxis(coordinates.Longitude, Vector3d.down) * QuaternionD.AngleAxis(coordinates.Latitude, Vector3d.forward) * Vector3d.right); if (height < body.Radius) { height = body.Radius; } Vector3d center = body.position + height * up; if (body.IsOccluding(center)) { return; } Vector3d north = Vector3d.Exclude(up, body.transform.up).normalized; if (radius <= 0) { radius = body.Radius / 15; } GLTriangleMap(new [] { center, center + radius * (QuaternionD.AngleAxis(rotation - 10, up) * north), center + radius * (QuaternionD.AngleAxis(rotation + 10, up) * north) }, c); GLTriangleMap(new [] { center, center + radius * (QuaternionD.AngleAxis(rotation + 110, up) * north), center + radius * (QuaternionD.AngleAxis(rotation + 130, up) * north) }, c); GLTriangleMap(new [] { center, center + radius * (QuaternionD.AngleAxis(rotation - 110, up) * north), center + radius * (QuaternionD.AngleAxis(rotation - 130, up) * north) }, c); }
public string GetMapsUri(string url, ref string refText) { if (!AppendSettingDialog.Instance.IsPreviewFoursquare) { return(null); } var urlId = Regex.Replace(url, @"https?://(4sq|foursquare)\.com/", ""); if (CheckInUrlsVenueCollection.ContainsKey(urlId)) { refText = CheckInUrlsVenueCollection[urlId].LocateInfo; return(MapThumb.GetDefaultInstance().CreateStaticMapUrl(CheckInUrlsVenueCollection[urlId])); } FourSquareDataModel.Venue curVenue = null; var venueId = GetVenueId(url); if (string.IsNullOrEmpty(venueId)) { return(null); } curVenue = GetVenueInfo(venueId); if (curVenue == null) { return(null); } var curLocation = new GlobalLocation { Latitude = curVenue.Location.Latitude, Longitude = curVenue.Location.Longitude, LocateInfo = CreateVenueInfoText(curVenue) }; //例外発生の場合があるため if (!CheckInUrlsVenueCollection.ContainsKey(urlId)) { CheckInUrlsVenueCollection.Add(urlId, curLocation); } refText = curLocation.LocateInfo; return(MapThumb.GetDefaultInstance().CreateStaticMapUrl(curLocation)); }
public string CreateGoogleStaticMapsUri(GlobalLocation locate) { return CreateGoogleStaticMapsUri( locate.Latitude, locate.Longitude ); }
public string CreateGoogleMapsUri(GlobalLocation locate) { return(CreateGoogleMapsUri(locate.Latitude, locate.Longitude)); }
internal void SetTargetLocation(GlobalLocation location) { StopPickingVirtualTarget(keepTarget: false); this.m_virtualTarget.SetLocation(location); this.SystemState = SystemStates.TargetSelected; }