thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

"Fly to..." box goes to different location than Google Earth application #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Usually the Fly To box centers the map image on the correct coordinates, but 
for the following lat/lon in decimal degrees it fails to match the behavior of 
the official Google Earth application:

36.808393, -116.154320

Attached is the result when the above string is entered into the Fly To box in 
Google Earth.  Notice the building in the center of the image at these 
coordinates.  When the same string is entered into the Fly To box (in the 
upper-left corner) of Test Application 6, the result is not the same location 
(also attached).

Original issue reported on code.google.com by kco...@gmail.com on 6 Oct 2011 at 9:50

Attachments:

GoogleCodeExporter commented 9 years ago
Issue 57 has been merged into this issue.

Original comment by fraser.c...@gmail.com on 6 Oct 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Issue 56 has been merged into this issue.

Original comment by fraser.c...@gmail.com on 6 Oct 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Issue 55 has been merged into this issue.

Original comment by fraser.c...@gmail.com on 6 Oct 2011 at 10:27

GoogleCodeExporter commented 9 years ago
Hi, 

Thanks for bringing this up...

There is a bug with how the view is set in the 
GEToolStrip.NavigationButton_Click method.

Rather than simply flying to the coordinates specified - the controls are 
geocoding the query via the v2 maps api and returning a result (which is only 
accurate to 4 decimal places). This is causing the discrepancy you are seeing.

Idealy the navigation box should recognise that the input is a pair of deciamal 
degrees, forgo the geocoding compleately, and just show the given location.

For this to happen there should be an additional format check on the input - 
something like the following at line 396 in GEToolStrip.cs would work well. 

--------------------------------------

else if (input.Contains(','))
{
    string[] parts = input.Split(',');

    if (parts.Length == 2)
    {
        double latitude;
        double longitude;

        if (double.TryParse(parts[0], out latitude) && double.TryParse(parts[1], out longitude))
        {
           GEHelpers.LookAt(this.geplugin, latitude, longitude);
        }
    }
}

--------------------------------------
It will be fixed in the next commit.

Original comment by fraser.c...@gmail.com on 7 Oct 2011 at 9:51

GoogleCodeExporter commented 9 years ago
Sorry about the duplicate postings of this issue--Google Code kept giving me
a 502 error when I tried to add this as a new issue.

On Fri, Oct 7, 2011 at 5:52 AM, <
winforms-geplugin-control-library@googlecode.com> wrote:

Original comment by kco...@gmail.com on 7 Oct 2011 at 3:53

GoogleCodeExporter commented 9 years ago
I tested your fix and it works well.  Just change the single quotes to double 
quotes in the first line:

else if (input.Contains(","))

Original comment by kco...@gmail.com on 7 Oct 2011 at 4:08

GoogleCodeExporter commented 9 years ago
ah yea - good catch on the typo too! don't worry about the duplicate posting - 
it does that to me now and again! 

Original comment by fraser.c...@gmail.com on 7 Oct 2011 at 6:06

GoogleCodeExporter commented 9 years ago
This is fixed in the latest commit.

Original comment by fraser.c...@gmail.com on 8 Oct 2011 at 12:44