public void OnMapReady(GoogleMap googleMap) { map = googleMap; bool success = map.SetMapStyle( MapStyleOptions.LoadRawResourceStyle( this, Resource.Raw.style_json)); LatLng latLng = new LatLng(location.Latitude, location.Longitude); CameraPosition.Builder builder = CameraPosition.InvokeBuilder(); builder.Target(latLng); builder.Zoom(18); builder.Bearing(0); builder.Tilt(0); CameraPosition cameraPosition = builder.Build(); CameraUpdate cameraUpdate = CameraUpdateFactory.NewCameraPosition(cameraPosition); map.MoveCamera(cameraUpdate); map.SetOnMarkerClickListener(this); mapClickListener = new MapClickListener(this); map.SetOnMapClickListener(mapClickListener); map.SetOnMarkerClickListener(this); playerRegion = CalculateRegion((decimal)location.Latitude, (decimal)location.Longitude); Spawner spawner = new Spawner(map, location.Latitude, location.Longitude, 5, 5, 100); //mapObjectManager.CreateTestObject(playerRegion); //mapObjectManager.GetMapObjects(map, playerRegion, null); }
protected override void OnMapReady(GoogleMap map) { var clickListener = new MapClickListener(map); map.SetOnMapClickListener(clickListener); _map = map; base.OnMapReady(_map); NativeMap.InfoWindowClick += OnInfoWindowClick; NativeMap.SetInfoWindowAdapter(this); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Window.SetSoftInputMode(SoftInput.AdjustPan); ContentView = new MainView(this); SetContentView(ContentView); LocationClient = new LocationClient(ContentView.MapView); if (IsMarshmallow) { RequestPermissions(Permissions); } else { OnPermissionsGranted(); } PointClient = new PointClient(ContentView.MapView); var bitmap = BitmapFactory.DecodeResource(Resources, Resource.Drawable.icon_pin_red); PointClient.Bitmap = BitmapUtils.CreateBitmapFromAndroidBitmap(bitmap); bitmap = BitmapFactory.DecodeResource(Resources, Resource.Drawable.icon_banner_info); // Scale down, as our original image is too large int size = (int)(20 * ContentView.Density); bitmap = Bitmap.CreateScaledBitmap(bitmap, size, size, false); PointClient.PointListener.LeftImage = BitmapUtils.CreateBitmapFromAndroidBitmap(bitmap); PointClient.QueryPoints(delegate { }); MapListener = new MapClickListener(); List <Data> items = SQLClient.Instance.GetAll(); if (items.Count > 0) { ShowSyncAlert(items.Count); } }
public override void ViewDidLoad() { base.ViewDidLoad(); Title = "Data Collection"; ContentView = new MainView(); View = ContentView; LocationManager = new LocationManager(); LocationClient = new LocationClient(ContentView.MapView); PointClient = new PointClient(ContentView.MapView); PointClient.Bitmap = BitmapUtils.CreateBitmapFromUIImage(UIImage.FromFile("icon_pin_red.png")); MapListener = new MapClickListener(); string text = "QUERYING POINTS..."; ContentView.Banner.SetLoadingText(text, false); List <Data> items = SQLClient.Instance.GetAll(); if (items.Count > 0) { ShowSyncAlert(items.Count); } PointClient.QueryPoints(delegate { InvokeOnMainThread(delegate { ContentView.Banner.Hide(); }); }); var image = UIImage.FromFile("icon_banner_info.png"); image = ImageUtils.Resize(image, 70.0f); PointClient.PointListener.LeftImage = BitmapUtils.CreateBitmapFromUIImage(image); }
void Start() { _listener = BG.GetComponent <MapClickListener>(); _listener.OnCellClicked += CellClicked; _listener.OnEdgeClicked += EdgeClicked; }