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

Source code checked in, #848201fd3f3a

$
0
0
GMap.NET.Core: added functions to read tiles from files or memory

New Post: Visual basic net KML to gmap

$
0
0
Please help , needs load kml file t as polygon but __VB .NET __only

BIG THANKS FOR EVERYONE!

New Post: Lack of performance with Markers in WPF

$
0
0
Hi Radioman,

I have been using your great GMap.Net for a few months now and I have a problem to submit.

Here is what i do:
  • I display a GMapControl in my UserControl.
  • Then I draw some areas on it (using GMapPolygon).
Here is my problem:
  • When dragging my map around the areas, the drag is very slow and cade (everything is perfect when areas are not displayed)
Here is my code to draw areas:
                foreach (GeoZoneEntity area in areas)
                {
                    Color areaColor = (Color)ColorConverter.ConvertFromString(area.Color);

                    // define brushes
                    SolidColorBrush strokeBrush = new SolidColorBrush(Colors.Black);
                    SolidColorBrush fillBrush = new SolidColorBrush(areaColor);

                    // build point list ad PointLatLong
                    List<PointLatLng> points = new List<PointLatLng>();
                    foreach (GeoZonePointEntity point in area.GeoZonePoints)
                    {
                        points.Add(new PointLatLng(point.Latitude, point.Longitude));
                    }

                    GMapPolygon polygon = new GMapPolygon(points);
                    polygon.RegenerateShape(mapControl);

                    if (polygon.Shape != null && polygon.Shape is Path)
                    {
                        (polygon.Shape as Path).StrokeThickness = 0.5;
                        (polygon.Shape as Path).Stroke = strokeBrush;
                        (polygon.Shape as Path).Fill = fillBrush;
                    }

                    mapControl.Markers.Add(polygon);
                }
Note: I have around 75 areas in my list and between 5 to 450 points in each one.

I call this method only one at the beginning. So if you have any clue for me to improve the performance it would be great.

Thanks a lot by advance for your help and one again for your job.

Nicolas

New Post: Lack of performance with Markers in WPF

$
0
0
try:
(polygon.Shape as Path).Effect = null;

New Post: Inheriting from Polygon Type

$
0
0
Hello;
i'm trying to define my own Polygon implementation, adding an inernal marker that will add Tool Tip functionnality, however i faced two problems:

first , the GoogleMarker with image type None do not render (value of Bitmap can not be null).
second , the marker when set with some image, do not render in it's position.
<Serializable>
Public Class GLPolygonMarker
    Inherits GMap.NET.WindowsForms.GMapPolygon
    Implements ISerializable, IGLCustomMarker

    'Ctor:
    Public Sub New(points As List(Of GMap.NET.PointLatLng), Optional name As String = "Polygone")
        MyBase.New(points, name)
        If points Is Nothing OrElse points.Count = 0 Then
            Throw New ArgumentException("List Of Points Emty or Missing", "Points")
        End If
        Me.IsHitTestVisible = False
        _Type = GLCustomMarkerType.Polygon
        _Id = "S" & DateTime.Now.ToUniqueId()
        Me.Color = New GLSerialColor(Drawing.Color.Azure) With {.Alpha = 100}
        Me.Border = New GLSerialPen(Drawing.Color.DarkBlue, 1, Drawing2D.DashStyle.Solid)
        _TTMarker = New GMap.NET.WindowsForms.Markers.GMarkerGoogle(MyBase.Points.Item(0), GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue_small)
    End Sub

    'Id :
    Private _Id As String
    Public ReadOnly Property Id As String Implements IGLCustomMarker.Id
        Get
            Return _Id
        End Get
    End Property
    'Type:
    Private _Type As GLCustomMarkerType
    Public ReadOnly Property Type As GLCustomMarkerType Implements IGLCustomMarker.Type
        Get
            Return _Type
        End Get
    End Property
    'Name :
    Public Property PName As String Implements IGLCustomMarker.Name
        Get
            Return Me.Name
        End Get
        Set(value As String)
            If String.IsNullOrWhiteSpace(value) = False Then
                Me.Name = value
            End If
        End Set
    End Property
    'Pen:
    Private _Border As GLSerialPen
    Public Property Border As GLSerialPen Implements IGLCustomMarker.Border
        Get
            Return _Border
        End Get
        Set(value As GLSerialPen)
            _Border = value
            Me.Stroke = value.ToDotNetPen
        End Set
    End Property
    'Color:
    Private _Color As GLSerialColor
    Public Property Color As GLSerialColor Implements IGLCustomMarker.Color
        Get
            Return _Color
        End Get
        Set(value As GLSerialColor)
            _Color = value
            Me.Fill = New SolidBrush(_Color.ToDotNetColor)
        End Set
    End Property

    'Tooltip:
    Private _TTMarker As GMap.NET.WindowsForms.Markers.GMarkerGoogle
    Public Property TTText As String Implements IGLCustomMarker.TTText
        Get
            Return _TTMarker.ToolTipText
        End Get
        Set(value As String)
            _TTMarker.ToolTipText = value
        End Set
    End Property

    Public Property TTMode As GMap.NET.WindowsForms.MarkerTooltipMode Implements IGLCustomMarker.TTMode
        Get
            Return _TTMarker.ToolTipMode
        End Get
        Set(value As GMap.NET.WindowsForms.MarkerTooltipMode)
            _TTMarker.ToolTipMode = value
        End Set
    End Property

    'Drawing:
    Public Overrides Sub OnRender(g As Graphics)
        MyBase.OnRender(g)
        _TTMarker.OnRender(g)
    End Sub


    'Serialization:
    Public Overloads Sub GetObjectData(info As SerializationInfo, context As StreamingContext) Implements ISerializable.GetObjectData
        MyBase.GetObjectData(info, context)
        info.AddValue("ID", _Id)
        info.AddValue("Color", _Color, GetType(GLSerialColor))
        info.AddValue("Border", _Border, GetType(GLSerialPen))
        info.AddValue("TTText", _TTMarker.ToolTipText)
        info.AddValue("TTMode", CType(_TTMarker.ToolTipMode, Byte))
    End Sub
    Public Sub New(info As SerializationInfo, context As StreamingContext)
        MyBase.New(info, context)
        _Type = GLCustomMarkerType.Polygon
        _Id = info.GetString("ID")
        Me.Color = CType(info.GetValue("Color", GetType(GLSerialColor)), GLSerialColor)
        Me.Border = CType(info.GetValue("Border", GetType(GLSerialPen)), GLSerialPen)
        Dim points As GMap.NET.PointLatLng() = CType(info.GetValue("Points", GetType(GMap.NET.PointLatLng())), GMap.NET.PointLatLng())
        _TTMarker = New GMap.NET.WindowsForms.Markers.GMarkerGoogle(points(0), GMap.NET.WindowsForms.Markers.GMarkerGoogleType.blue_small)
        _TTMarker.ToolTipText = info.GetString("TTText")
        _TTMarker.ToolTipMode = CType(info.GetByte("TTMode"), GMap.NET.WindowsForms.MarkerTooltipMode)
    End Sub


End Class
can any one help me please

New Post: New maps

Created Unassigned: question about the limitation on the number of the searched result got by Gmap.net : GetPoints() [16116]

$
0
0
Can someone help me? when I use the GetPoints() function to get a set of PointLatLng points there are always a limitation on the number of the points I get, the number is always 10, if someone know how to solve the problem please tell me! because I want get all the PointLatLng points, I have search on the net all night, but cannot find any solution, thanks a lot!!!

New Post: Mono JIT compiler version 3.2.8 didn't work with the demo exe

$
0
0
please , can you reply on the problem , if the problem the version of mono comiler what is the best version can i use it

New Post: Mono JIT compiler version 3.2.8 didn't work with the demo exe

$
0
0
System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Data.SqliteClient, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies.

it's not compiler issue, check dependencies, it works fine in ubuntu

Updated Wiki: MONO support

$
0
0

to be able run via mono:

  • add libmono-winforms2.0-cil (Mono System.Windows.Forms library (for CLI 2.0)) in package manager, this will add all the other needed dependencies
  • set MONO to compilation symbols for GMap.NET.Core andGMap.NET.WindowsForms
  • choose Release target, Rebuild 

vuala! It works ;}

 

New Post: Mono JIT compiler version 3.2.8 didn't work with the demo exe

$
0
0
ok i installed Mono.Data.SqliteClient.dll where i put it in ubuntu 14.04 to run your demo "Demo.WindowsForms.exe"

New Post: Customizing Markers to Draw Geometric Shapes

$
0
0
Hello every one;

After many attempts to implement some geometric shapes , i realized that the only way to keep input over them is to update Size and Offset each time before rendering them, i have been reading some discussions where it is probably not a good idea, however, the GMapMarker Class is based on some initial "fixed" Sizes and Offsets that will not change over zooming, this is why i coul not find a good way to do that.

have any one foud a good solution to draw custom , updatable shapes without setting Size and Offset in the "OnRender" Method ??

New Post: How to get All Lat Lng in Polygon

$
0
0
For Each pll In gmap.Overlays(2).Polygons(0).Points
This will get you the points for the first polygon.

Source code checked in, #d93adf855fc4

$
0
0
GMap.NET.Core: coogle Maps API for Work support, polyline decoder update

New Post: Accessing Google Maps using Google API client key

$
0
0
ok, Maps API for Work is implemented now

New Post: Get underlying coordinates

$
0
0
I am using a custom marker that displays a pie shape on the map as a decoration for other markers. I would like to know if there is currently a way to get the collection of points under this shape(in Lat/Lng) so I can create my KML for exporting the marker data.

I know KML does not currently support arc geometry so a collection of points would work fine.

Source code checked in, #df51f19c95d0

New Post: How do I get gps points along the route set?

$
0
0
Hello guys,

I'm doing an app where I set on the map a route based on some points that user are going to insert on a textbox.

Ok, my route is fine and works great. Now I need to export a list with some position based on this same route. Something like: for each 10m on the route I generate a new point...

For example, I generate one route with 3 points and need to export that with 10 points.

Any idea?

Thanks for any anwers and sorry about my english! =P

Source code checked in, #a793e7bf9b81

$
0
0
GMap.NET.WindowsForms: updated ToImage using backBuffer, WYSIWYG

Closed Unassigned: How can I print GMap.NET maps? [16101]

$
0
0
So there is GMapControl on form. I want to print map, and here is code
```
PrintDocument doc = new PrintDocument { DocumentName = "Map printing file" };
doc.PrintPage += DocOnPrintPage;
PrintDialog dialog = new PrintDialog { Document = doc };
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK) doc.Print();
```
and
```
private void DocOnPrintPage(object sender, PrintPageEventArgs e)
{
var img = View.gmap.ToImage();
System.Drawing.Point loc = new System.Drawing.Point(0, 0);
e.Graphics.DrawImage(img, loc);
}
```

I'm using ToImage() method, but it does not work as I want (it's like PrintScreen, because there are another objects like cursor, dialogbox, etc.) Is there any workaround to implement printing without this objects?

P.S. Gmap.Net.Core and Gmap.Net.WindowForms verison is 1.7.0.0, and .Net FrameWork version is 4.0 and I cant upgrade .Net Framework version, because some of clients are using Windows XP.

P.P.S Thank you for replies
Comments: it's working! cheers ;}
Viewing all 3384 articles
Browse latest View live


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