private void OnCameraChanged(EventPattern <GoogleMap.CameraChangeEventArgs> e) { if (_bypassCameraChangeEvent) { _bypassCameraChangeEvent = false; return; } var bounds = GetMapBoundsFromProjection(); if (!_lockGeocoding) { ViewModel.UserMovedMap.ExecuteIfPossible(bounds); } if (!_settings.ShowIndividualTaxiMarkerOnly) { ShowAvailableVehicles(VehicleClusterHelper.Clusterize(AvailableVehicles, bounds)); } if (TaxiLocation != null) { CancelAutoFollow.ExecuteIfPossible(); } }
public OrderMapView(IntPtr handle) : base(handle) { Initialize(); _dropoffCenterPin = new UIImageView(AddressAnnotation.GetImage(AddressAnnotationType.Destination)) { BackgroundColor = UIColor.Clear, ContentMode = UIViewContentMode.Center, Hidden = true }; _pickupCenterPin = new UIImageView(AddressAnnotation.GetImage(AddressAnnotationType.Pickup)) { BackgroundColor = UIColor.Clear, ContentMode = UIViewContentMode.Center, Hidden = true }; RegionChanged += (s, e) => { var canShowClusterizedTaxiMarker = ViewModel != null && !ViewModel.Settings.ShowIndividualTaxiMarkerOnly; if (canShowClusterizedTaxiMarker && CanShowAvailableVehicle()) { ShowAvailableVehicles(VehicleClusterHelper.Clusterize(AvailableVehicles != null ? AvailableVehicles.ToArray() : null, GetMapBoundsFromProjection())); } if (TaxiLocation != null && !_automatedMapChanged) { CancelAutoFollow.ExecuteIfPossible(); } else if (_automatedMapChanged) { _automatedMapChanged = false; } }; }