Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all 3384 articles
Browse latest View live

New Post: Removing / Adding Overlays

$
0
0
i got a problem with removing overlays from the gmapscontrol.
gMapControl1.Overlays.Remove(gmoOverlay); 
this doesn't work for me... when i try removing with the index, the Overlays.IndexOf(gmoOverlay) alwas return -1, even the overlay is 5 times in it... please help me.

New Post: About route edit with WPF

$
0
0
I've just used this great lib to write my WPF application. But one problem is puzzled me.

When I add points to an exist route, it can not be refreshed until zoom in or out. I searched for this problem, and only find to use MapControl.UpdateRouteLocalPosition(route)) in WinForm. But how should I do to achieve the same function in WPF?


Thank you for read it and can anyone help me ?

New Post: About route edit with WPF

$
0
0
aha

I tried one way that it works.
route.RegenerateShape(MainMapControl);

New Post: Bing Bird's Eye Support

$
0
0
Are there any plans to support that nice feature of Bing maps? And if not, would it be possible to implement this kind of view as a provider in the existing provider model?

Birds Eye On Bing Maps

New Post: Tooltip on routes

$
0
0
radioman wrote:
try check OnRouteEnter/Leave events
can't find this event in my gMapsControl... where is should search for it?

New Post: gMapControl1.Overlays.Remove() doesn't work

$
0
0
okay, i think i found my problem. is had used the dll's from the demo project. after i found more and more differences between the documentation and my project, i changed the dll's... don't know, if the remove works, got to rebuild my entire project.

greetzes from bavaria

New Post: gMapControl1.Overlays.Remove() doesn't work

$
0
0
i would, if the IndexOf(OverlayObject) would work, but it always returns "-1", even the Overlay is added to the gmapscontrol

New Post: gMapControl1.Overlays.Remove() doesn't work

$
0
0
Why do you need IndexOf??
Just set the new position of your marker:

gmoZiel.Position = new PointLtLng(...)

New Post: Route not displayed on map

$
0
0
Hello,

I am making a small program that loads a file with gps coordinates and plots them in a map. The map is live updated at every line read from the textfile.

When I use polygons everything works ok:
private void gps_updated(object sender,MapsUpdateEventArgs e)
        {
            

            MainMap.Position = new PointLatLng(e.Lat, e.Lon);

            PointLatLng gpoi = new PointLatLng(e.Lat, e.Lon);
            gpollist.Add(gpoi);

            GMapOverlay polyOverlay = new GMapOverlay(MainMap, "test" + counter.ToString());
            GMapPolygon polygon = new GMapPolygon(gpollist, "mypolygon" + counter.ToString());
            //GMapRoute polygon = new GMapRoute(gpollist, "mypolygon" + counter.ToString());
            //polygon.Fill = new SolidBrush(Color.FromArgb(50, Color.Red));
            polygon.Stroke = new Pen(Color.Black, 2);
            polyOverlay.Polygons.Add(polygon);
            MainMap.Overlays.Add(polyOverlay);
        }
However I would like to see a line instead of a polynome. So I modified the code:
private void gps_updated(object sender,MapsUpdateEventArgs e)
        {
            
            MainMap.Position = new PointLatLng(e.Lat, e.Lon);

            PointLatLng gpoi = new PointLatLng(e.Lat, e.Lon);
            gpollist.Add(gpoi);

            GMapOverlay polyOverlay = new GMapOverlay(MainMap, "test" + counter.ToString());
            GMapRoute route = new GMapRoute(gpollist, "mypolygon" + counter.ToString());
            route.Stroke = new Pen(Color.Black, 2);
            polyOverlay.Routes.Add(route);
            MainMap.Overlays.Add(polyOverlay);
        }
It does not work.... I've tried many combinations and I am stuck at the moment. Is there anyone who can give some advice?

Thanks in advance!

New Post: gMapControl1.Overlays.Remove() doesn't work

$
0
0
o_O that works? didn't thought, the gmapscontrol got a reference to the object and because of this i tried to readd it. thank you!

New Post: gMapControl1.Overlays.Remove() doesn't work

New Post: Error: We don't have imagery at this zoom level

$
0
0
We're using GMap with the google API and it's working fine (50 or more machines) except for one machine which gets the following:

Exception: Value Cannot Be Null
and/or
We don't have imagery at this zoom level for the region
It displays part of the map, but not all.
It gives an error in SQL Server Compact Edition and halts.

Environment - multi monitor running Windows 7 32 bit on a Dell Laptop

I have done the following:
Reset IE, Chrome,
Checked Proxy Settings
Checked DPI settings
Switched to single monitor
Checked Proxy Settings for IE

Any ideas, things to try to help track it down?
TIA

New Post: Route not displayed on map

$
0
0
Fixed :)

MainMap.RoutesEnabled = true;

New Post: ToolTip Separation

$
0
0
I see there was a discussion here about non-overlapping tooltips:

https://greatmaps.codeplex.com/discussions/226671

I'd like to implement a solution that uses GMap.net (GREAT APPLICATION BTW!) with VB.Net WinForms. I'm trying to figure out how to get the tooltip labels to not overlap when markers are close to each other. Any built in code solutions that have been created that I haven't found? I couldn't make heads or tails of the code in the above discussion.

I see an X and Y exposed for the tooltip position but that would mean looping through all tooltips and manually trying to plot things?

Thanks for any suggestions

Fairway

New Post: Tutorial: How to add custom markers in VB windows forms

$
0
0
Here is a VB.Net Code Sample I am able to add to get my map to show how it works (VS2012)

I use an SQL Query, to get data into a dataset:
Me.gmapData.Overlays.Add(gmapDataOL)
            Me.gmapData.HoldInvalidation = True
            'ADD THE MARKERS=========

            For Each row As DataRow In dsData.Tables(0).Rows
                II += 1
                sProviderData = row.Item(0) & ": " & row.Item(2) & " - " & Format(row.Item(3), "c")

                gmapDataOL.Markers.Add(New GMarkerGoogle(New PointLatLng(row.Item("Y"), row.Item("X")), GMarkerGoogleType.red))
                gmapDataOL.Markers(II - 1).ToolTipText = sProviderData ' Acts as a Label to display Data in
                gmapDataOL.Markers(II - 1).ToolTipMode = MarkerTooltipMode.Always 'Shows data Label always visible on the map
                gmapDataOL.Markers(II - 1).IsVisible = True
            Next row

            gmapDataOL.IsVisibile = True
            'REFRESH THE MAP
            gmapData.Refresh()
Thanks RadioMan for this great component!!

New Post: How can I print GMap.NET maps?

$
0
0
To Help VB.Net coders:

Here is a sample of VB Code to Copy a Map Image to the Clipboard, where you can paste it later into Word, Outlook etc:
I have a Button with Code to perform the "Copy" operation

Private Sub cmdCopy1_Click(sender As Object, e As EventArgs) Handles cmdCopy1.Click
    Dim imgMap As Image

    Try
        'Copy the image to the Clipboard=========

        imgMap = Me.gmapData.ToImage 'The map control is named gmapData

        Clipboard.SetImage(imgMap)
        Me.cmdCopy1.BackColor = Color.Violet

    Catch ex As Exception
        MessageBox.Show(ex.Message, "Error copying map!", MessageBoxButtons.OK)
    End Try

New Post: Tooltip comes when i click on label

$
0
0
Here is a simple example

Private Sub gmapData_OnMarkerClick(item As GMapMarker, e As MouseEventArgs) Handles gmapData.OnMarkerClick
    Try
        MessageBox.Show(item.ToolTipText, "This marker!", MessageBoxButtons.OK, MessageBoxIcon.Information)


    Catch ex As Exception
        MessageBox.Show(ex.Message, "Error showing data map!", MessageBoxButtons.OK)
    Finally

    End Try
End Sub

New Post: Place's Information

$
0
0
Hi,
I am using GMap.Net in my project. I need to a function that received latitude and longitude, then return information of point, such as country name, location name, state name, regional name and etc.

Can I get the state name and regional name? How?

And I used this code, but It does not work and always plc=null :
List<Placemark> plc = null;
var st = GMapProviders.GoogleMap.GetPlacemarks(new PointLatLng(myLatitude, myLongitude), out plc);
if(st == GeoCoderStatusCode.G_GEO_SUCCESS && plc != null)
{
    foreach(var pl in plc)
    {
      if(!string.IsNullOrEmpty(pl.PostalCodeNumber))
      {
        Debug.WriteLine("Accuracy: " + pl.Accuracy + ", " + pl.Address + ", PostalCodeNumber: " + pl.PostalCodeNumber);
      }
    }
}
Regards...

New Post: Two gmapControl for one place

$
0
0
Hi,
How can I use two gmapControl with different GMapProviders (for example BingMap and BingSatelliteMap) inside together that have same events.
I mean when I zoom in or zoom out on gmapControl1, it will zoom in or zoom out on gmapControl2 too.

like this :
Image

New Post: Place's Information

$
0
0
I don't know if GMap has a native way to do this but I use Google GeoCoder web service to get specifics. You can do up to 2500 per day from the same IP address. No sign up or key necessary (like mapquest, etc.)
    Dim strLocation As String = "Google Geocoded Address: "
    Dim Str As System.IO.Stream
    Dim srRead As System.IO.StreamReader
        Try
            ' make a Web request
            Dim req As System.Net.WebRequest = System.Net.WebRequest.Create("http://maps.googleapis.com/maps/api/geocode/xml?latlng=" + Latitude + "," + Longitude + "&sensor=false")
            Dim resp As System.Net.WebResponse = req.GetResponse
            Str = resp.GetResponseStream
            srRead = New System.IO.StreamReader(Str)
            strLocation = srRead.ReadToEnd.ToString
            strLocation = strLocation.Substring(strLocation.IndexOf("<formatted_address>") + 19, strLocation.IndexOf("</formatted_address>") - strLocation.IndexOf("<formatted_address>") - 19)
        Catch ex As Exception
            strLocation = "Unable to reverse geocode: " + Latitude + "," + Longitude + "   " + Now()
        Finally
            '  Close Stream and StreamReader when done               
            srRead.Close()
            Str.Close()
        End Try
Viewing all 3384 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>