Results 1 to 4 of 4

Thread: GMaps adding Marker Pins

  1. #1

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    GMaps adding Marker Pins

    i have tried looking everywhere but all examples seem to be in C..
    I am trying to make a form show a map with some pins on it..
    I can make map, but can't seem to get pins right..;
    The pins are called markers , they go in a layers, and the layer get added to the map.
    All new to me so any help , appreciated.


    Code:
    Imports GMap.NET
    Imports GMap.NET.MapProviders
    Imports GMap.NET.WindowsForms.Markers
    Imports GMap.NET.WindowsForms
    Imports System.Threading
    
    
    Public Class frmMap
    
    	Private map As GMap.NET.WindowsForms.GMapControl
    
    
    
    	Public Function FormLoad() As Boolean
    
    		map.Overlays.Clear()
    		Dim overlayOne As New GMapOverlay("OverlayOne")
    		Dim Markers As GMapMarker
    
    
    		With map
    
    			.Position = New PointLatLng(19.442288, -70.652266)
    			.ShowCenter = False
    			.MapProvider = MapProviders.GoogleMapProvider.Instance
    			.MinZoom = 3
    			.MaxZoom = 17
    			.Zoom = 16
    			.MarkersEnabled = True
    			.Manager.Mode = AccessMode.ServerOnly
    			.MapProvider = BingHybridMapProvider.Instance
    			.SetPositionByKeywords("Paris, France")
    			.Overlays.Add(overlayOne)
    
    		End With
    		GMaps.Instance.Mode = AccessMode.ServerOnly
    		overlayOne.Markers.Add(New PointLatLng(19.442288, -70.652266))
    
    
    
    		Return True
    	End Function
    Last edited by Shaggy Hiker; Aug 16th, 2018 at 10:10 AM. Reason: Added CODE tags.

  2. #2
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    Re: GMaps adding Marker Pins

    I'm not familiar with the map control you are using. I've done this using Bing maps, but I expect that it is totally different. I do notice that you set the the MapProvider twice, once using Google and once using Bing, though that is very unlikely to be related to the problem.

    So, what is happening? Are you not seeing the pins, or are they showing up, but in the wrong place/format, or something like that?
    My usual boring signature: Nothing

  3. #3

    Thread Starter
    Member
    Join Date
    May 2018
    Posts
    41

    Re: GMaps adding Marker Pins

    It has red, only under the last PointLatlang now ,

    Value of type 'PointLatLng' cannot be converted to 'GMapMarker'.

  4. #4
    Frenzied Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    1,191

    Re: GMaps adding Marker Pins

    According to this tutorial, GMapMarker, takes both PointLatLng and GMarkerGoogleType parameters.

    vb.net Code:
    1. Dim marker As GMap.NET.WindowsForms.GMapMarker = New GMap.NET.WindowsForms.Markers.GMarkerGoogle(New GMap.NET.PointLatLng(48.8617774, 2.349272), GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue_pushpin)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width