This is a discussion on How can i include Google Earth in my C# Windows application? within the C# Programming forums, part of the Software Development category; Hi all, Now Iam working with google earth based windows application, i have to include google earth in my windows ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi all, Now Iam working with google earth based windows application, i have to include google earth in my windows application. How can i include Google Earth in my C# Windows application?. Is any api or usercontrol available for google earth.... any help will be appreciated... thnx... |
| Sponsored Links |
| |||
| Hi Deeban, you can include google earth in your application for that you have to follow the following steps. 1. Have to install google earth in your pc. 2. Add the reference for google earth from your project. 3. you have to extern the following functions from the users32.dll. public delegate int EnumWindowsProc(IntPtr hwnd, int lParam); [DllImport("user32", CharSet = CharSet.Auto)] public extern static IntPtr GetParent(IntPtr hWnd); [DllImport("user32", CharSet = CharSet.Auto)] public extern static bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); [DllImport("user32", CharSet = CharSet.Auto)] public extern static IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent); private IntPtr GEHrender = (IntPtr)0; private IntPtr GEParentHrender = (IntPtr)0; public ApplicationGEClass googleEarth; 4. Then you have to call the functions from the page load event. if (this.DesignMode == false) { googleEarth = new ApplicationGEClass(); GEHrender = (IntPtr)googleEarth.GetRenderHwnd(); GEParentHrender = GetParent(GEHrender); MoveWindow(GEHrender, 0, 0, this.Width, this.Height,true); SetParent(GEHrender, this.Handle); } hope this will help you.... |
| |||
| Hi Ramesh, Thanks for your reply, Its helped me to come out the issue..., thanks again and i have one more requirement, i have to load the kml file from c#.... can you help me..... thnx... |
| |||
| Hi Deeban, you can call call the kml file from c# windows application for google earth using the ApplicationGEClass class. here is the code: ApplicationGEClass googleEarth = new ApplicationGEClass(); googleEarth.OpenKmlFile(Environment.CurrentDirecto ry + "/KML_Samples.kml", 10); I hope this will help you... cheers... |
| |||
| Hi, I want to add the following camera properties in google earth. FocusPointLatitude FocusPointLongitude FocusPointAltitude Range Tilt FocusPointAltitudeMode please guide me... its urgent... thanks.... |
| |||
| Hi Sundaram, you can add these properties using the CameraInfoGE Class in the google earth's EARTHLib namespace... here is your code... CameraInfoGE cam=new CameraInfoGE(); cam.FocusPointLatitude = 37.42222904525232; cam.FocusPointLongitude=-122.0839597145766; cam.FocusPointAltitude = 0; cam.Range = 500; cam.Tilt = 40.5575073395506; cam.FocusPointAltitudeMode = AltitudeModeGE.RelativeToGroundAltitudeGE; And finaly you have to assign these camera properties to the ApplicationGEClass's instance... using setcamera() function like this googleEarthViewPort1.googleEarth.SetCamera(cam, .25); .25 is the speed of the camera... i hope this will help you .... cheers.... keep coding....
__________________ J.Saravanan |
| |||
| Hi All... What is KML file and is there any other type of files to support the google earth...? I need this for my client demo... any help would be appreciated.... thnx.. |
| |||
| KML means Keyhole Markup Language (XML file format .kml for managing the display of three-dimensional geospatial data) KML files are specially formatted files for Google Earth that contains data to allow them to be viewed in the Google Earth desktop application. The data from Geocaching.com includes the type of listing (Traditional, Multi-cache) and other data to help you browse caches in a dynamic mapping interface. Google Earth also supports KMZ files.
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi Deeban, KMZ stands for KML-Zipped. It is the default format for KML because it is a compressed version of the file. One of the more powerful features of KMZ is that it allows any images you use - say custom icons, or images in your descriptions - to be zipped up within the KMZ file. That way you can share these details without having to reference the files through some link to the Internet.
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi sathis... This sounds great.. so the kmz files give us more flexibility to the developers.. is there anyother adavantages using the kmz files... thnx.... |
| |||
| Hi Deeban, Well there are some advantages of KMZ files over KML files.They are 1. For KMZ files without images, the file size will be much smaller than the equivalent KML file. 2.One of the more powerful features of KMZ is that it allows any images you use - say custom icons, or images in your descriptions - to be zipped up within the KMZ file.
__________________ Sathish Kumar.R ![]() Knowledge is meant to SHARE |
| |||
| Hi All, Iam developing c# google earth application i need to find the zipcode for the latitude. Can anyone tel me, is there any way to find the zipcode for the given latitude and longitude. thanks in advance.... |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Google Earth enables views into the universe | senthilkannan | 5 | 01-02-2008 02:55 PM | |
| How to include Google earth in winforms of c# application | smani | C# Programming | 22 | 08-30-2007 07:43 AM |
| New Google Earth | Taggart | 4 | 04-26-2007 12:56 PM | |
| Google Earth | Taggart | 1 | 03-20-2007 12:22 PM | |
| Google Earth | djmix | 1 | 03-08-2007 09:28 PM | |