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

Get coordinate point from pixel point #81

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,

Very interessing project for me, i would like to convert pixel to coordinate 
from corner point of the image.

Thanks

Original issue reported on code.google.com by r2...@yahoo.fr on 10 Jun 2012 at 12:29

GoogleCodeExporter commented 8 years ago
Hi,

What you can do is to add an eventlistner... for instance like this:

_geWb.AddEventListener(_ge, EventId.Click)

Then within the webBrowser kmlEvent handle the event and retrive the lat/long

e.ApiObject.getLatitude()
e.ApiObject.getLongitude()

Hope this helps.
TKM

Original comment by tho...@gmail.com on 13 Jun 2012 at 9:33

GoogleCodeExporter commented 8 years ago
or... you can get the corners from the bounds class, like this:

var point = GEHelpers.GetCurrentViewAsPoint(_ge);
FC.GEPluginCtrls.Geo.Coordinate c = new FC.GEPluginCtrls.Geo.Coordinate(point);
Bounds b = new Bounds(c);

Original comment by tho...@gmail.com on 14 Jun 2012 at 7:19

GoogleCodeExporter commented 8 years ago
Ok thank i'll try it

Original comment by r2...@yahoo.fr on 14 Jun 2012 at 4:35

GoogleCodeExporter commented 8 years ago
This can also be done using the native GEView object.

dynamic view = ge.getView();
dynamic bounds = view.getViewportGlobeBounds();

// the coordinates (lat,lng) of corner points
double[] nw =  { bounds.getNorth(), bounds.getWest() ); //top left (0-0)
double[] ne =  { bounds.getNorth(), bounds.getEast() ); //top right (0-1)
double[] se =  { bounds.getSouth(), bounds.getEest() }; //bottom right (1-1)
double[] sw =  { bounds.getSouth(), bounds.getWest() }; //bottom left (1-0)

Thanks

Original comment by fraser.c...@gmail.com on 4 Sep 2012 at 1:03