|
GEWebBrowser
GEWebBrowser control notes
Featured
IntroductionThe main control that holds the Google Earth Plugin. All other controls in the library interact with the plugin object hosted in this control. Key features
DetailsThe GEWebBrowser inherits from the standard System.Windows.Forms.WebBrowser control class and has the same base members, methods, properties and events. The GEWebBrowser control cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code Public Events/// <summary> /// Raised when the plugin is ready /// </summary> public event EventHandler<GEEventArgs> PluginReady; /// <summary> /// Raised when there is a kmlEvent /// </summary> public event EventHandler<GEEventArgs> KmlEvent; KmlLoaded /// <summary> /// Raised when a kml/kmz file has loaded /// </summary> public event EventHandler<GEEventArgs> KmlLoaded; /// <summary> /// Raised when there is a script error in the document /// </summary> public event EventHandler<GEEventArgs> ScriptError; /// <summary> /// Rasied when there is a GEPlugin event /// </summary> public event EventHandler<GEEventArgs> PluginEvent; /// <summary> /// Rasied when there is a viewchangebegin, viewchange or viewchangeend event /// </summary> public event EventHandler<GEEventArgs> ViewEvent; Public PropertiesPlugin /// <summary> /// Gets the plugin instance associated with the control /// </summary> public dynamic Plugin ImageyBase /// <summary> /// Gets or sets the current imagery base for the plug-in /// </summary> public ImageryBase ImageyBase PluginIsReady /// <summary> /// Gets a value indicating whether the plug-in is ready /// </summary> public bool PluginIsReady RedirectLinksToSystemBrowser /// <summary> /// Gets or sets a value indicating whether to redirect html links to the system browser /// Default is true, setting this false opens links inside the GEWebBrowser control. /// </summary> public bool RedirectLinksToSystemBrowser Public Methods/// <summary>
/// Wrapper for the the google.earth.addEventListener method
/// </summary>
/// <param name="feature">The target feature</param>
/// <param name="action">The event Id</param>
/// <param name="javascript">The name of javascript callback function to use, or an anonymous function</param>
/// <param name="useCapture">Optionally use event capture</param>
/// <example>GEWebBrowser.AddEventListener(object, "click", "someFunction");</example>
/// <example>GEWebBrowser.AddEventListener(object, "click", "function(event){alert(event.getType);}");</example>
public void AddEventListener(dynamic feature, EventId action, string javascript = null, bool useCapture = false)/// <summary> /// Wrapper for the google.earth.createInstance method /// See: http://code.google.com/apis/earth/documentation/reference/google_earth_namespace.html#70288485024d8129dd1c290fb2e5553b /// </summary> /// <param name="database">The database name</param> /// <example>GEWebBrowser.CreateInstance(ImageryBase.Moon);</example> public void CreateInstance(ImageryBase database) ExecuteBatch /// <summary> /// Wrapper for the google.earth.executeBatch method /// See: http://code.google.com/apis/earth/documentation/reference/google_earth_namespace.html#b26414915202d39cad12bcd5bd99e739 /// Efficiently executes an arbitrary, user-defined function (the batch function),minimizing /// the amount of overhead incurred during cross-process communication between the browser /// and Google Earth Plugin. /// </summary> public void ExecuteBatch() /// <summary>
/// Load a remote kml/kmz file
/// This function requires a 'twin' LoadKml function in javascript
/// this twin function will call "google.earth.fetchKml"
/// </summary>
/// <param name="url">string path to a kml reasource</param>
/// <example>GEWebBrowser.FetchKml("http://www.site.com/file.kml");</example>
public void FetchKml(string url)/// <summary>
/// Load a remote kml/kmz file
/// This function requires a 'twin' LoadKml function in javascript
/// this twin function will call "google.earth.fetchKml"
/// </summary>
/// <param name="url">Uri to a kml reasource</param>
/// <example>GEWebBrowser.FetchKml("http://www.site.com/file.kml");</example>
public void FetchKml(Uri url)/// <summary>
/// Load a remote kml/kmz file
/// This function requires a 'twin' LoadKml function in javascript
/// this twin function will call "google.earth.fetchKml"
/// </summary>
/// <param name="url">path to a kml/kmz file</param>
/// <param name="completionCallback">name of javascript callback function to call after fetching completes</param>
/// <example>GEWebBrowser.FetchKml("http://www.site.com/file.kml", "createCallback_(OnKmlLoaded)");</example>
public void FetchKml(string url, string completionCallback)FetchKmlSynchronous /// <summary>
/// Same as FetchKml but returns the IKmlObject
/// </summary>
/// <param name="url">path to a kml/kmz file</param>
/// <param name="timeout">time to wait for return in ms</param>
/// <returns>The kml as a kmlObject</returns>
/// <example>GEWebBrowser.FetchKmlSynchronous("http://www.site.com/file.kml");</example>
public object FetchKmlSynchronous(string url, int timeout = 1000)FetchKmlLocal /// <summary>
/// Loads a local kml file
/// </summary>
/// <param name="path">path to a local kml file</param>
/// <example>GWEebBrower.FetchKml("C:\file.kml");</example>
public void FetchKmlLocal(string path)ParseKml /// <summary> /// GEPlugin.parseKml() wrapper /// Parses a kml string and loads it into the plugin /// </summary> /// <param name="kml">kml string to process</param> public void ParseKml(string kml) ParseKmlObject /// <summary> /// Parses a KmlObject and loads it into the plugin. /// </summary> /// <param name="kml">kml object to process</param> public void ParseKmlObject(dynamic kml) InvokeDoGeocode /// <summary>
/// Invokes the javascript function 'doGeocode'
/// Automatically flys to the location if one is found
/// </summary>
/// <param name="input">the location to geocode</param>
/// <returns>the point object (if any)</returns>
/// <example>GEWebBrowser.InvokeDoGeocode("London");</example>
public object InvokeDoGeocode(string input)/// <summary>
/// Inject a javascript element into the document head
/// </summary>
/// <param name="javascript">the script code</param>
/// <example>GEWebBrowser.InjectJavascript("var say=function(msg){alert(msg);}");</example>
public void InjectJavascript(string javascript)/// <summary>
/// Executes a script function defined in the currently loaded document.
/// </summary>
/// <param name="function">The name of the function to invoke</param>
/// <returns>The result of the evaluated function</returns>
/// <example>GEWebBrowser.InvokeJavascript("say");</example>
public object InvokeJavascript(string function)/// <summary>
/// Executes a script function that is defined in the currently loaded document.
/// </summary>
/// <param name="function">The name of the function to invoke</param>
/// <param name="args">any arguments</param>
/// <returns>The result of the evaluated function</returns>
/// <example>GEWebBrowser.InvokeJavascript("say", new object[] { "hello" });</example>
public object InvokeJavascript(string function, object[] args)/// <summary> /// Kills all running geplugin processes on the system /// </summary> public void KillAllPluginProcesses() LoadEmbededPlugin /// <summary> /// Load the embeded html document into the browser /// </summary> public void LoadEmbededPlugin() /// <summary> /// Wrapper for the the google.earth.removeEventListener method /// </summary> /// <param name="feature">The target feature</param> /// <param name="action">The event Id</param> /// <param name="useCapture">Optional, use event capture</param> public void RemoveEventListener(object feature, EventId action, bool useCapture = false) /// <summary> /// Take a 'screen grab' of the current GEWebBrowser view /// </summary> /// <returns>bitmap image</returns> public Bitmap ScreenGrab() SetLanguage /// <summary> /// Set the plugin langauge /// </summary> /// <param name="code">The language code to use</param> public void SetLanguage(string code) Refresh /// <summary> /// Reloads the document currently displayed in the control /// Overides the default WebBrowser Refresh method /// </summary> public override void Refresh() Source | |
► Sign in to add a comment
perfect
how can i download the control
I am writing somewhat of a GE style app. It will be in Visual Basic 2010 (VS2010 Premium iDE) and incorporates a Webbrowser control. I can easily show the basic Google Earth 3D in the webrowser control of my VB2010 app but now need to embed (somehow) grid lines (KML Linestrings) into my HTML file which is loaded LOCALLY from the user's computer and not via the web. Internet access is required for my app however. Please contact me at timcurtin1966@gmail.com. I am legally blind and I have GREAT difficulty reading forums. Please help . Thanks. Tim
@dev.amanyh - sometimes there are test applications here: http://code.google.com/p/winforms-geplugin-control-library/downloads/list
But I occasionally remove these when they need updating.
You can always just check out the project as a public user here - it is just a Subversion repository: http://code.google.com/p/winforms-geplugin-control-library/source/checkout
Also, if you just wanted the library you could just grab the latest dll http://winforms-geplugin-control-library.googlecode.com/svn/trunk/bin/Release/FC.GEPluginCtrls.dll
@timcurtin1966 Hi, sorry for not replying - I will email you asap.