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

Closed Unassigned: Issue compiling latest and greatest [16100]

$
0
0
I got the latest source and just tried to compile and i am getting errors. Seems to be something about class names or name spaces.

Error 3 Friend access was granted to 'GMap.NET.WindowsForms, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cd251b0b8f7079914bbe3e5655d92e5427218f3f0241537a9cb7467b6da2aa5cb20915c31400800e3081d20e6454a35164600fe8bf4f846744f211e040588260cc872c78abd91b422c60071bfda5f11d251eb09f0935944b41de2a28374ad17e8c963d642310df9050e8ae0f1a2b867bcc8f035e4b353dc699cfc7125b9661ce', but the output assembly is named 'GMap.NET.WindowsForms, Version=1.7.0.0, Culture=neutral, PublicKeyToken=null'. Try adding a reference to 'GMap.NET.WindowsForms, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cd251b0b8f7079914bbe3e5655d92e5427218f3f0241537a9cb7467b6da2aa5cb20915c31400800e3081d20e6454a35164600fe8bf4f846744f211e040588260cc872c78abd91b422c60071bfda5f11d251eb09f0935944b41de2a28374ad17e8c963d642310df9050e8ae0f1a2b867bcc8f035e4b353dc699cfc7125b9661ce' or changing the output assembly name to match. c:\SVN\greatmaps_3660acb94e16\GMap.NET.Core\bin\Debug\GMap.NET.Core.dll GMap.NET.WindowsForms

Comments: you use different versions

Commented Unassigned: I get a blur image of map on button click [16098]

$
0
0
I m working in winforms using C#.net.
I get a latitude and longtitude from an device and plot the value in the map.
Initially i loaded the map in initialize component(),It is showing me correctly.
But when i used in the button click event, map is getting loaded,it is showing me an blur images.

The code i used in button click event:-

try
{
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.CacheOnly;
gmap.MapProvider = GMap.NET.MapProviders.BingMapProvider.Instance;
GMap.NET.GMaps.Instance.Mode = GMap.NET.AccessMode.ServerOnly;
// gmap.SetCurrentPositionByKeywords("Mumbai, India");
GMapOverlay markersOverlay = new GMapOverlay(gmap, "marker");
GMapMarkerGoogleGreen marker = new GMapMarkerGoogleGreen(new PointLatLng(ObjParse.latitude, ObjParse.latitude));
gmap.Position = new PointLatLng(ObjParse.latitude, ObjParse.latitude);

markersOverlay.Markers.Add(marker);
gmap.Overlays.Add(markersOverlay);
gmap.MinZoom = 1;
gmap.MaxZoom = 50;
gmap.Zoom = 18;
marker.ToolTip = new GMapRoundedToolTip(marker);
marker.ToolTipText =Convert.ToString( ObjParse.latitude)+","+Convert.ToString(ObjParse.longtitude);
}
catch(Exception ex)
{
log.Info("Error in Map plot Button"+ex.ToString());
}

please help me to solve it.
Thnk's in advance
Comments: tried latest version?

Commented Unassigned: Fix for smooth MapPoint animation in WPF [16097]

$
0
0
If animating the MapPoint property in WPF, the map stutters to the target point. Also, the overlays and the map moved with different behaviour.

With the following fix the MapPoint Animation will be smoothed:

In GMapControl.cs, function OnMapPointPropertyChanged.

Replace the line:
```
(source as GMapControl).Position = new PointLatLng(temp.X, temp.Y);
```
with the following lines:
```
GMapControl map = (source as GMapControl);
GPoint centerPixel = map.Core.Provider.Projection.FromLatLngToPixel(map.Core.Position, (int)map.Zoom);
GPoint targetPixel = map.Core.Provider.Projection.FromLatLngToPixel(new PointLatLng(temp.X, temp.Y), (int)map.Zoom);

map.Offset((int)(centerPixel.X - targetPixel.X), (int)(centerPixel.Y - targetPixel.Y));
```

Additionally, to make it work also with fractional zoom Levels:

In GMapControl.cs, function void Offset(int x, int y):

Replace the line:
```
UpdateMarkersOffset();
```
with the following lines:
```
if (IsRotated || scaleMode != ScaleModes.Integer)
{
ForceUpdateOverlays();
}
else
{
UpdateMarkersOffset();
}
```

Would be great if you want to take this into your main branch.

Comments: thanks

Commented Unassigned: Drag Item [16078]

$
0
0
On mouse move evenhandler when we drag a item over
other one we lost it and often the drag stop:



In the GMapControl.cs I add this boolean

public bool markerAsClick = false;

The caller setup the flag

void MainMap_MouseMove(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Left && isMouseDown)
{
if(CurentRectMarker == null)
{
if(currentMarker.IsVisible)
{
currentMarker.Position = MainMap.FromLocalToLatLng(e.X, e.Y);
}
}
else // move rect marker
{
MainMap.markerAsClick = true;
PointLatLng pnew = MainMap.FromLocalToLatLng(e.X, e.Y);

. ..
......
}

MainMap.Refresh(); // force instant invalidation
}
}

protected override void OnMouseMove(MouseEventArgs e)
{
if(!markerAsClick)
{
.........
..............
}

base.OnMouseMove(e);
}

for me it's work fine
but probably you have a better place to do this
Comments: thanks i'll check it

New Post: Drawing Circles

$
0
0
Version: 1.7.0.0 - C# - Winforms - Visual Studio 2012

I'm having problems drawing circles on my gMapControl1.

I found this: [http://greatmaps.codeplex.com/discussions/220983] but Visual Studio does not like:

Overlay.Control.Core.Projection.GetGroundResolution(Overlay.Control.Zoom, Position.Lat)) * 2;

It does not know about "Core"

I need to draw several circles 50 miles, 100 miles, etc. out from a certain position.

Thanks

New Post: Drawing Circles

$
0
0
try Overlay.Control.MapProvider.Projection.GetGroundResolution

check GMapMarkerCircle in Demo.WindowsForms

Closed Issue: Bearing [16044]

$
0
0
Bearing was not working at least since 1.6. I'm not sure if I'm doing it correctly but now ti's working for me.

since it's only in 1 file, I'll paste the diff here.

--- C:/Users/JFDionne/Downloads/greatmaps-6ccafda5ce5d/greatmaps_6ccafda5ce5d/GMap.NET.WindowsForms/GMap.NET.WindowsForms/GMapControl.cs Mon Jul 16 16:13:00 2012
+++ GMapControl.cs Mon Jul 16 17:58:47 2012
@@ -1112,10 +1112,17 @@
{
if(IsHandleCreated)
{
- // need to fix in rotated mode usinf rotationMatrix
- // ...
- Core.DragOffset(new GPoint(x, y));
+ if (IsRotated)
+ {
+ System.Drawing.Point[] p = new System.Drawing.Point[] { new System.Drawing.Point(x, y) };
+ rotationMatrixInvert.TransformVectors(p);
+ x = (int)p[0].X ;
+ y = (int)p[0].Y ;
+
+ }

+ Core.DragOffset(new GPoint(x, y));
+
ForceUpdateOverlays();
}
}
@@ -1385,6 +1392,8 @@
e.Graphics.TranslateTransform(Core.renderOffset.X, Core.renderOffset.Y);

DrawMap(e.Graphics);
+ e.Graphics.ResetTransform();
+ e.Graphics.TranslateTransform(Core.renderOffset.X, Core.renderOffset.Y);
OnPaintOverlays(e.Graphics);

#endregion
@@ -1451,45 +1460,45 @@
}
set
{
- //if(Core.bearing != value)
- //{
- // bool resize = Core.bearing == 0;
- // Core.bearing = value;
+ if (Core.bearing != value)
+ {
+ bool resize = Core.bearing == 0;
+ Core.bearing = value;

- // //if(VirtualSizeEnabled)
- // //{
- // // c.X += (Width - Core.vWidth) / 2;
- // // c.Y += (Height - Core.vHeight) / 2;
- // //}
+ //if(VirtualSizeEnabled)
+ //{
+ // c.X += (Width - Core.vWidth) / 2;
+ // c.Y += (Height - Core.vHeight) / 2;
+ //}

- // UpdateRotationMatrix();
+ UpdateRotationMatrix();

- // if(value != 0 && value % 360 != 0)
- // {
- // Core.IsRotated = true;
+ if (value != 0 && value % 360 != 0)
+ {
+ Core.IsRotated = true;

- // if(Core.tileRectBearing.Size == Core.tileRect.Size)
- // {
- // Core.tileRectBearing = Core.tileRect;
- // Core.tileRectBearing.Inflate(1, 1);
- // }
- // }
- // else
- // {
- // Core.IsRotated = false;
- // Core.tileRectBearing = Core.tileRect;
- // }
+ if (Core.tileRectBearing.Size == Core.tileRect.Size)
+ {
+ Core.tileRectBearing = Core.tileRect;
+ Core.tileRectBearing.Inflate(1, 1);
+ }
+ }
+ else
+ {
+ Core.IsRotated = false;
+ Core.tileRectBearing = Core.tileRect;
+ }

- // if(resize)
- // {
- // Core.OnMapSizeChanged(Width, Height);
- // }
+ if (resize)
+ {
+ Core.OnMapSizeChanged(Width, Height);
+ }

- // if(!HoldInvalidation && Core.IsStarted)
- // {
- // ForceUpdateOverlays();
- // }
- //}
+ if (!HoldInvalidation && Core.IsStarted)
+ {
+ ForceUpdateOverlays();
+ }
+ }
}
}
#endif
@@ -1954,17 +1963,17 @@
else
{
#if !PocketPC
- Core.mouseCurrent = ApplyRotationInversion(e.X, e.Y);
+ Core.mouseCurrent = ApplyRotationInversion(e.X, e.Y);
#else
Core.mouseCurrent = new GPoint(e.X, e.Y);
#endif
Core.Drag(Core.mouseCurrent);

#if !PocketPC
- if(MobileMode)
- {
+ //if(MobileMode)
+ //{
ForceUpdateOverlays();
- }
+ //}
#else
ForceUpdateOverlays();
#endif


Comments: thanks JFDionne, tpittma2 for helping to solve the issue!

New Post: public float Bearing WPF Disable?

$
0
0
thanks!, i've committed your code

New Post: Bearing diasable SET

New Post: markers rotation-bearing

New Post: Rotate map and markers?

$
0
0
rotation fixed

p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: how to rotate a marker 0-360 degrees

$
0
0
rotation fixed

p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: Heading for custom markers

$
0
0
p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: Rotate Marker (and Custom Marker)

$
0
0
it's fixed

p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: Rotate marker

$
0
0
rotation is fixed

p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: How to use GMarkerGoogle .Bearing

$
0
0
bearing is fixed

p.s. marker rotation demo [left menu, Live->FlightRadar] and GMarkerArrow.cs

New Post: Rotating Marker after changing position/rotation

Source code checked in, #d69f0eafbf03

Source code checked in, #a2d2ceb0c0c6

Source code checked in, #bb22ec70d4f5

Viewing all 3384 articles
Browse latest View live