Geomap

From JRapid

Jump to: navigation, search

Geomap is a visualization of the Google Charts View. It is a map of a country, continent, or region map, with colors and values assigned to specific regions. Values are displayed as a color scale. The map is rendered in the browser using an embedded Flash player. Note that the map is not scrollable or draggable.

Contents

Datamode

The "regions" datamode fills entire regions (typically countries) with colors corresponding to the values that you assign. Specify the regions style by assigning

Geomap "regions" visualization

The "markers" datamode displays a circle, sized and colored to indicate a value, over the regions that you specify. To use markers, you must include the following Google Maps API script with a key, unless you specify locations using latitude and longitude values.

Geomap "markers" visualization

Note: A map can display a maximum of 400 entries; if your view holds more than 400 rows, only the first 400 will be shown. The fastest modes are datamode='regions' with locations specified as ISO codes, and dataMode='markers' with lat/long enties. The slowest mode is datamode='markers' with a string address.

Usage

<listing datamode="regions|markers" 
         itemname=PROPERTY_OF_TYPE_STRING 
         itemvalue=PROPERTY_OF_TYPE_INTEGER 
         name=NAME
         region=REGION 
         view="googlecharts" 
         visualization="geomap"
         width=WIDTH
         height=HEIGHT
/>
  • name (required): The name of the listing.
  • view (required): The name of the view for the listing.
  • visualization: The name of the googlecharts visualization. If not specified, the default value is "piechart".
  • itemname (required): a reference to a property which will work as the X-AXIS of the chart.
  • itemvalue (required): a reference to a property which will work as the Y-AXIS of the chart.

Important !

You must include Google's jsapi (JavaScript API) file in your project to get the view running.

<config>
  ...
  <usescript location="http://www.google.com/jsapi"/>
  ...
</config>

Example

In this example the "region" attribute is set to '155' which references the Western Europe region.

The following information will be displayed as a GoogleCharts Geomap view.

Basic Listing

The "itemname" attribute references the "region" property which must be of type string and the "itemvalue" attribute references the "value" property which must be of type integer.

<entity label="Sale" name="Sale">       
        <listing options="{region:155}" itemname="region" itemvalue="value" name="geomapListing" view="googlecharts"
 visualization="geomap"/>
        <property display="primary" label="Region" name="region" type="string"/>
        <property display="secondary" label="Value" name="value" type="integer"/>
</entity>
Western Europe

If no "region" attribute is specified then the default 'world' value is applied.

<entity label="Sale" name="Sale">       
        <listing itemname="region" itemvalue="value" name="geomapListing" view="googlecharts" visualization="geomap"/>
        <property display="primary" label="Region" name="region" type="string"/>
        <property display="secondary" label="Value" name="value" type="integer"/>
</entity>
World

Back to the Western Europe region we change the datamode value to "markers":

<entity label="Sale" name="Sale">       
        <listing options="{region:155, dataMode:"markers"}" itemname="region" itemvalue="value" name="geomapListing"
 view="googlecharts"
 visualization="geomap"/>
        <property display="primary" label="Region" name="region" type="string"/>
        <property display="secondary" label="Value" name="value" type="integer"/>
</entity>
Markers

The information of the above example was about countries and values. The Geomap API specifies that the map can also display regions (cities).

For example:

Basic Listing

The codes for the US city codes were taken from the ISO 3166-1 Page.

The region is set to "US" and the datamode to 'regions'.

<entity label="Sale" name="Sale">
        <listing options="{region:'US'}" datamode="regions" itemname="region" itemvalue="value" name="geomapListing"
 view="googlecharts" visualization="geomap"/>
        <property display="primary" label="Region" name="region" type="string"/>
        <property display="secondary" label="Value" name="value" type="integer"/>
</entity>
Regions in US

Finally, the datamode is set to "markers".

Markers in US

Google Geomap API

In the Google API page you will find important documentation like valid regions values, map configuartion, etc.

Remember that the available configurations for the JRapid Geomap view are the ones listed in the usage section of this page.

Google Geomap Documentation

See also

Personal tools