private void InitCircle() { _mCircleOneRunnable = new Runnable(() => { mGroundOverlays[0] = mGoogleMap.AddGroundOverlay(new GroundOverlayOptions() .Position(_mLatLng, (int)_mDistance) .InvokeTransparency(_mTransparency) .InvokeImage(_mBackgroundImageDescriptor)); StartAnimation(0); }); _mCircleTwoRunnable = new Runnable(() => { mGroundOverlays[1] = mGoogleMap.AddGroundOverlay(new GroundOverlayOptions() .Position(_mLatLng, (int)_mDistance) .InvokeTransparency(_mTransparency) .InvokeImage(_mBackgroundImageDescriptor)); StartAnimation(1); }); _mCircleThreeRunnable = new Runnable(() => { mGroundOverlays[2] = mGoogleMap.AddGroundOverlay(new GroundOverlayOptions() .Position(_mLatLng, (int)_mDistance) .InvokeTransparency(_mTransparency) .InvokeImage(_mBackgroundImageDescriptor)); StartAnimation(2); }); _mCircleFourRunnable = new Runnable(() => { mGroundOverlays[3] = mGoogleMap.AddGroundOverlay(new GroundOverlayOptions() .Position(_mLatLng, (int)_mDistance) .InvokeTransparency(_mTransparency) .InvokeImage(_mBackgroundImageDescriptor)); StartAnimation(3); }); }
public async void OnLocationChanged(Location location) { _currentLocation = location; if (_currentLocation != null) { bool jump = Math.Abs(_currentLocation.Latitude - lat) > 1 || Math.Abs(_currentLocation.Longitude - lon) > 1; lat = _currentLocation.Latitude; lon = _currentLocation.Longitude; LatLng loc = new LatLng(lat, lon); CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(loc, 18); if (_map != null) { if (jump) { _map.MoveCamera(cameraUpdate); } else { _map.AnimateCamera(cameraUpdate); } } if (_myOverlay != null) { _myOverlay.Position = loc; } else { BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.gherkin); GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions() .Position(loc, bHeight / 4, bHeight / 4) .InvokeImage(image); _myOverlay = _map.AddGroundOverlay(groundOverlayOptions); } if (_enemyOverlay == null) { BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.question); GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions() .Position(new LatLng(lat + 0.000001, lon + 0.000001), bHeight / 4, bHeight / 4) .InvokeImage(image); _enemyOverlay = _map.AddGroundOverlay(groundOverlayOptions); _enemyOverlay.Clickable = true; } } }
private GroundOverlay SobreporMapaComImagem(LatLng geoPosition, BitmapDescriptor bitmapDescriptor, float width, float heigth) { //LatLng NEWARK = new LatLng(-23.312847, -51.1448709); //BitmapDescriptorFactory.FromResource(Resource.Drawable.Icon) GroundOverlayOptions newarkMap = new GroundOverlayOptions() .InvokeImage(bitmapDescriptor).Position(geoPosition, width, heigth); return(GMap.AddGroundOverlay(newarkMap)); }
private void PositionChicagoGroundOverlay(LatLng position) { if (_chicagoOverlay == null) { BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.monkey); GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions() .Position(position, 150000, 200000) .InvokeImage(image); _chicagoOverlay = _map.AddGroundOverlay(groundOverlayOptions); } else { _chicagoOverlay.Position = Location_Chicago; } }
private void PositionPolarBearGroundOverlay(LatLng position) { if (_polarBearOverlay == null) { BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.polarbear); GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions() .Position(position, 150, 200) .InvokeImage(image); _polarBearOverlay = _map.AddGroundOverlay(groundOverlayOptions); } else { _polarBearOverlay.Position = InMaui; } }
private void addDroneImage() { var currentPositionAsLatLon = new LatLng( mapWithRoute.CurrentPosition.Lat, mapWithRoute.CurrentPosition.Lon ); var droneResource = customerapp.Droid.Resource.Drawable.drone; var image = BitmapDescriptorFactory.FromResource(droneResource); var groundOverLay = new GroundOverlayOptions() .Position(currentPositionAsLatLon, 16) .InvokeImage(image); map.AddGroundOverlay(groundOverLay); }
void PositionPolarBearGroundOverlay(LatLng position) { if (polarBearOverlay == null) { var polarBear = BitmapDescriptorFactory.FromResource(Resource.Drawable.polarbear); var groundOverlayOptions = new GroundOverlayOptions() .InvokeImage(polarBear) .Anchor(0, 1) .Position(position, 150, 200); polarBearOverlay = googleMap.AddGroundOverlay(groundOverlayOptions); } else { polarBearOverlay.Position = InMaui; } }
public void OnMapReady(GoogleMap googleMap) { _googleMap = googleMap; googleMap.MyLocationEnabled = true; googleMap.MyLocationButtonClick += LocationButtonClick; googleMap.UiSettings.MapToolbarEnabled = false; googleMap.UiSettings.ZoomControlsEnabled = true; googleMap.UiSettings.CompassEnabled = true; SetUpLocation(); //Set up current position/image BitmapDescriptor image = BitmapDescriptorFactory.FromResource(Resource.Drawable.bluedot); GroundOverlayOptions groundOverlayOptions = new GroundOverlayOptions() .Position(LocationToLatLong(_currentLocation), 10, 10) .InvokeImage(image); _myOverlay = _googleMap.AddGroundOverlay(groundOverlayOptions); MoveCamera(_currentLocation); }
public void OnMapReady(GoogleMap googleMap) { googleMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(NEWARK, 11)); images.Clear(); images.Add(BitmapDescriptorFactory.FromResource(Resource.Drawable.newark_nj_1922)); images.Add(BitmapDescriptorFactory.FromResource(Resource.Drawable.newark_prudential_sunny)); currentEntry = 0; groundOverlay = googleMap.AddGroundOverlay(new GroundOverlayOptions() .InvokeImage(images [currentEntry]) .Anchor(0, 1) .Position(NEWARK, 8600f, 6500f)); transparencyBar.ProgressChanged += (sender, e) => { if (groundOverlay != null) { groundOverlay.Transparency = (float)e.Progress / (float)TRANSPARENCY_MAX; } }; googleMap.SetContentDescription("Google Map with ground overlay."); }