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

New Post: Drawing on the map

$
0
0
I've got a map loaded into my program (using Visual C# 2010, and gMapControl). I can draw lines on the map (YAY). I'm using:
        private void gMapControl1_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
            Pen fl = new Pen(Color.Red, 3.0f);
            e.Graphics.DrawLine(fl, x_start, y_start, xx, yy);
        }
Where x_start and y_start is the left mouseDown, and xx, yy is the current position, as below:
        private void gMapControl1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                mouseDown = 1;
                Point pmousePos = new Point(e.X, e.Y);
                x_start = e.X;
                y_start = e.Y;
            }
        }
My problem is that when I pan the map, or zoom the map, my drawn lines stay in the same place on the screen; they're not "tied to the ground (map").

Any direction would be appreciated.
AW

New Post: Drawing on the map

New Post: Drawing on the map

$
0
0
I appreciate the direction, but that only killed the battery on my cell.

Should I not be using my second sample above to get coordinates? Is this method only returning screen coordinates?
Or perhaps I should be feeding the method with "map coordinates"?
Should I not be using the gMapControl1_Paint method to "paint" lines between mouseDown's?

New Post: Smooth WPF Zoom

$
0
0
If it exists in the Windows Forms version, is it that complex? :|

New Post: GMap Commercial License

$
0
0
thanks for the reply.
Leaving the provider aside, can I use GMap (WPF) for commercial product?

New Post: Overlaying cloud cover on map

$
0
0
If GMapOverlay is not available in the GMap WPF library, how can I add the cloud overlay onto the map?

New Post: Manipulating Polygon using GMap for WPF

$
0
0
Thanks for the reply.

I will try out your method for moving of the polygon.

For point 3, its regarding to rotating the polygon (ie. rectangle). The angle is according to the map true north. I am trying to emulate something like powerpoint. when the mouse is at the corner and user clicks and drags on it, it will rotate in the direction of mouse move.

New Post: Drawing on the map

$
0
0
It looks like I need to draw (or Paint) my line on an overlay, and then add the overlay to the map. It this correct?

New Post: Drawing on the map

$
0
0
It looks like I need to draw (or Paint) my line on an overlay, and then add the overlay to the map. It this correct?

New Post: GMap Commercial License

New Post: Drawing on the map

$
0
0
This is some of my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GMap.NET.MapProviders;
using GMap.NET.WindowsForms;
using GMap.NET.WindowsForms.Markers;

namespace GMap_AW
{

    public partial class Form1 : Form
    {
        GMapControl MainMap = new GMapControl();
        GMapMarkerImage m = new GMapMarkerImage(new PointLatLng());
        GMapOverlay overlayOne;

        int dragging = 0;
        int mouseDown = 0;
        float x_start;
        float y_start;
        float x_end;
        float y_end;
        float xx;
Why am I getting this error ?
Error   1   The type or namespace name 'GMapMarkerImage' could not be found (are you missing a using directive or an assembly reference?)   

New Post: Drawing on the map

$
0
0
I realize now that I need to reference the screen coordinates relative to the map, and then redraw my lines on the screen after I pan or zoom.
To reference the screen I use:
      Double   lat = gMapControl1.FromLocalToLatLng(e.X, e.Y).Lat;
      Double   lng = gMapControl1.FromLocalToLatLng(e.X, e.Y).Lng;
After I pan or zoom I need to find out where the above coordinates are relative to the screen. The command is:
      Double   lng = gMapControl1.FromLatLngToLocal(PointLatLng Point);
But what is the proper syntax? Because the compiler doesn't like "PointLatLng Point".

Thanks
Aw

New Post: Drawing on the map

$
0
0
"Point" is a structure of namespace System.Drawing, that's why the compiler is complaining...
Why don't you just use a GMapRoute as radioman already suggested?

New Post: Drawing on the map

$
0
0
I've tried using:

GMapRoute m = new GMapRoute(new Point.LatLng());

But I get an error of:

Error 1 The type name 'LatLng' does not exist in the type 'System.Drawing.Point'

AW

New Post: Drawing on the map

$
0
0
I'm sorry, but you should learn to program C# first...
        GMapRoute route = new GMapRoute(new List<PointLatLng>(), "test");
        //Add all your points here
        route.Points.Add(...
        yourOverlay.Routes.Add(route);

New Post: Smooth zooming in WPF

$
0
0
Lashas wrote:
If not all projections could solve position in same way, then it might be done in projection class, or it somehow be modified... I could try to do that, but I don't know the difference between projections :)
Have you found a solution for WPF smooth zooming?

Reviewed: 1.6 - Power (Mar 28, 2013)

$
0
0
Rated 5 Stars (out of 5) - Amazing, awesome, and some more amazing!!! Thank you so much for this control!

New Post: Contribution

$
0
0
Hello,

I am integrating GMaps into commercial application. The library is really great.

Is there a way I can donate (money) ?

Also, I am intending to modify the library a bit to be suitable for LabView and create a simplified interface with some examples. Is it OK if I call it the same and publish it on ni.com ?

New Post: Contribution

$
0
0
yes you can fork it, and donation link is at the bottom of the main page

New Post: How to update marker position with only distance and bearing data?

$
0
0
Hi,
First of all, your library is amazing. Thank you very much for this. You helped a lot of people.

Let's get into my question. I want to simulate vehicle running as markers on the map.
I can do it if the new lat/lng position is given by setting new position of markers as you did in flight tracking or vehicle tracking. However, when I'm simulating vehicles, I don't have new lat/lng positions. I have only current position, distance to go and bearing.

Could you please suggest me how to set new lat/lng position from current position, distance to go and bearing?

Thank you very much.
Viewing all 3384 articles
Browse latest View live


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