-
Aug 16th, 2018, 09:50 AM
#1
Thread Starter
Member
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.
-
Aug 16th, 2018, 10:13 AM
#2
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
-
Aug 16th, 2018, 10:26 AM
#3
Thread Starter
Member
Re: GMaps adding Marker Pins
It has red, only under the last PointLatlang now ,
Value of type 'PointLatLng' cannot be converted to 'GMapMarker'.
-
Aug 16th, 2018, 11:20 AM
#4
Re: GMaps adding Marker Pins
According to this tutorial, GMapMarker, takes both PointLatLng and GMarkerGoogleType parameters.
vb.net Code:
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|