Stoptou31 / 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

GEHelpers.FlyToObject is 1000x too close for multi-coordinate objects, due to units discrepancy. #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a geometry and placemark with multiple coordinates (such as a 
polygon). Try to make the object span about 1km, although you can experiment 
with different sizes.
2. Use KmlHelpers.CreateBoundsView to establish a LookAt based on those 
coordinates (or use GEHelpers.FlyToObject)

Expected output, I assume, is a view which contains the full geometry of the 
polygon placemark, plus room to spare (depending on the scaleRange, where 
presumably 1.0 would zoom just enough to fill the view, and 1.5 would scale out 
from there). 

What is seen instead is a view which is way too close. changing the scaleRange 
variable passed in seems to help, but it has to be about 1000x what you'd 
expect. At that level, the object fits the screen just about perfectly.

Looking closely at the code it appears that KmlLookAt.set requires range 
distance to be in meters. Much of the helper code seems to work in KM and no 
conversion is made. Which fits with the 1000x factor.

Using the latest version -- code called matches what I see in the tree.

NOTE: It is important the polygon coordinates be RelativeToGround, and have no 
general altitudeOffset. Bounds does not add the offsets back to the 
coordinates, and it assumes relativeToGround even if coordinates are absolute, 
so absolute coordinates can push the target up a set amount, but how much of 
the screen it fills varies depending on the horizontal span. 

Original issue reported on code.google.com by josh.sut...@gmail.com on 15 Aug 2014 at 8:22

GoogleCodeExporter commented 9 years ago
No further development now that the Earth API is depreciated. 

Original comment by fraser.c...@gmail.com on 17 Dec 2014 at 3:20