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

Easily redirect library at internal Google Earth Enterprise Server #44

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Is this possible? How?

Original issue reported on code.google.com by will.mac...@gmail.com on 20 May 2011 at 12:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Hi,

Yes, the easiest way would be to modify the jsCreateInstance function defined 
in the Plugin.html file:

http://code.google.com/p/winforms-geplugin-control-library/source/browse/trunk/R
esources/Plugin.html

Simply add a case such that a custom database can be used, or, if you only wish 
to connect to your enterprise server simply modify the earth case.  e.g.

var jsCreateInstance = function(db)
{
  // clear the plug-in mark-up
  document.getElementById('map3d').innerHTML = '';

  // connect to a custom db on a enterprise server
  google.earth.createInstance('map3d', initCallback_, failureCallback_,
    { database: 'http://yourserver/?db=' + db });
}

Hope that helps.

Original comment by fraser.c...@gmail.com on 20 May 2011 at 12:22

GoogleCodeExporter commented 8 years ago
Great. But, Plugin.html also attempts to reference google.com/js
files. As opposed to following all the dependencies - do you know of
an offline option?

On Fri, May 20, 2011 at 08:26,
<winforms-geplugin-control-library@googlecode.com> wrote:

Original comment by will.mac...@gmail.com on 20 May 2011 at 5:29

GoogleCodeExporter commented 8 years ago
Here is an example of the modified case version I mentioned. I will possibly 
add something a little more refined than this to the next commit to allow a 
complete custom string value to be passed from managed code.

{{{
var jsCreateInstance = function(name)
{
  document.getElementById('map3d').innerHTML = '';
  var db = name.toLowerCase();

  switch(db)
  {
    case 'earth' :
      google.earth.createInstance('map3d', initCallback_, failureCallback_);
      return db;
      break;
    case 'mars' :
    case 'moon' :
      google.earth.createInstance('map3d', initCallback_, failureCallback_,
        { database: 'http://khmdb.google.com/?db=' + db });
      return db;
    // our 'custom' case
    case 'custom' :
      google.earth.createInstance('map3d', initCallback_, failureCallback_,
        { database: 'http://yourserver/?db=yourdb' });
      return db;               
    default :
      return false;
  }
}
}}}

You would then simply invoke this function using the GEWebBrowser's 
InvokeJavascript method, like so:

{{{
// Now we just need to pass 'custom' to the jsCreateInstance method.
geWebBrowser1.InvokeJavascript(JSFunction.CreateInstance, 'custom');
}}}

Obviously if you had more than one custom server (or database) then you can 
just keep adding cases.

Again, hope that sets you in the right direction.

Original comment by fraser.c...@gmail.com on 20 May 2011 at 5:30

GoogleCodeExporter commented 8 years ago
Just follow the set up as per the enterprise instructions, how would you 
usually load the plug-in js files? Either way, you should be able to get 
support for your Enterprise Plugin questions on the enterprise forum.

http://groups.google.com/group/google-earth-enterprise

Original comment by fraser.c...@gmail.com on 20 May 2011 at 5:36

GoogleCodeExporter commented 8 years ago
Have you figured out how to deal with the references to google.com/js for 
offline mode ?
I believe that those dependencies end up trying to authenticate with Google 
using the network and fail when no network connection exists.

Original comment by grego...@gmail.com on 20 Jun 2012 at 8:50

GoogleCodeExporter commented 8 years ago
There is no offline mode - the plugin is webbased and this control library 
simply provides a wrapper for it, along with some other useful/common controls. 
It isn't an offline version of the plugin. In any case attempting to use the 
plugin offline,, spoofing authentication etc would be a breech of the current 
Maps and Earth TOS.

In short, if you don't have a network connection it won't work and this is as 
expected. 

In the future if Google provide a way, within the bounds of the TOS, to cache 
data and load the plugin offline then I will include that functionality.

If you have access to the Enterprise version then things may be different...but 
again in that case I would direct you to use Enterprise support.

Original comment by fraser.c...@gmail.com on 17 Aug 2012 at 6:57