*

[PlanetJ Corporation

[support@planetJavaInc.com]

[www.PlanetJavaInc.com]


WOW & Google Maps / Earth User Guide

WOW & Google Maps / Earth

Google Earth is an online tool that provides many useful features leveraging satellite imagery. Google Earth provides graphical maps and various presentations of terrain. In using WOW with Google Earth, you can connect your organization's data and use these powerful Google Earth features. Google Earth and WOW can be used to track customers, vendors or sales and map out any type of area of interest. This document will explain how to set up WOW with Google Earth, WOW with Google Maps and WOW with the Google Earth Browser Plugin and provide samples to try with your in house data.

If you are not familiar with the features of WOW, please refer to the PlanetJ Corporation website: www.planetjavainc.com/wow and/or review this online tutorial: http://www.planetjavainc.com/recwebinar.htm.

 

NOTE: When using 3rd party applications such as Google Earth, the customer is responsible for ensuring their use meets guidelines as stated by 3rd parties. PlanetJ assumes no responsibility for the misuse of such products.

NOTE: Additional charges may apply. See the following website for details: http://www.google.com/enterprise/earthmaps/earth_pro.html

WOW & Google Earth

Setting Up WOW with Google Earth

Using Field Descriptors

Setting Up Placemarks (Using Field Descriptors)

Using Association Operations

Setting Up Google Maps

Setting Up the Google Earth Plugin

Configuring Google Keys

Google { } Property Group

Custom Placemarks


Setting Up WOW with Google Earth

NOTE: In order to utilize the following WOW add-on feature, the user must first install Google Earth. This can be accomplished by downloading the installer here: http://earth.google.com 

Note: 

Within your WOW application, the first step in setting up WOW with Google Earth is to create an operation with an SQL lookup that will display a table. The SQL SELECT statement for this "Google Earth sample" is shown below.

SELECT t.*,'More Info/Edit' as d_link FROM wowsamples.google_earth_cust t

Here's an image of the SQL in our WOW Builder:

Next, implement a RowCollection on this table. For the purpose of this example, we will use: planetj.wow.google.GoogleEarthRC by entering it as the "Row Collection class", which is shown in the screen shot below.

The default SQL Operation should have a display area that looks like the following:

In the Properties text area, as shown in the bottom of the picture above, the following code must be used:

Actions {type:RC;show:google earth;}

Below is an image of the Actions { } property group in the WOW Builder:

In the same text area (Properties) change "selectionType:none;" to "selectionType:multiple;" as shown below. This allows the rows to have check boxes beside them.

Before changing the mode of "selectionType", (as shown in screen shot below):

NOTE: there are no boxes next to "Id" field as screenshot below.

After changing the mode of "selection type" from "selectionType:none;" to "selectionType:multiple;". The application appears like screen shot below.

NOTE: Now, there are boxes next to "Id" column as shown in the following screenshot.

Using Field Descriptors

Now the entire table is setup; however, the GoogleRowCollection class must be able to extract the correct data from the database. The GoogleRowCollection uses the following field descriptors: Id, Name, E-Mail, Address1, Address2, City, State, Phone Number, Latitude, and Longitude etc. As many of the field descriptors as possible should be populated. Latitude and Longitude will be used to place the Google Earth place mark if both are defined. Even a zip code alone can be used, but it is best to populate as much data as possible. The first name, last name, area code and phone number are used simply for description and can be assigned for anything desired to appear in the description box.

Setting Up Placemarks (Using Field Descriptors)

NOTE: Usage IDs are in parentheses.

  1. Placemarks (come from each Row) are created one of three ways.
  2. If there are no defined latitude and longitude, the placemark will be an address 1 (-10) or address 2 (-20) field. Address 1 is used for placemark first. If address 1 is not available, address 2 can be used along with city (-30), state (-120), and zip (-140).
  3. If there is no latitude, longitude or address fields, just the zip can be used (-140).

Ex: Zip Code’s usage ID is set to -140 as the screenshot below.

Using Association Operations

Association operations allow associations from place mark back to the WOW operation using the SELECT statement as shown below.

SELECT * FROM wowsamples.google_earth_cust t where id = ??ID

Here is the operation in the WOW Builder:

The GoogleRowCollection will automatically take any Association Operation on a column, defined in a FieldDescriptor and allow for a link to it from within Google Earth.

This association will link back to the WOW server and run a query based on the parameters of the selected place mark. For instance, the "View/Edit Customer Info" operation is applied in a field descriptor as shown in the image below.

"Association Operation" field has a drop down list to select any associations, which Google Earth will attempt to link to. One should note that it only provides links to operations on the same row.

NOTE:  All association operations must use column names, and not search by usage IDs.

As demonstrated in the screen above, the operation references the column name id = ??ID, this will work for the table as it references the appropriate column. The drawback is that the same association operation cannot be reused for another table unless the other table has the same column names that are referenced.

The following SQL call will not work as it references column data by usage ID:

SELECT * FROM SCHEMA.TABLE WHERE HSTE=??^-120

The following steps below show how to use "WOW Google Earth". The name of the application is "Google Earth Sample".

After running the application, check one of the boxes on the left side of the row (Susan's box is checked) -->click "Google Earth" button.  See screenshot below:

After clicking on "Google Earth", a small window pops up as below --> click "OK"

This will actually open the Google Earth Application on the computer and run the KML file, which places the placemark(s) you've selected on the map:

From the leftmost section, in the middle(circled in screenshot above), double click on "WOW addresses" --> double click on "All customers"--> the Google Earth will go to Susan's address located by placemark.

Susan's address will display on the map by clicking on placemark. See the screenshot below.


Setting Up Google Maps

NOTE: According to Google policies to use Google Maps and the Google Earth Plugin in the users own domain the user must sign up his domain for these Google services. Subscription is free and can be done here: http://code.google.com/apis/maps/signup.html. This page will generate a subscription key by domain. You must insert this key into your configuration values for the browser plugins to work correctly. For instructions on inserting your key into configuration values, please click HERE.

Google Maps is set up very similar to Google Earth, in fact the only difference between the "Setting Up WOW with Google Earth" and Setting Up Google Maps is to set the row class to: planetj.wow.google.PlacemarkRow, set the JSP file to: /wow/google/google-maps.jsp and set the row collection class to: planetj.wow.google.PlacemarkRowCollection. Also, you do not need to set the Actions { } property in the Properties section, nor set the selectionType to multiple. These two properties will not affect the running operation if they are included, they are just not necessary as no row collection will be returned in the operation, just the map.  The classes and JSP file have all been set in the image below:

 

You may also further customize the way Google Maps displays, as well as the way the placemark data is shown when clicked. To view the Google { } property group, please click HERE.

The operation, when run, will use the Google Maps browser plugin to display your placemarks within the browser. No data will be returned, just the Map.

Here is an example of a Google Map displaying in a WOW operation:


Setting Up the Google Earth Plugin

NOTE: According to Google policies to use Google Maps and the Google Earth Plugin in the users own domain the user must sign up his domain for these Google services. Subscription is free and can be done here: http://code.google.com/apis/maps/signup.html. This page will generate a subscription key by domain. This page will generate a subscription key by domain. You must insert this key into your configuration values for the browser plugins to work correctly. For instructions on inserting your key into configuration values, please click HERE.

The Google Earth Plugin is set up very similar to Google Earth, in fact the only difference between the "Setting Up WOW with Google Earth" and Setting Up the Google Earth Plugin is to set the row class to: planetj.wow.google.PlacemarkRow, set the JSP file to: /wow/google/google-earth.jsp and set the row collection class to: planetj.wow.google.PlacemarkRowCollection. Also, you do not need to set the Actions { } property in the Properties section, nor set the selectionType to multiple. These two properties will not affect the running operation if they are included, they are just not necessary as no row collection will be returned in the operation, just the map.  The classes and JSP file have all been set in the image below:

 

You may also further customize the way the Google Earth plugin displays, as well as the way the placemark data is shown when clicked. To view the Google { } property group, please click HERE.

When you run your new operation it will render the placemarks in the Google Earth plugin within your browser. No data will be returned, just the Google Earth Plugin as in the screenshot below:


Configuring Google Keys

NOTE: According to Google policies to use Google Maps and the Google Earth Plugin in the users own domain the user must sign up his domain for these Google services. Subscription is free and can be done here: http://code.google.com/apis/maps/signup.html This page will generate a subscription key by domain.

The key that is returned for the particular domain you registered will need to be placed into your Configuration Values inside the user library that you will be running your Google Map or Google Earth Plugin (both will be referred to as Google throughout the rest of this page) from. To set up the Configuration Values, first sign on to your builder in the user library that contains the Google operations. Next, below the header in the WOW Builder, there is a link called "Development Tools" and if you hover over the link, a new link "WOW Utilities" will appear. Click this link to open your WOW Utilities.

Here is a screenshot of the WOW Utilities link:

WOW Utilities will open up in a new browser window (or tab, depending on how your browser is set up).

This is what WOW Utilities will look like when it loads:

Once you are in the WOW Utilities you need to select Keyed Values ---> Add Configuration Value from the drop down menu below the header.

Here is a screenshot of where you find Add Configuration Value:

Once you select the Add Configuration Value link you will be brought to a page that will allow you to insert a configuration value into your user library. There are 3 fields that you will need to fill in with values:

Here is a screenshot of a Configuration Value with its values filled in:

Once you insert the record, by clicking the "Insert" button, your user library is set up to run your Google operations.


Google { } Property Group

The Google { } property group allows the developer to customize the way certain features of the Google Maps and Google Earth Plugin function or are displayed.

NOTE: These properties do not affect the Google Earth Application, just the Google Maps and Google Earth Browser-based Plugins.

Property

Value

Description

showPlacemarkInfoEvent

CLICK | MOUSEOVER | DOUBLECLICK

Determines how the user displays the Placemark Information.The default is CLICK

infoTemplate

see examples below this table

Determines how the Placemark Information is displayed in the Placemark Info bubble. This can contain any HTML elements (used for formatting purposes), as well as parameters from the row collection that should be returned by the operation. It will also include any associations if those associated fields are included.

mapWidth

measurement values (px, cm, %, etc...)

Determines the width of the plugin frame. The default is 800px

mapHeight

measurement values (px, cm, %, etc...)

Determines the height of the plugin frame. The default is 500px

mapMargin

as CSS margin

Determines the margins of the plugin frame. The default is 0px 0px

mapBorder

as CSS border

Determines the border of the plugin frame. The default is 0px (no border)

mapCenterAddress

Any valid address (can be just city, city and state, etc...)

Determines the center point of the map when it is rendered.

mapType

Values defined here

Determines the type of map used. If the property is not specified, the default is G_NORMAL_MAP

mapZoom

any number > 0

Determines the starting Zoom level of the map. Default is 4

placemarkWidth

measurement value in pixels

Determines the Width of the placemark displayed. The default is 16px.

placemarkHeight

measurement value in pixels

Determines the Height of the placemark displayed. The default is 16px.

placemarkIconAnchorLeft

measurement value in pixels

Determines the location (from the left of the image) that the plugin will use to set the placemark on the map. Default is 0 px from the left (left edge).

placemarkIconAnchorTop

measurement value in pixels

Determines the location (from the top of the image) that the plugin will use to set the placemark on the map. Default is 0 px from the top (top edge).

 

Below are some samples of the Google { } property group:

Google{ showPlacemarkInfoEvent:mouseover;

infoTemplate:??NAME <br/> ??ADDRESS1 <br/> ??CITY ??STATE; }

 

If the above properties were set in the display properties, it would return this when you hover over a placemark:

Google{ showPlacemarkInfoEvent:click;

infoTemplate:<h1>??NAME</h1> <br/> ??ADDRESS1 <br/> ??CITY ??STATE <br/> ??NOTES;

mapBorder:5px solid red;

}

 

If the above properties were set in the display properties, the placemark would return this when clicked:

Notice the red border, 5 pixels wide. Also notice the placemark information has some HTML formatting (the Name is formatted as a <h1> element).


Custom Placemarks

Custom placemarks can be created for both the Google Maps and Google Earth browser plugins. The first step to creating the custom placemarks is to find or create custom images to be used for the placemarks. Once the custom images have been assembled, they need to be placed somewhere in your file system that is accessible by WOW, for example you could place them in your 'user' folder in your WOW webapp (i.e. C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\wow65\user\).

To use a custom image for a placemark, the URL path to the custom image must be included in the resulting row collection of your Google operation. The field that contains this URL path must have its Field Descriptor Usage ID set to -380. This can be done by adding a field to your table that contains the URL path OR you can create a new table that contains the URL as well as another field that can be used to join via SQL Join statement to the table you will be using to create your Google operation.

After you have the custom placemarks set, when you run your Google operation, the custom images should be displayed as placemarks.