Me he basado en los ejemplos que he encontrado por Internet, donde a un script como éste se le llama reflector.
Más en detalle:
Lo primero que debemos investigar es el objeto NetworkLink de la especificación KML. Este objeto permite llamar a un objeto situado en Internet (en mi caso, una página ASP), a la que le pasará un parámetro BBOX, con las coordenadas WGS84 que definen la extensión de mapa que muestra en pantalla.
Así que la estrategia para hacer un script reflector es hacer un script que recoja las coordenadas, y haga una petición a un servidor de mapas concreto. Los ejemplos de Internet se han quedado ahí. Yo me preguntaba, ¿y si en la propia llamada al script del objeto NetworkLink incluyo el servidor y el servicio de mapas como parámetros? Y así lo hice.
A partir de este momento, tengo un conector universal. Puede ser invocado para traducir peticiones de Google Earth a cualquier servidor ArcIMS del mundo.
En el diagrama anterior se muestra la arquitectura de este conector universal; lo que ofrezco es el script reflector, que está ubicado en http://www12.asphost4free.com/ogomez2/GE/arcims_reflector.asp
Este script no funciona así directamente, debe ser invocado desde un objeto NetworkLink dentro de Google Earth.
Para probar cómo funciona, he creado una aplicación que, dada la ruta a un servidor ArcIMS, consulta los servicios de mapa disponibles, y te permite seleccionar las capas que quieres mostrar. Finalmente genera un fichero que deberéis salvar como .KML para poder abrirlo con Google Earth posteriormente. Esta aplicación está disponible en:
http://www12.asphost4free.com/ogomez2/GE/arcims2ge.asp
Este servidor me proporciona alojamiento gratuito junto con soporte a páginas ASP, pero no es muy estable. Si falla, paciencia, volverá a funcionar en un rato.
I have something to offer for free: the Universal connector from Google Earth to ArcIMS. It's a script that can invoked from Google Earth specifying certain parameters, such as the ArcIMS server, the map service, and the layers to show (in addition to the extent of the map, but that's the job of Google Earth); the script connect to the specified ArcIMS server, asks for the map, and makes it available to Google Earth. Science fiction? No, just the reality, and with a few coding in fact.
I based on the examples that can be found over the Internet, where a script like this is called a reflector script. More in detail:
The first thing we should investigate is the NetworkLink object in the KML specification. This object allows remote calls to an object placed over the Internet (in my case, an ASP page); Google Earth will invoke this object specifying the BBOX parameter, what means the extent of the map in WGS84 coordinates.
The main strategy for building a reflector script is collecting these coordinates, and building a map request for the specific map server using those coordinates. The examples over the Internet stopped there, but I wondered, what if I include in the call to the script the map server and the map service as parameters as well? And I made that.
Since that moment, I built an universal connector for adding ArcIMS map services into Google Earth. It can be invoked for translating Google Earth requests to any online ArcIMS server in the world.
The above diagram shows the architecture of this universal connector; what I am offering as the universal connector is the reflector script, located in http://www12.asphost4free.com/ogomez2/GE/arcims_reflector.asp
This script does not work directly, it must be invoked from a NetworkLink object inside Google Earth.
For trying it, I have created an application that allows querying an ArcIMS server, and build a KML file from the selected layers in one service. It will create a file that you should download and rename as .KML, for Google Earth to open it. This application is available under:
http://www12.asphost4free.com/ogomez2/GE/arcims2ge.asp
This server provides me with free hosting and ASP pages support, but it's not very stable. If it fails, please be patient, it will work again in a few minutes time.