Hello All,
This is the first time I am posting on this site, I tried to correct my message to be more clear, I need your help, let me explain my problem, my goal is to locate service stations in a city and see their markers with info bubble containing private information
I used : gmapControl en ajoutant GMap.NET.WindowsForms.dll
- The horizontal zoom bar is not visible
- When I seek a point, I could not choose the most adequate zoom to display maximum detail on item sought
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Windows.Media.Imaging;
using GMap.NET;
using GMap.NET.MapProviders;
using GMap.NET.WindowsForms;
using GMap.NET.WindowsForms.Markers;
using System.Windows.Media;
namespace Région_Kenitra_Services
{
public partial class FMainStations : Form
{
GMapOverlay overlayOne;
public FMainStations()
{
InitializeComponent();
cmbStation.SelectedIndex = 4;
}
private void FMainStations_Load(object sender, EventArgs e)
{
gMap.MapProvider = GMap.NET.MapProviders.GoogleMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerAndCache;
gMap.SetCurrentPositionByKeywords("K, M");
gMap.CanDragMap = true;
gMap.DragButton = MouseButtons.Left;
gMap.Dock = System.Windows.Forms.DockStyle.Fill;
gMap.MouseWheelZoomType = MouseWheelZoomType.MousePositionAndCenter;
overlayOne = new GMapOverlay(gMap, "OverlayOne");
overlayOne.Markers.Add(new GMap.NET.WindowsForms.Markers.GMapMarkerCross
(new PointLatLng(34.3252919244273, -6.5533447265635)));
gMap.Overlays.Add(overlayOne);
gMap.ZoomAndCenterMarkers(overlayOne.Id);
}
private void gMap_MouseDoubleClick(object sender, MouseEventArgs e)
{
double lat = 0,lng = 0 ;
if (e.Button == System.Windows.Forms.MouseButtons.Left)
{
lat = gMap.FromLocalToLatLng(e.X, e.Y).Lat;
lng = gMap.FromLocalToLatLng(e.X, e.Y).Lng;
}
MessageBox.Show(("Point : "+lat+"/"+lng));
}
private void btnImg_Click(object sender, EventArgs e)
{
}
private void btnOK_Click(object sender, EventArgs e)
{
gMap.MaxZoom = 30;
string adresse1, adresse2, adresse3, adresse4 = "";
double lat1, lat2, lat3, lat4 = 0;
double lng1, lng2, lng3, lng4 = 0;
adresse1 = "Station 1 \n Hôtel La Rotonde, \n Rue Mohamed Diouri,\n Kénitra, Maroc";
lat1 = 34.2563970;
lng1 = -6.5827260;
overlayOne.Markers.Clear();
MarkerTooltipMode mode = MarkerTooltipMode.Always;
System.Drawing.Brush ToolTipBackColor = new SolidBrush(System.Drawing.Color.Coral);
if (cmbStation.SelectedIndex.ToString() == "0")
{
gMap.Position = new PointLatLng(lat1, lng1);
GMapMarkerGoogleRed marker = new GMapMarkerGoogleRed(gMap.Position);
marker.ToolTip = new GMap.NET.WindowsForms.ToolTips.GMapBaloonToolTip(marker);
marker.ToolTip.Format.Alignment = StringAlignment.Center;
marker.ToolTipMode = mode;
marker.ToolTip.Fill = ToolTipBackColor;
marker.ToolTipText = adresse1.ToString();
overlayOne.Markers.Add(marker);
gMap.Overlays.Add(overlayOne);
}
}
}
}
I need your help ..pls correct me