Center map in one marker

Topics: Windows Forms
Feb 13, 2012 at 4:00 PM

Hi everyone,

I'm a new guy in gmaps.net, and have some problems with Gmap in Vb.Net 2010.

I use this code for show me a map, and a marker.

I would like the marker appear center in the map, but it doesn't..

Why not??

Private Sub GMapControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GMapControl1.Load
        With GMapControl1
            .SetCurrentPositionByKeywords("Lisbon, Portugal")
            .MapProvider = GMapProviders.GoogleSatelliteMap
            .MinZoom = 3
            .MaxZoom = 17
            .Zoom = 16
            .Manager.Mode = AccessMode.ServerAndCache
            Dim overlayOne = New GMapOverlay(GMapControl1, "OverlayOne")
            overlayOne.Markers.Add(New GMap.NET.WindowsForms.Markers.GMapMarkerGoogleRed(New PointLatLng(40.707101, -8.491374)))
            .Overlays.Add(overlayOne)
            GMapControl1.ZoomAndCenterMarkers("overlayone")
            GMapControl1.DragButton = Windows.Forms.MouseButtons.Left
            GMapControl1.CanDragMap = True

        End With
    End Sub

Coordinator
Feb 14, 2012 at 6:24 AM

OverlayOne != overlayone, and use forms constructor