cgxp.plugins.Measure

ptype
cgxp_measure
class cgxp.plugins.Measure(config)

This plugin adds a menu with menu items for selecting measure tools.

The menu div is assigned the cgxp-menu-measure class name, which can be useful for styling.

Example Use

Sample code showing how to add a Measure plugin to a gxp.Viewer:

new gxp.Viewer({
    ...
    tools: [{
        ptype: 'cgxp_measure',
        actionTarget: 'center.tbar',
        toggleGroup: 'maptools'
    }]
    ...
});

Config Options

Configuration properties.

actionConfig

Object Config object for the action created by this plugin.

areaMenuText

String Text for measure area menu item (i18n).

areaTooltip

String Text for measure area action tooltip (i18n).

azimuthMenuText

String Text for azimuth menu item (i18n).

azimuthTemplate

String The template string to be used to display the azimut (i18n).

Here is an example of how it can look like:

azimuthTemplate: '<table class="measure">' +
    '<tr><td>Distance : </td><td>{distance} {units}</td></tr>' +
    '<tr><td>Azimut : </td><td>{azimuth}&deg;</td></tr>' +
    '<tr><td>Altitude diff. : </td>' +
    '<tpl if="raster != false">' +
        '<td>{[Math.round(values.raster[1].mnt - values.raster[0].mnt, 2)]} {mapUnits}</td></tr>' +
    '</tpl>' +
    '<tpl if="raster == false">' +
        '<td> ... </td></tr>' +
    '</tpl>' +
    '</table>'
azimuthText

String Text to display in point azimuth tooltip. Not taken into account if azimuthTemplate is set.

azimuthTooltip

String Text for azimuth action tooltip (i18n).

coordinateText

String Text to display in point mesure tooltip.

distanceText

String Text to display in point azimuth tooltip. Not taken into account if azimuthTemplate is set.

easternText

String Text to display in point mesure tooltip.

lengthMenuText

String Text for measure length menu item (i18n).

lengthTooltip

String Text for measure length action tooltip (i18n).

measureTooltip

String Text for measure action tooltip (i18n).

northernText

String Text to display in point mesure tooltip.

outputTarget

String Popups created by this tool are added to the map by default.

pointMenuText

String Text for measure point menu item (i18n).

pointTooltip

String Text for measure point action tooltip (i18n).

Public Methods

Public methods.

Measure.addActions()

Table Of Contents

Previous topic

cgxp.plugins.MapQuery

Next topic

cgxp.plugins.Menu

This Page