public bool OnMapClick(Com.Mapbox.Mapboxsdk.Geometry.LatLng p0) { var point = map.Projection.ToScreenLocation(p0); var xfPoint = new Xamarin.Forms.Point(point.X, point.Y); var xfPosition = new NxLatLng(p0.Latitude, p0.Longitude); (NxLatLng, Xamarin.Forms.Point)commandParamters = (xfPosition, xfPoint); if (Element.DidTapOnMapCommand?.CanExecute(commandParamters) == true) { Element.DidTapOnMapCommand.Execute(commandParamters); } // TODO should return true return(false); }
private void OnCameraIdle(object sender, EventArgs e) { cameraBusy = false; currentCamera = new NxLatLng(map.CameraPosition.Target.Latitude, map.CameraPosition.Target.Longitude); Element.ZoomLevel = map.CameraPosition.Zoom; if (!Element.Center.Equals(currentCamera)) { Element.Center = currentCamera; var region = map.Projection.GetVisibleRegion(true); double northEastLat = region.LatLngBounds.NorthEast.Latitude; double northEastLng = region.LatLngBounds.NorthEast.Longitude; double southWestLat = region.LatLngBounds.SouthWest.Latitude; double southWestLng = region.LatLngBounds.SouthWest.Longitude; var bounds = new Naxam.Mapbox.LatLngBounds() { NorthEast = new NxLatLng(northEastLat, northEastLng), SouthWest = new NxLatLng(southWestLat, southWestLng) }; Element.DidBoundariesChangedCommand?.Execute(bounds); } }