protected override void OnCreate(Android.OS.Bundle savedInstanceState) { base.OnCreate(savedInstanceState); AddBaseLayer(CartoBaseMapStyle.CartoBasemapStyleDefault); // Initialize a local vector data source LocalVectorDataSource source = new LocalVectorDataSource(BaseProjection); // Initialize a vector layer with the previous data source VectorLayer layer = new VectorLayer(source); // Add the previous vector layer to the map MapView.Layers.Add(layer); // Create marker style Android.Graphics.Bitmap androidMarkerBitmap = Android.Graphics.BitmapFactory.DecodeResource(Resources, Resource.Drawable.marker); Carto.Graphics.Bitmap markerBitmap = Carto.Utils.BitmapUtils.CreateBitmapFromAndroidBitmap(androidMarkerBitmap); MarkerStyleBuilder markerStyleBuilder = new MarkerStyleBuilder(); markerStyleBuilder.Bitmap = markerBitmap; markerStyleBuilder.Size = 30; MarkerStyle markerStyle = markerStyleBuilder.BuildStyle(); // Add marker MapPos berlin = MapView.Options.BaseProjection.FromWgs84(new MapPos(13.38933, 52.51704)); Marker marker = new Marker(berlin, markerStyle); source.Add(marker); // Add popup PopupStyleBuilder builder = new PopupStyleBuilder(); builder.SetAttachAnchorPoint(0.5f, 0); PopupStyle popupStyle = builder.BuildStyle(); BasicCustomPopupHandler popupHandler = new BasicCustomPopupHandler("custom popup"); CustomPopup popup = new CustomPopup(marker, popupStyle, popupHandler); popup.SetAnchorPoint(-1, 0); source.Add(popup); // Animate map to the marker MapView.SetFocusPos(berlin, 1); MapView.SetZoom(12, 1); }
private void pepButton1_Click(object sender, EventArgs e) { try { MySqlConnection myDataBase = DBUtils.GetDBConnection(pepTextbox1.Text, pepTextbox2.Text); myDataBase.Open(); Customer obj = new Customer(myDataBase, this, pepTextbox1.Text, pepTextbox2.Text); obj.Show(); this.Visible = false; } catch (Exception ex) { CustomPopup obj = new CustomPopup("Unable to connect to the database : " + ex.Message); obj.Show(this); } pepTextbox1.Text = ""; pepTextbox2.Text = ""; }
public void custom_Click(object sender, EventArgs e) { expert.Checked = false; intermediate.Checked = false; beginner.Checked = false; custom.Checked = true; ResetGUI(); for (int row = 0; row < height; row++) { for (int col = 0; col < width; col++) { tileButton[row, col].Dispose(); } } CustomPopup y = new CustomPopup(this); RedrawGUI(); }
public override void ViewDidLoad() { base.ViewDidLoad(); // Add default base layer AddBaseLayer(CartoBaseMapStyle.CartoBasemapStyleDefault); LocalVectorDataSource source = new LocalVectorDataSource(BaseProjection); VectorLayer layer = new VectorLayer(source); MapView.Layers.Add(layer); MarkerStyleBuilder builder = new MarkerStyleBuilder(); builder.Bitmap = Bitmap; builder.Size = 20; // Add marker MapPos position = BaseProjection.FromWgs84(new MapPos(24.646469, 59.426939)); Marker marker = new Marker(position, builder.BuildStyle()); source.Add(marker); // Custom popup PopupStyleBuilder popupBuilder = new PopupStyleBuilder(); popupBuilder.SetAttachAnchorPoint(0.5f, 0); // Initialize our custom handler, cf. class below MyCustomPopupHandler handler = new MyCustomPopupHandler(); CustomPopup popup = new CustomPopup(marker, popupBuilder.BuildStyle(), handler); popup.SetAnchorPoint(-1.0f, 0.0f); source.Add(popup); }
protected override void OnCreate(Android.OS.Bundle savedInstanceState) { base.OnCreate(savedInstanceState); AddOnlineBaseLayer(CartoBaseMapStyle.CartoBasemapStyleDefault); // Initialize a local vector data source LocalVectorDataSource source = new LocalVectorDataSource(BaseProjection); // Initialize a vector layer with the previous data source VectorLayer layer = new VectorLayer(source); // Add the previous vector layer to the map MapView.Layers.Add(layer); // Create marker style Android.Graphics.Bitmap androidMarkerBitmap = Android.Graphics.BitmapFactory.DecodeResource(Resources, Resource.Drawable.marker); Carto.Graphics.Bitmap markerBitmap = Carto.Utils.BitmapUtils.CreateBitmapFromAndroidBitmap(androidMarkerBitmap); MarkerStyleBuilder markerStyleBuilder = new MarkerStyleBuilder(); markerStyleBuilder.Bitmap = markerBitmap; markerStyleBuilder.Size = 30; MarkerStyle markerStyle = markerStyleBuilder.BuildStyle(); // Add marker MapPos berlin = MapView.Options.BaseProjection.FromWgs84(new MapPos(13.38933, 52.51704)); Marker marker = new Marker(berlin, markerStyle); source.Add(marker); // Add popup PopupStyleBuilder builder = new PopupStyleBuilder(); builder.SetAttachAnchorPoint(0.5f, 0); PopupStyle popupStyle = builder.BuildStyle(); BasicCustomPopupHandler popupHandler = new BasicCustomPopupHandler("custom popup"); CustomPopup popup = new CustomPopup(marker, popupStyle, popupHandler); popup.SetAnchorPoint(-1, 0); source.Add(popup); // Animate map to the marker MapView.SetFocusPos(berlin, 1); MapView.SetZoom(12, 1); }
private void BtnShowPopup_Clicked(object sender, EventArgs e) { CustomPopup.Show(); }