GOOGLE API - Lotus Notes & Google Earth
Display Lotus Notes Document on Google Earth is simpliest solution. To add points on maps you just have to prepare KML file.
Quick description of KML format
KML files are XML files who permiss to describe the points to display on earth. The definition of a point include position of the point (latitude and longitude) and a description.
<kml xmlns="http://earth.google.com/kml/2.0">
<Placemark>
<description>
<![CDATA[<a href="http://www.google.com/">Google Search!</a>]]>
</description>
<name>Google Headquarters</name>
<Lookat>
<longitude>-122.0839</longitude>
<latitude>37.4219</latitude>
<range>540.68</range>
<tilt>0</tilt>
<heading>3</heading>
</Lookat>
<Point>
<coordinates>-122.0839,37.4219,0</coordinates>
</Point>
</Placemark>
</kml>- Placemark : New point
- description : description displayed when you click on a point in Google Earth.
- name : name of the point
- Lookat : geolocalisation
- longitude : longitude of the point
- latitude : latitude of the point
- range : altitude
- tilt : angle from North
- heading : angle from skyline
- coordinates : coordonnates of the point
Other options can be used like customization of the icon. You'll find all informations on the help page of Google Earth : (http://www.keyhole.com/kml/docs/webhelp/index.htm)
How to integer Lotus Notes data in Google Earth with a simple view
There's a lot of solutions to interface Lotus Notes and Google Earth. I've choosen to generate KML file from Notes View.
Step 1 : The form
We need to have this informations :
- a title
- a description
- longitude
- latitude

Step 2 : The view
After create new view, select option "treat view content as HTML".
Column formula is (be carefull with Uppercase and Lowercase):
"<Placemark>
<description><![CDATA[" + description + "]]></description>
<name>" + titre + "</name>
<Lookat>
<longitude>" + longitude + "</longitude>
<latitude>" + latitude + "</latitude>
<range>540.68</range>
<tilt>0</tilt>
<heading>3</heading>
</Lookat>
<Point>
<coordinates>" + longitude + "," + latitude +"</coordinates>
</Point>
</Placemark>"Step 3 : form to display view
To integer header and character setting of the KML file, I create a form to display the embedded view.
- Create a forme named : $$ViewTemplate For
Select Option "Type of file : Other : Application/vnd.google-earth.kml+xml" in form properties Insert KML header. I choose iso-8859-1 charset to support french characters. You can choose UTF-8 or other local charset.
<?xml version="1.0" encoding="iso-8859-1" ?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>Titre de mon flux Google Earth</name></Document>
</kml>The MIME type was defined in Form properties. If you have installed Google Earth, you can open the view from a Web Browser. A dialog box will be open to ask you if you want to open the file in Google Earth. If you click on OK your file will be automaticly integer in Google Earth.
You can integer this file directly in Google Earth too. Open Google Earth and select Add\Network Link in menu. You'll just have to insert the URL of your view in location field.
Limitation with access control list
Be careful, you must defin Anaonymous with Reader access at least. I'll write an entries more later to resolve this problem.
Examples
- An example of KML File from Lotus Notes Database : http://free.dominoserver.de/it/dominoweb.nsf/googleearth.kml
- The same file but in XML to display it in Web Browser: http://free.dominoserver.de/it/dominoweb.nsf/googleearth.xml
Version française





1 comments:
Phillippe, you're my hero. Can't believe I'm the first to comment on this useful post, but know that you are the first hit on Google on the string "lotus notes" "google earth". Here's to Notes doing yet another awesome thing fast and simple, and well documented thanks to a dedicated blogger. THANKS. Is there anything this product can not do, when you have an excellent mind behind it, I ask.
Post a Comment