IT Community - Software Programming, Web Development and Technical Support

How can i include Google Earth in my C# Windows application?

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 ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 09-03-2007, 11:51 PM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default How can i include Google Earth in my C# Windows application?

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-04-2007, 03:12 AM
Mramesh Mramesh is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Location: Chennai
Posts: 106
Mramesh is on a distinguished road
Send a message via MSN to Mramesh
Default You can include Google Earth in your C# Windows application :)

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....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-04-2007, 03:17 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default How can i load an kml file in to google earth...?

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-05-2007, 05:15 AM
Mramesh Mramesh is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Location: Chennai
Posts: 106
Mramesh is on a distinguished road
Send a message via MSN to Mramesh
Default How to call a kml file for google earth from c# Windows application ?

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...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-05-2007, 05:29 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Re: How can i include Google Earth in my C# Windows application?

Hi,


I want to add the following camera properties in google earth.

FocusPointLatitude
FocusPointLongitude
FocusPointAltitude
Range
Tilt
FocusPointAltitudeMode


please guide me... its urgent...


thanks....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-05-2007, 06:05 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Default Add Camera properties to the google earth using c#

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-07-2007, 04:57 PM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default What is KML file and is there any other type of files to support the google earth...?

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..
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-07-2007, 05:04 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: How can i include Google Earth in my C# Windows application?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 09-07-2007, 05:23 PM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: How can i include Google Earth in my C# Windows application?

Hi sathish,

thanks for your reply, its clear my doubt.. but i have one more doubt what is kmz file can i use it in google map....


thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 09-07-2007, 05:33 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: How can i include Google Earth in my C# Windows application?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #11 (permalink)  
Old 09-07-2007, 05:35 PM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: How can i include Google Earth in my C# Windows application?

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....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #12 (permalink)  
Old 09-07-2007, 05:41 PM
Sathish Kumar Sathish Kumar is offline
D-Web Analyst
 
Join Date: Feb 2007
Posts: 304
Sathish Kumar is on a distinguished road
Thumbs up Re: How can i include Google Earth in my C# Windows application?

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
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #13 (permalink)  
Old 10-22-2007, 05:51 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default Re: How can i include Google Earth in my C# Windows application?

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....
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Earth enables views into the universe senthilkannan Google 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 Google 4 04-26-2007 12:56 PM
Google Earth Taggart Google 1 03-20-2007 12:22 PM
Google Earth djmix Google 1 03-08-2007 09:28 PM


All times are GMT -7. The time now is 02:20 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0