API

Mappia API

Expand All
 

Layers

An Layer is a set of maps. All maps that you want to display together or combine their information needs to be defined inside the same Layer.
All information of the active Layer, like map legends and tools, are displayed in a window at the top left of the screen when that Layer is active.
A Layer can be defined inside a Group, as described in the Group section.
An example of Layer with a single map would be:
[
   {
      // The Layer name
      title: 'My first layer!',

      // The map that will be shown
      name: 'CSR:altimetria',

      // Flag to make the map show on start
      visibility: true,
   },
]
 

description: String

               

Define the text that will be displayed when the mouse hover the Legend Window Title. This description applies when the 'source' of the map is 'xyz' or the Layer is a 'vector'.

Example:
[
  {
     title: 'Example of description for XYZ map',
     color: '#666699',
     elements: [
        {
           title: 'This is the Layer Legend Window Title, hover me!',
           name: 'planet:planet',
           source: 'xyz',
           url: 'https://tiles.planet.com/basemaps/v1/planet-tiles/planet_medres_visual_2021-09_mosaic/gmap/${z}/${x}/${y}.png?api_key=PLAK78456687760442eaa3d3da16aaac5f2d',
           visibility: true,
           description: 'Hover the Layer Title',
        },
     ],
  },
]
Defaults to 'XYZ Title' or 'Vector Title'
 

descriptionHtml: String

               

Define the content that will be displayed at the Query section ("Exibir Consulta" button). This property accepts any string in HTML format. Besides that, you can also use predefined tools.

You can find more information about the tools available for use in: Tools Section.

Example:
[
  {
     title: 'Example of descriptionHTML',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has a custom descriptionHTML',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              {
                 type: 'query',
                 pressed: true
              },
           ],
           descriptionHtml:
              '<p>You can use HTML tags</p>'
              +
              '\{\{label|text=Or the tools from Mappia:\}\}'
              +
              '\{\{button|text=I\'m a button from Mappia\}\}',
        },
     ],
  },
]
Defaults to string.empty
 

disabledAttributes: String

               

Define which styles will be hidden in the Style Chooser Combobox from Layers that has the 'source' property as 'local'. You need to pass the name of a style as in the GetCapabilities() xml. They follow the pattern of the map name, underline (_) and then the number of the style. (<map_name>_<number>). You can hide more than one style. For this you only need to separate their names by commas.

Example:
[
  {
     title: 'Example of disabledAttributes',
     color: '#666699',
     elements: [
        {
           title: 'This Layer hides the styles \'Mapa geológico\' and \'Tempo geológico\' from the styles choose combobox',
           name: 'CSR:geologia',
           source: 'local',
           visibility: true,
           // geologia_2 is the style 'Tempo geológico'
           // geologia_1 is the style 'Mapa geológico'
           // The 'disabledAttributes' property is used to hide the styles from the styles chooser combobox
           // All styles that are hidden must be separated by commas
           disabledAttributes: 'geologia_2,geologia_1',
        },
     ],
  },
]
Defaults to null
 

exclusiveGroupDetails: String

               

Define a name for a Layer Details. Between all Layers with the same ‘exclusiveGroupDetails’ name, only one Layer can have its Legend open each time.

Example:
[
  {
     viewTitle: 'Only one Legend can be open each time',
     title: 'Example of exclusiveGroupDetails',
     color: '#666699',
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:estados',
           source: 'calculate',
           exclusiveGroupDetails: 'ExampleName',
           visibility: true,
        },
        {
           title: 'Layer 2',
           name: 'CSR:rios_principais',
           source: 'calculate',
           exclusiveGroupDetails: 'ExampleName',
           visibility: true,
        },
        {
           title: 'Layer 3',
           name: 'CSR:geologia',
           source: 'calculate',
           exclusiveGroupDetails: 'ExampleName',
           visibility: true,
        },
     ],
  },
]
Defaults to string.empty
 

extents: Array.<Numeric>

               

Define which tiles will be used to render the map. All the tiles that are within the 'extents' coordinates will be used to render the map. The extents must be in EPSG:4326 (coordinates in lat,long). Also, the array values need to be in the order: [minX, minY, maxX, maxY].

Example:
// Play around with the maps visibility to check the regions defined by the extents.
[
  {
     title: 'Example of extents',
     color: '#FFA900',
     elements: [
        {
           title: 'Restricted extents',
           name: 'CSR:altimetria',
           visibility: true,
           // Follows the order [minX, minY, maxX, maxY]
           extents: [-48.5, -14.5, -46.0, -13.0],
        },
        {
           title: 'Restricted extents 2',
           name: 'CSR:altimetria',
           visibility: true,
           // Follows the order [minX, minY, maxX, maxY]
           extents: [-43.9, -19.8, -43.1, -18.9],
        },
        {
           title: 'This Layer displays the hole map',
           name: 'CSR:altimetria',
           // This extents render the whole world.
           extents: [-180.0000, -90.0000, 180.0000, 90.0000],
           startListed: true,
        },
     ],
  },
]
Defaults to Array.empty
 

hideLegendButton: boolean

               

Defines if the Legend Button at the bottom right of the Legend Window should be hidden. Set it to 'true' to hide the button. Set it to 'false' to display it. This property only applies to the layer that has the 'type' property as 'local'.

Example:
[
  {
     title: 'Hiding the Legend Button',
     color: '#FFA500',
     elements: [
        {
           title: 'The Layer Legend Button will be hidden',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           hideLegendButton: true,
           descriptionHtml:
              '\{\{label|text=The legend button is hidden, only the descriptionHtml is visible\}\}',
        },
     ],
  },
]
Defaults to false
 

hideListing: Boolean

               

Define if should hide a Layer in the list that appears when the mouse hover the Group Title at the top of the screen. Set it to 'true' to hide that Layer in the list. Otherwise, set it to 'false' to show it.

Example:
[
  {
     title: 'A Group with 3 Layers, but one is hidden',
     color: '#FFA500',
     elements: [
        {
           title: 'Map of the altitude in Brazil',
           name: 'CSR:altimetria',
           source: 'local',
        },
        {
           title: 'This Layer will be hidden at the Group list',
           name: 'CSR:rios_principais',
           source: 'local',
           hideListing: true,
        },
        {
           title: 'Map of the geology in Brazil',
           name: 'CSR:geologia',
           source: 'local',
        },
     ],
  },
]
Defaults to false
 

hideStyleChooser: Boolean

               

Define if should hide the Combobox with the map possible styles that can be applied to a map in a Layer that has the 'source' 'local'.

Example:
[
  {
     title: 'Example with hidden style Combobox',
     color: '#FFA500',
     elements: [
        {
           title: 'Map of the geology in Brazil',
           name: 'CSR:geologia',
           source: 'local',
           visibility: true,
           startLegendOpen: true,
           hideStyleChooser: true,
        },
     ],
  },
]
Defaults to false
 

insideOpacity: Array.<Numeric>

               

Defines the opacity for the maps defined in the 'name' property. This property is an array of values which are the opacity that will be applied in the same order that the map was defined in the 'name' property. For example, the first value in the 'insideOpacity' array will define the opacity for the first map defined in the 'name' property, the second value is the opacity for the second map, and so on. The opacity value is a number between 0 and 1. 0 being transparent and 1 opaque.

Example:
[
  {
     title: 'Example of insideOpacity',
     color: '#666699',
     elements: [
        {
           name: 'CSR:estados,CSR:rios_principais,CSR:geologia',
           source: 'calculate',
           // The values are applied to the layers in the same order as they are defined in the name property. So the CSR:estados map has the opacity of 0.5, the CSR:rios_principais map has the opacity of 1, and the CSR:geologia map has the opacity of 0.7.
           insideOpacity: [0.5, 1, 0.7],
           visibility: true,
        },
     ],
  },
]
Defaults to [1, 1, 1, ...]
 

legendTitle: String

               

Defines the text that will be displayed at the top of the 'legendhtml tool' declared at the 'descriptionHtml' property

Example:
[
  {
     title: 'Example custom legend title',
     color: '#FFA500',
     elements: [
        {
           title: 'Map of the geology in Brazil',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           legendTitle: 'This is a custom legend title',
           descriptionHtml:
              '&bsol;&lcub;&bsol;&lcub;legendhtml&bsol;&rcub;&bsol;&rcub;',
        },
     ],
  },
]
Defaults to string.empty
 

name: String

               

Defines the maps that will be a part of the Layer. Every map defined in here will be shown when the Layer is active. Besides that, all of their information can be used to calculate a new map combining their data. In this website you will find some of the maps that can be used: http://maps.csr.ufmg.br/geonetwork/srv/por/search. You can find their name at the section "Visão geral do mapa" under its image. Those maps have the prefix "CSR:" before their names. Maps can also be uploaded by you. For that, you just need to define the 'source' property as 'file'.

Example:
[
  {
     title: 'A Group with two maps',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has two maps!',
           // Each map is separated by commas
           // The first map is CSR:rios_principais that have the rivers of Brazil
           // The second map is CSR:estados that show the states of Brazil
           name: 'CSR:rios_principais,CSR:estados_cf',
           visibility: true,
        },
     ],
  },
]
Defaults to string.empty
 

opacity: Numeric

               

Define the opacity of the Layer. The opacity is a value between 0 and 1 that is a scale for its transparency. 0 is completely transparent. 1 is completely visible.

Example:
[
 {
   title: 'Example of opacity in a Layer',
   color: '#666699',
   elements: [
     {
       title: 'This Layer has its opacity set to 50% of the original visibility',
       name: 'CSR:geologia',
       source: 'local',
       visibility: true,
       opacity: 0.5,
     },
   ],
 },
]
Defaults to 1
 

priority: Number

               

Defines the order of which map will be rendered on top of the others. Layers with higher 'priority' will always be rendered on top of the layers with lower 'priority'.

Example:
[
  {
     title: 'At the bottom will be the geology, then the states and at top the rivers',
     color: '#FFA500',
     elements: [
        {
           title: 'Map of the states in Brazil',
           name: 'CSR:estados',
           source: 'local',
           priority: 2,
           visibility: true,
        },
        {
           title: 'Map of the rivers in Brazil',
           name: 'CSR:rios_principais',
           source: 'local',
           priority: 3,
           visibility: true,
        },
        {
           title: 'Map of the geology in Brazil',
           name: 'CSR:geologia',
           source: 'local',
           priority: 1,
           visibility: true,
        },
     ],
  },
]
Defaults to 0
 

showRemoveBtn: Boolean

               

Defines it the remove button at the top right of the Layer Legend Window show be displayed. Set it to 'true' to show it. Set it to 'false' to hide it.

Example:
[
  {
     title: 'Hiding the remove button',
     color: '#FFA500',
     elements: [
        {
           title: 'The \'X\' button at the top right of this Layer removes this map',
           name: 'CSR:rios_principais',
           source: 'local',
           visibility: true,
        },
        {
           title: 'There is no button to remove the this map',
           name: 'CSR:estados',
           source: 'local',
           visibility: true,
           showRemoveBtn: false,
        },
     ],
  },
]
Defaults to false
 

source: String

               

Defines the source from where the maps declared at the name will be loaded from. The Source can be one of the following: - 'local': The maps in the name will be loaded from the CSR servers - 'calculated': The maps in the name gonna be used to calculate a new map in the expression() function and the result will be displayed as the Layer - 'file': The map will be loaded from a file or other custom source. For this, you need to define the file type in the 'type' property and the file where the map should be loaded. For example, for a JSON file, you also need to define the 'json' property. - 'xyz': The map will be loaded from an url by the XYZ protocol. The url property is required for this type of source. You can find more informations about the XYZ protocol at: https://developers.planet.com/docs/basemaps/tile-services/xyz/

Example:
// Example of how to load a map with the local source
[
  {
     title: 'Map rendered by a local source',
     color: '#666699',
     elements: [
        {
           title: 'Map with local source',
           name: 'CSR:paises',
           source: 'local',
           visibility: true,
        },
     ],
  },
]
Example:
// Example of how to load a map with the calculated source
[
  {
     title: 'Map rendered based on calculation',
     color: '#666699',
     elements: [
        {
           title: 'Filtering a part of the map',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           updateAutomatically: true,
           expression: function(layersVals, inputs) {
              // layerVals have the value of the legend applied in every pixel of the map
              let mapValue = layersVals[0];

              // Remove every type of relief that is not 'Mantiqueira'
              if(mapValue != 'Mantiqueira') { // If the pixel is not 'Mantiqueira'
                 return undefined; // Don't show the pixel
              }

              // If the pixel is 'Mantiqueira', return the value of the pixel
              return mapValue;
           },
        },
     ],
  },
]
Example:
// Example of how to load a map with the file source
[
  {
     title: 'Map rendered based on file source',
     color: '#FFA500',
     elements: [
        {
           title: 'Map with file source',
           name: 'example:map_file_source',
           source: 'file',
           visibility: true,
           // The map is rendered based on the GeoJSON below
           // The GeoJSON needs to be in EPSG:3857
           json: JSON.stringify(
              {
                 "type": "Polygon",
                 "crs": {
                    "type": "name",
                    "properties": {
                       "name": "EPSG:3857"
                    }
                 },
                 "coordinates": [
                    [
                       [
                          -625570.6,
                          6465993.0,
                       ],
                       [
                          -305006.9,
                          6696510.8,
                       ],
                       [
                          -546330.2,
                          6768547.6,
                       ],
                       [
                          -445478.6,
                          7053093.0,
                       ],
                       [
                          -279794.0,
                          7056694.8,
                       ],
                       [
                          -359034.5,
                          7337638.4,
                       ],
                       [
                          -211359.0,
                          7485313.8,
                       ],
                       [
                          62380.8,
                          6955843.3,
                       ],
                       [
                          220861.7,
                          6909019.4,
                       ],
                       [
                          91195.5,
                          6700112.6,
                       ],
                       [
                          213658.1,
                          6682103.4,
                       ],
                       [
                          -625570.6,
                          6465993.0,
                       ],
                    ],
                 ],
              }
           ),
        },
     ],
  },
]
Example:
// Example of how to load a map with the XYZ source
// The XYZ source is used to load a map from a URL that contains the &lcub;z&rcub;, &lcub;x&rcub; and &lcub;y&rcub; placeholders
// The &lcub;z&rcub; is the zoom level, &lcub;x&rcub; is the longitude and &lcub;y&rcub; is the latitude
[
  {
     title: 'Map rendered by a XYZ source',
     color: '#666699',
     elements: [
        {
           title: 'Base map loaded by XYZ source',
           // The name of the map that will be added. This name must be unique
           name: 'planet:planet',
           source: 'xyz',
           // The url of the map that will be loaded. The $&lcub;z&rcub;, $&lcub;x&rcub; and $&lcub;y&rcub; placeholders will be replaced by the map library
           url: 'https://tiles.planet.com/basemaps/v1/planet-tiles/planet_medres_visual_2021-09_mosaic/gmap/$&lcub;z&rcub;/$&lcub;x&rcub;/$&lcub;y&rcub;.png?api_key=PLAK78456687760442eaa3d3da16aaac5f2d',
           visibility: true,
        },
     ],
  },
]
Defaults to 'local'
 

startLegendOpen: Boolean

               

Defines if the Legend Window should start or not. Set it to 'true' to make it start open. Set it to 'false' for it to start closed.

Example:
[
  {
     title: 'The Legend Window the Layer will start open',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer Legend Window will start open',
           name: 'CSR:geologia',
           source: 'local',
           startLegendOpen: true,
           visibility: true,
        },
     ],
  },
]
Defaults to false
 

startListed: Boolean

               

Define if the Layer should start with its Legend Window visible or not. This does not make the Layer visible on the map by itself. For that, you need to set the 'visibility' property to 'true'. 'startListed' just displays the Legend Window associated with the Layer.

Example:
[
  {
     title: 'The Legend Window of the third Layer will start visible',
     color: '#FFA500',
     elements: [
        {
           title: 'Map of the altitude in Brazil',
           name: 'CSR:altimetria',
           source: 'local',
        },
        {
           title: 'Map of the rivers in Brazil',
           name: 'CSR:rios_principais',
           source: 'local',
        },
        {
           title: 'This Layer Legend Window will start visible, but is not map',
           name: 'CSR:geologia',
           source: 'local',
           startListed: true,
        },
     ],
  },
]
Defaults to false
 

styles: String

               

Defines which styles will be applied over the maps defined at the 'name' property. The styles are applied in the same order as the maps are declared in name. For example, if there are 3 maps in the 'name' property and 3 styles. The first style will be applied to the first map, the second to the second map, and so on. You can find which styles are available to use at: TODO: Criar uma forma simplificada de visualizar os estilos disponíveis. PS: The Mappia identifier of the style is defined by the name of the layer + '_' + an index. PS2: Styles are separated by comma.

Example:
[
  {
     title: 'Example of style',
     color: '#666699',
     elements: [
        {
           name: 'CSR:precip_monthly_average,CSR:precip_monthly_average',
           // The first style 'precip_monthly_average_1' is applied to the first map 'precip_monthly_average' and the second style 'precip_monthly_average_2' is applied to the second map 'precip_monthly_average'
           styles: 'precip_monthly_average_1,precip_monthly_average_2',
           // The source needs to be calculate to apply the style
           source: 'calculate',
           visibility: true,
        },
     ],
  },
]
Example:
{
       ...,
         name: 'CSR:municipios',
         style: 'municipios_0',
       ...
  }
Example:
{
       ...,
         name: 'CSR:estados,CSR:geologia',
         style: 'estados_0,geologia_1',
       ...
  }
Defaults to string.empty
 

thumbUrl: String

               

Define the thumbnail image that is displayed when the mouse hovers the Legend Window title. You can define any image you would like to display as the map thumbnail. You just need to pass its URL.

Example:
[
  {
     title: 'Example of thumbUrl',
     color: '#FFA900',
     elements: [
        {
           title: 'There is a puppy hidden in here! Hover me! <3',
           name: 'CSR:altimetria',
           visibility: true,
           thumbUrl: 'https://fastly.picsum.photos/id/237/200/300.jpg?hmac=TmmQSbShHz9CdQm0NkEjx1Dyh_Y984R9LpNrpvH2D_U',
        },
     ],
  },
]
Defaults to undefined
 

title: String

               

Defines the Title that will be displayed at the Legend Window in the top left corner of the screen and inside the Group List at the top center of the screen.

Example:
[
  {
     title: 'The title of the Group shows up at the top center of the screen and has a List inside it.',
     color: '#FFA500',
     elements: [
        {
           title: 'The title of the Layer is shown at the Legend Window and inside the menu of the Group name.',
           name: 'CSR:capitals',
           visibility: true,
        },
     ],
  },
]
Defaults to 'layer_name' The default value is the layer name.
 

updateAutomatically: Boolean

               

Define if a Layer with the 'source' value as 'calculate' should be updated automatically after any user interactions, like changing an input value. If you’re creating a Layer with the 'source: calculate' you need to set this property to 'true' for it to render.

Example:
[
 {
   title: 'The map will be automatically calculated',
   color: '#666699',
   elements: [
     {
       title: 'This layer is showing just one type of relief',
       name: 'CSR:geologia',
       source: 'calculate',
       visibility: true,
       updateAutomatically: true,
       expression: function(layersVals, inputs) {
         // layerVals have the value of the legend applied in every pixel of the map
         let mapValue = layersVals[0];

         // Remove every type of relief that is not 'Mantiqueira'
         if(mapValue != 'Mantiqueira') { // If the pixel is not 'Mantiqueira'
             return undefined; // Don't show the pixel
         }

         // If the pixel is 'Mantiqueira', return the value of the pixel
         return mapValue;
       },
     },
   ],
 },
]
Defaults to false
 

visibility: Boolean

               

Define if the Layer should start visible or not. Set it to 'true' for the Layer start visible. Otherwise, set it to 'false' and the Layer will start hidden.

Example:
[
 {
   title: 'Example of visibility in a Layer',
   color: '#666699',
   elements: [
     {
       title: 'This layer will start visible',
       name: 'CSR:geologia',
       source: 'local',
       visibility: true,
     },
   ],
 },
]
Defaults to false
 

afterCalc: function

               

This function is executed right after the 'expression()' calculations. This function is only available for a Layer with a 'source' of type 'calculate' and that has defined the 'expression()' function. @param inputs {Array} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on).

Example:
[
  {
     title: 'Example of afterCalc function',
     color: '#FFA500',
     elements: [
        {
           title: 'This afterCalc function will show a message at the bottom right of the screen',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              {
                 type: 'query',
                 pressed: true
              },
           ],
           descriptionHtml:
              '&bsol;&lcub;&bsol;&lcub;label|text=The afterCalc is run after every expression() execution&bsol;&rcub;&bsol;&rcub;'
              +
              '&bsol;&lcub;&bsol;&lcub;textfield|fieldLabel=Enter your name|id=textInput|labelStyle=text-align:center;&bsol;&rcub;&bsol;&rcub;',
           // The expression function is mandatory to use the afterCalc function.
           expression: function(layerVals, inputs) {
              return undefined;
           },
           afterCalc: function(inputs) {
              let inputValue = inputs[0];
              ExtjsUtils.ALERTIFY.log('Hello ' + inputValue + '!');
           },
        },
     ],
  },
]
Defaults to null
 

beforeCalc: function

               

This function is executed before any calculation is made in the 'expression()' function. This function is only available for a Layer with a 'source' of type 'calculate'. Also, it’s called even if there is no definition for the 'expression()' function. @param inputs {Array} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on).

Example:
[
  {
     title: 'Example of beforeCalc function',
     color: '#FFA500',
     elements: [
        {
           title: 'This beforeCalc function will show a message at the bottom right of the screen',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              {
                 type: 'query',
                 pressed: true
              },
           ],
           descriptionHtml:
              '&bsol;&lcub;&bsol;&lcub;label|text=The beforeCalc function will be called after every user interaction before any calculation&bsol;&rcub;&bsol;&rcub;'
              +
              '&bsol;&lcub;&bsol;&lcub;textfield|fieldLabel=Enter your name|id=textInput|labelStyle=text-align:center;&bsol;&rcub;&bsol;&rcub;',
           beforeCalc: function(inputs) {
              let inputValue = inputs[0];
              ExtjsUtils.ALERTIFY.log('Hello ' + inputValue + '!');
           },
        },
     ],
  },
]
Defaults to null
 

expression: function

               

This function is executed for every pixel in the map. It can be used to process the information of all maps in the Layer to create a new one. This function is called regularly to update the map. @param layerVals {Array.<LayerValues>} Is an array that has the value associated with the current pixel for each map defined in the 'name' property. The values order is the same as the one in ‘name’. For example, if in the 'name' property we have 'name: CSR:geologia,CSR:altimetria' the layerVals[0] has the value for the 'CSR:geologia' map and the layerVals[1] has the value for the 'CSR:altimetria'. @param inputs {Array} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on).

Example:
[
  {
     title: 'Example of expression function',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer is the result of the calculation of two maps',
           name: 'CSR:geologia,CSR:altimetria',
           source: 'calculate',
           legendTitle: 'All geologys above 800m',
           visibility: true,
           expression: function(layerVals, inputs) {
              let geologyValue = layerVals[0];
              let altitudeValue = layerVals[1];

              // Hide all values lower than 800
              if (altitudeValue < 800) {
                 return undefined;
              }

              return geologyValue;
           },
        },
     ],
  },
]
Defaults to null
 

functions: Object

               

Here, you can define any function you want to handle events from the tools defined in the descriptionHtml. For example, if you want to handle the callback of a button, you can define the function for its 'handler' property here. These functions only exist in the Layer where they’re a part of. To use a function in a Tool you just need to use the function name in the property that triggers the callback. You can also access the functions using the 'this' (this.functions['<function_name>']) in any.

Example:
[
  {
     title: 'Example of functions property',
     color: '#666699',
     elements: [
        {
           title: 'Click the button to see a message',
           name: 'CSR:geologia',
           group: 'Query',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              { 
                 type:'query',
                 pressed: true,
              },
           ],
           descriptionHtml: 
              '\{\{button|id=test_button|text=Click me!|handler=handleTestButtonClick\}\}',
           functions: {
              handleTestButtonClick: function() {
                 ExtjsUtils.ALERTIFY.log('Button clicked!');
              },
           },
        },
     ],
  },
]
Defaults to null
 

legendColor: function

               

This function generates the color of each value/category of the calculated map generated by the 'expression()' function. The return value is the legend color that will be applied to the category. PS: This function callback is called in layer context. @param color {Array.<Numeric>} Array with three numbers (0 to 255) that define the RGB color of the original legend. @param inputs {Array.<Object>} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on). @param lastValue {String} The last legend value that had its color calculated. @param currentValue {String} The actual legend value that it's being calculated. @param ruleIndex {Numeric} The index of the actual legend value that it’s being calculated. I.e. The first legend value is 0, the second is 1, and so on.

Example:
[
  {
     title: 'Example of legendColor',
     color: '#666699',
     elements: [
        {
           title: 'The legendColor function will generate a custom color for each category, based on its value',
           name: 'CSR:altimetria',
           source: 'calculate',
           updateAutomatically: true,
           visibility: true,
           expression: function(layersVals, inputs) {
              return layersVals[0];
           },
           // This create a custom colors palette for the legend of the result map from the 'expression' function
           legendColor: function(color, inputs, lastValue, currentValue, ruleIndex) {
              let red = 0;
              let green = currentValue * 255 / 1830;
              let blue = 0;
              
              return [red, green, blue];
           },
        },
     ],
  },
]
 

onInputsReady: function

               

This function is called when all inputs have been loaded and are ready. Even from Layers that aren’t visible. @param inputs {Array} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on).

Example:
[
  {
     title: 'Example of onInputsReady function',
     color: '#666699',
     elements: [
        {
           title: 'This Layer shows the starting value of the text input field',
           name: 'CSR:geologia',
           group: 'Query',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              { 
                 type:'query',
                 pressed: true,
              },
           ],
           descriptionHtml: 
              '\{\{textfield|id=textInput|fieldLabel=Message|value=I love maps!|labelStyle=text-align:center;\}\}',
           onInputsReady: function(inputs) {
              let textInputValue = inputs[0];
              ExtjsUtils.ALERTIFY.log('The text input initial value is: ' + textInputValue);
           },
        },
     ],
  },
]
Defaults to null
 

onVisibilityChange: function

               

This function is called whenever a Layer changes its visibility. Like, when the user toggle the value in the visibility button at the top right in the Legend Window. @param visibility {Boolean} It’s true if the Layer is visible or false otherwise. @param inputs {Object} The value of each input defined in the descriptionHtml. The order of the values is the same as the inputs (i.e. the first input in the descriptionHtml is inputs[0], the second is inputs[1] and so on).

Example:
[
  {
     title: 'Example of callback when changing the visibility',
     color: '#FFA500',
     elements: [
        {
           title: 'The function onVisibilityChange will be called when the visibility of this layer changes.',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              {
                 type:"query",
                 pressed: true
              },
           ],
           descriptionHtml:
              '\{\{label|text=You can change the map visibility by clicking at the eye icon on the top of this window\}\}',
           onVisibilityChange: function(state, inputs) {
              if(state) {
                 ExtjsUtils.ALERTIFY.log('The layer is now visible');
              }
              else {
                 ExtjsUtils.ALERTIFY.log('The layer is now hidden');
              }
           },
        },
     ],
  },
]
Defaults to null

Groups

A Group is a set of Layers. You can defined the Layers of a Group inside its 'elements' property as described in the 'Groups Properties' section.
When you define a Group, a sub menu is created at the top of the screen.That sub menu has all the Layers defined inside the Group.
It's possible to define as many groups as you want. You simply need to create a pair of open and closed curly brackets, separated by commas:
[
   {
      title: 'My first Group!',
      color: '#A020F0',
      elements: [
         {
            title: 'Layer 1 of group 1',
            name: 'CSR:batimetria',
            visibility: true,
         },
      ],
   },
   {
      title: 'My second Group!!',
      color: '#FFA900',
      elements: [
         {
            title: 'Layer 1 of group 2',
            name: 'CSR:altimetria',
            visibility: true,
         },
      ],
   },
]
 

color: String

               

Defines the Color of the group. This is the Color of the Title and some elements inside the sub menu on the top of the screen.

Example:
[
   {
      title: 'My orange group',
      color: '#FFA500',
   },
]
Defaults to string.empty
 

defaultProperties: function()

               

Specifies properties that apply universally to all layers within a group, including nested subgroups and their respective layers. Priority is determined by specificity: a property defined at the layer level takes precedence, followed by properties defined in the nearest group, and so forth.

Example:
[
  {
     title: 'Example of defaultProperties',
     color: '#FFA500',
     defaultProperties: {
        source: 'local',
        visibility: true,
        opacity: 0.7,
     },
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:geologia',
        },
        {
           title: 'Layer 2',
           name: 'CSR:rios_principais',
        },
        {
           title: 'Layer 3',
           name: 'CSR:estados',
           // Any internal redefinition will override the defaultProperties
           visibility: false,
        },
     ],
  },
]
Defaults to {}
 

elements: Array.<Layers>

               

Defines the Layers that will be part of the Group. Each Layer can have multiple maps inside it. All maps inside a Layer will be shown together when that Layer is enabled. Besides that, all informations about those maps can be used to calculate a new one using custom functions that can be writen in JavaScript.

To learn more about Layers and it’s properties, check their documentation at: Layer Section.

Example:
[
  {
     title: 'A group with Layers!',
     color: '#FFA500',
     elements: [
        // Define your Layers here
     ],
  },
]
Defaults to Array.empty
 

openGroup: Boolean

               

Defines if the 'viewTitle' should start opening or collapse. Set it to 'true' for the 'viewTitle' start open or 'false' for it to start closed. This property only applies to a group that has the 'viewTitle' property defined. If the Group View has any visible Layers or any Layer has the 'openGroup' property set to 'true', the Group View will start open.

Example:
[
  {
     viewTitle: 'This Group View will start opened',
     viewColor: '#FFFFFF',
     title: 'Group 1',
     color: '#666699',
     openGroup: true,
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:estados',
           source: 'calculate',
           startListed: true,
        },
     ],
  },
  {
     viewTitle: 'This Group View will start closed',
     viewColor: '#FFFFFF',
     title: 'Group 2',
     color: '#666699',
     elements: [
        {
           title: 'Layer 2',
           name: 'CSR:rios_principais',
           source: 'calculate',
           startListed: true,
        },
     ],
  },
]
Defaults to false
 

title: String

               

Defines the Title of the group. The Title is shown at the sub menu on the top of the screen.

Example:
[
   {
     title: 'My new group!',
   },
]
Defaults to string.empty
 

viewTitle: String

               

Define the Title of the View that will gather together the elements inside it (Groups or other Views). If an external View has in its elements another definition of a 'viewTitle', subviews will be created, like in the second example.

Example:
// Exemple 1: View with a Layers inside it
[
  {
     viewTitle: 'This View has a Group 3 Layers',
     title: 'This is a Group with 3 Layers',
     color: '#5BA300',
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:estados',
           source: 'local',
           opacity: 0.5,
           visibility: true,
        },
        {
           title: 'Layer 2',
           name: 'CSR:rios_principais',
           source: 'local',
           opacity: 0.5,
           visibility: true,
        },
        {
           title: 'Layer 3',
           name: 'CSR:geologia',
           source: 'local',
           opacity: 0.65,
           visibility: true,
        },
     ],
  },
]
Example:
// Exemple 2: View with others 'viewTitle' defined inside it
[
  {
     // This is the definition of the View
     viewTitle: 'This External View has 2 others Inner Views inside it, each with 1 Group that has 1 Layer',
     title: 'This View has 2 Groups, each with 1 Layer',
     color: '#0073E6',
     elements: [
        {
           title: 'Group 1',
           // This 'viewTitle' will create a division in the menu that shows when the mouse hovers the navigation bar option 'This View has 2 Groups, each with 1 Layer' 
           viewTitle: 'Inner View with Group 1',
           color: '#E6308A',
           elements: [
              {
                 title: 'Group 1 - Layer 1',
                 name: 'CSR:altimetria',
                 source: 'local',
                 visibility: true,
              },
           ],
        },
        {
           title: 'Group 2',
           // This 'viewTitle' will create a division in the menu that shows when the mouse hovers the navigation bar option 'This View has 2 Groups, each with 1 Layer'
           viewTitle: 'Inner View with Group 2',
           color: '#B51963',
           elements: [
              {
                 title: 'Group 2 - Layer 1',
                 name: 'CSR:batimetria',
                 source: 'local',
                 visibility: true,
              },
           ],
        },
     ],
  },
]
Defaults to string.empty
 

onClickViewGroup: function

               

This function is called whenever the user clicks the 'viewTitle' text. PS: view.expanded is 'True' when thee View its openned or 'False' otherwise. @param view {Object} Is the view that was clicked @param clickEvent {MouseEvent} Is the object that carries more information about the click event.

Example:
[
  {
     viewTitle: 'Example View (Click me!)',
     viewColor: '#FFA500',
     title: 'Click the view to change its state',
     color: '#666699',
     openGroup: true,
     onClickViewGroup: function handleClickViewGroup(view, clickEvent) {
        let viewState = (view.expanded ? 'open' : 'closed');
        ExtjsUtils.ALERTIFY.log('The ' + view.text + ' is ' + viewState );
     },
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:estados',
           source: 'local',
           startListed: true,
        },
     ],
  },
]
Defaults to null
 

onToggleViewGroup: function

               

This function is called whenever the state of the group view changes. I.e. when the view is collapsed or expanded. PS: view.expanded is 'True' when thee View its openned or 'False' otherwise. @param view {Object} Is the view that has its state changed

Example:
[
  {
     viewTitle: 'Example View (Click me!)',
     viewColor: '#FFA500',
     title: 'Click the view to change its state',
     color: '#666699',
     openGroup: true,
     onToggleViewGroup: function handleToggleViewGroup(view) {
        let viewState = (view.expanded ? 'open' : 'closed');
        ExtjsUtils.ALERTIFY.log('The ' + view.text + ' is ' + viewState );
     },
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:estados',
           source: 'local',
           startListed: true,
        },
     ],
  },
]
Defaults to null

Tools

Tools that can be used to create interactions or load data to the application, they must be used in descriptionHtml and its parameters should be passed preceded by vertical bars. 
Examples:
{
    ...,
    descriptionHtml: '\{\{toolIdentifier|paramName=paramValue\}\}',
    ...
}

{
    ...,
    descriptionHtml: '\{\{button|id=btn_id|enableToggle=false\}\}' + '\{\{opacityslider\}\}',
    ...
}
 

enableToggle: Boolean

               

Defines the button type as toggle. Set true to use as toggle, false otherwise. PS: When its true the callback is 'toggleHandler', otherwise the callback is 'handler'.

Example:
|enableToggle=true|
Defaults to false
 

fieldLabel: String

               

Defines the button label.

Example:
|fieldLabel=A button|
 

handler: function

               

Defines the callback function on button click event. This should be used when the enableToggle property is false. @param button {Ext.Button} The button element that was clicked. @param clickEvent {EventObject} An event object carrying information about the click event.

Example:
|handler = function (button, clickEvent){
 console.log(button, clickEvent);
}|
Defaults to undefined
 

id: String

               

Defines the id to identify the object.

Example:
|id=exemple_button|
 

pressed: Boolean

               

Defines the button initial state. Set it true to start pressed (only if enableToggle = true), false otherwise.

Example:
|pressed=true|
Defaults to false
 

text: String

               

Defines the button text.

Example:
|text=Click On Me|
 

toggleHandler: function

               

Defines the callback function on button toggle event. This should be used when the enableToggle property is true. @param button {Ext.Button} The button element that was clicked. @param state {Boolean} The next state of the button, true means pressed.

Example:
|toggleHandler = function (button, pressed){
 console.log(button, pressed);
}|
Defaults to undefined
 

data: Array.<Array.<String>>

               

Defines the data that will be displayed in the Combobox.

Example:
|data = [["Val_1"], ["Val_2"],..]|
Defaults to undefined
 

editable: Boolean

               

Determines if the Combobox is editable. That is, if it allows the user to type inside the input field. Set it true to allow it, false otherwise.

Example:
|editable=true|
Defaults to false
 

fieldLabel: String

               

Defines a label for the Combobox. It will be shown at the left of the Combobox, by default.

Example:
|fieldLabel=This is the field label|
 

hideLabel: Boolean

               

Defines if the label of the Combobox should be displayed. Set true to hide the label, false to show it.

Example:
|hideLabel=true|
Defaults to false
 

id: String

               

Defines the id to identify the object.

Example:
|id=legend_combobox|
 

labelStyle: String

               

Defines the style of the label. You can use CSS to style the label element.

Example:
|labelStyle=font-weight: bold; color: red;|
 

checked: Boolean

               

Defines if the hoverPixel should start enabled. Set true to start enabled, false otherwise.

Example:
|checked = true|
Defaults to false
 

fieldLabel: String

               

Define the text that will be displayed at the left of the toggler

Example:
|text=This is the label text|
 

hideLabel: Boolean

               

Defines if the label of the HoverPixel should be displayed. Set true to hide the label, false to show it.

Example:
|hideLabel=true|
Defaults to false
 

id: String

               

Defines the id to identify the object.

Example:
|id=exemple_hover_pixel|
 

labelStyle: String

               

Defines the style of the label at the HoverPixel toggler. You can use CSS to style the label element.

Example:
|labelStyle=font-weight: bold; color: red;|
 

runOnClick: function

               

Defines a callback when the user clicks on the map. It passes the following parameters for the callback function: handleOnClick(layerVals, inputs, coordinates, clickEvent, lastCoordinates) @param layerVals {Array} Array with the values of the maps at the pixel that was clicked. @param inputs {Array} Array with the values of the inputs defined in the descriptionHtml. @param coordinates {Object} Array with the coordinates (latitude, longitude) of the pixel that was clicked. coordinates = { lat: // Latitude of the pixel that was clicked lon: // Longitude of the pixel that was clicked } @param clickEvent {MouseEvent} Mouse event that triggered the function. @param lastCoordinates {Object} Object with the last coordinates (latitude, longitude) from the last click and the last hover events. lastCoordinates = { click: { lat: // Latitude of the last click lon: // Longitude of the last click }, hover: { lat: // Latitude of the last hover lon: // Longitude of the last hover } }

Example:
|handleOnClick: function(layerVals, inputs, coordinates, clickEvent, lastCoordinates) {
     ExtjsUtils.ALERTIFY.log("Latitude: " + coordinates.lat + " Longitude: " + coordinates.lon);
}|
Defaults to undefined
 

runOnClickOutside: function

               

True to run the callback function even when clicking outside of the layer, False to disable. (Default False)

 

runOnHover: function

               

Defines a callback when the user hovers the map. It passes the following parameters for the callback function: handleOnClick(layerVals, inputs, coordinates, clickEvent, lastCoordinates) @param layerVals {Array} Array with the values of the maps at the pixel that was hovered. @param inputs {Array} Array with the values of the inputs defined in the descriptionHtml. @param coordinates {Object} Array with the coordinates (latitude, longitude) of the pixel that was hovered. coordinates = { lat: // Latitude of the pixel that was hovered lon: // Longitude of the pixel that was hovered } @param mouseMoveEvent {MouseEvent} Mouse event that triggered the function. @param lastCoordinates {Object} Object with the last coordinates (latitude, longitude) from the last click and the last hover events. lastCoordinates = { click: { lat: // Latitude of the last click lon: // Longitude of the last click }, hover: { lat: // Latitude of the last hover lon: // Longitude of the last hover } }

Example:
|handleOnHover: function(layerVals, inputs, coordinates, mouseMoveEvent, lastCoordinates) {
     ExtjsUtils.ALERTIFY.log("Latitude: " + coordinates.lat + " Longitude: " + coordinates.lon);
}|
Defaults to undefined
 

runOnHoverOutside: function

               

True to run the callback function even when hovering outside of the layer, False to disable. (Default False)

 

text: String

               

Define the text that will be displayed at the right of the toggler

Example:
|text=This is the example text|
 

filterLayers: Array.<Number>

               

Defines an array of indexes of layers to be included in map legend (from 0 to quantity of layers). If not defined, all layer legends are shown by default. Otherwise, only the listed indexes are included. Ex: A composed layer with three maps: name: "CSR:estados,CSR:roads,CSR:municipalities", If 'filterLayers=[0,1]' is defined in the layer object only the legends of 'CSR:estatdos' and 'CSR:roads' are shown.

Example:
|filterLayers = [1,2]|
Defaults to null
 

legendId: String

               

Defines the legend container id. You can use this id to toggle each legend filter individually.

Example:
|legendId=WIDGET_OBJECT_ID|
Defaults to null
 

preventClick: Boolean

               

Defines if the user can filter the maps categories by clicking on the legend. Set it true to ignore the legend click, false otherwise.

Example:
|preventClick = true|
Defaults to false
 

reverseLegend: Boolean

               

Defines if it should sort the legend on the decreasing order. Set it true to use the decreasing order, false otherwise.

Example:
|reverseLegend = true|
Defaults to false
 

columnNameToInd: function(columnName) : Number

               

Get the index of a column with the 'columnName' name. @param columnName {String} Column name to search for.

 

getLines: function(columns, values) : Array

               

Get all lines that 'column' has the value equals to 'value'. PS: To use the 'column' as index, it must be numeric, when the 'column' is a text the index is searched on header by its name. PS2: To filter multiple column each value and index one must be added to the 'columns' and 'values' arrays. Ex: ([1,4,2], ["FIRST_COLUMN_VALUE","FORTH_COLUMN_VALUE", SECOND_COLUMN_VALUE]) @param columns {Array} (Optional) Array of indexes/names of the filtered columns. @param values {Array} {Opcional) Array of values to match each column.

 

getValue: function(column, line, includeHeader) : String

               

Get a value by the matrix index and column. @param column {Number} Column index (First index is 0). @param line {Number} Line index (First index is 0). @param includeHeader {boolean} True to include the header line in the matrix index, False to ignore.

 

setValue: function(column, line, value)

               

Change a cell value by its cell index. @param column {Numeric} Column index. @param line {Numeric} Line index to change (ignore the header information when it exists). @param value {*} New value to replace the older value.

 

backgroundColors: Array.<String>

               

Array of colors of background slider values, to define background slider color based in slider value. The values are defined from most to minimum with two properties each: - color: {String} CSS color definition for the current interval. i.e. 'red','black','#FF0000', '#000000'. - startValue: {Numeric} If defined define the initial value which above will apply this color, otherwise use theminimum slider value as default. Ex.: backgroundColors: [ { // Define background color to red when slider has value above 75. color: "red", startValue: 75 }, { // Define background color starting from value 0. // That results two intervals, from 0 to 75 as blue, and from 76 to 100 as red. color: "blue", startValue: 0 } ]

 

id: String

               

Defines the id to identify the object.

Example:
|id=example_slider|
 

increment: Number

               

Defines the step of each increment or decrement in the actual value of the slider when being dragged.

Example:
|increment = 10|
 

maxValue: Number

               

Defines the maximum value of the slider.

Example:
|maxValue = 100|
 

minValue: Number

               

Defines the minimum value of the slider.

Example:
|minValue = 0|
 

value: Number

               

Defines the initial value of the slider.

Example:
|value = 100|
 

values: Array.<Number>

               

Defines the slider interval limits. If defined, the slider will be displayed as a range slider. It's return at the 'inputs' parameter will be a array of two values.

Example:
|values = [0, 250]|
Example:
|beforeCalc: function(inputs) {
   let lowerValue = inputs[0][0]; // The value of the left drag
   let upperValue = inputs[0][1]; // The value of the right drag
}|
 

fieldLabel: String

               

Defines the TextField label.

Example:
|fieldLabel = This is the field label|
 

hideLabel: Boolean

               

Defines if it should completely hide the label element (label and separator) of the TextField. That is, if this property is set to true, the label will be hidden. Otherwise, the label will be shown by default. PS: Since the label will be shown by default, even if you do not specify a fieldLabel, the space for it will still be reserved so that the TextField will line up with other fields that do have labels. This space will be removed if you define it to be hidden.

Example:
|hideLabel = true|
Defaults to false
 

id: String

               

Defines the id to identify the object.

Example:
|id=example_text_field|
 

isnumeric: boolean

               

Defines the TextField content as numeric only.

Example:
|isnumeric=true|
 

style: String

               

Defines the TextField style properties. You can use CSS style rules to customize it.

Example:
|style = color:black;|
 

value: String

               

Defines the initial value to the TextField content.

Example:
|value = text|
 

checked: Boolean

               

Defines if Pickpoint should start selected. Set it true to start it enabled, false otherwise.

Example:
|checked = false|
Defaults to false
 

fieldLabel: String

               

Sets the label for the 'pickpoint' button widget.

Example:
'Pick a point coordinate (Lat,Lon)'
 

geometryColor: String

               

If defined sets a color to use when drawing a geometry by this tool. Otherwise a random color will be used at each interaction.

Example:
|geometryColor=#FF00FF|
Defaults to undefined
 

markLayerInd: Number

               

Defines by layer index which one to draw its geometry when a click event happens. (0-indexed)

Example:
|markLayerInd = 0|
 

notify: Boolean

               

Set false to prevent the notify messages from appear.

Defaults to false
 

onMark: function

               

Callback function called after clicking on a feature with this 'pickpoint' widget. P.S.: From 'this' keyword you can access the pickpoint properties. @param eventAndProperties {Object} A object with {mouse, features} passed into the callback function: - mouse: {PointerEvent} The mouse click event. - features: {Array<Object>} An array of features representing the selected(s) feature(s).

Example:
{ ...
 "descriptionHtml": "\{\{pickpoint|id=ANY_UNIQUE_ID|onMark=onMarkCallback\}\}",
  functions: {
    onMarkCallback: function(event) {
      for (var iLayer=0; iLayer < event.features.length; iLayer++) {
        for (var iFeature=0; iFeature < event.features[iLayer].length; iFeature++) {
          console.log(event.features[iLayer][iFeature].data);
        }
      }
    }
  }
 ...
 }
 

onefeature: boolean

               

Defines if PickPoint should keep only the last feature selected. Set it true to keep only the last one, false otherwise.

Example:
|onefeature = false|
 

pointVisibility: Boolean

               

Defines if Pickpoint should show where the last click was. Set it true to show, false otherwise.

Example:
|pointVisibility = false|
Defaults to true
 

runOnHover: function

               

Defines a callback function to run when clicking at the map. Defines a callBack with following parameters function(mouseEvt, coordinates) --mouseEvt: {MouseEvent} Mouse hover event. --coordinates: {Openlayers.LatLon} Coordinate of the cursor over the map. PS: Can access the layer itself using the 'this' keyword.

 

runOnHoverOutside: function

               

True to run the callback function even when hovering outside of the layer, False to disable. (Default False)

 

unselect: Boolean

               

Set false to unselect after click on the geometry.

Example:
|unselect=|
Defaults to true
 

fieldLabel: String

               

Defines a label for the Timeline. It will be shown at the left of the button to hide the tiemline, by default.

Example:
|fieldLabel=This is the field label|
 

hideLabel: Boolean

               

Defines if the label of the timeline should be displayed. Set true to hide the label, false to show it.

Example:
|hideLabel=true|
Defaults to false
 

id: String

               

Defines the id to identify the object.

Example:
|id=exemple_timeline|
 

nextStepInterval: Number

               

Defines the duration of the interval between steps of the timeline in milliseconds.

Example:
|nextStepInterval=1000|
Defaults to 2100
 

onPlayToggle: function

               

Defines the callback function called when the timeline starts/stops playing. @param pressed {Boolean} True if the button was pressed, False otherwise. @param layer {Object} The layer associated to this timeline. @param timeline {Object} The timeline associated. @param playBtn {Object} The button changed.

Example:
|onPlayToggle = function (pressed, layer, timeline, playBtn) {
     let text = "The timeline just ";
     text += pressed ? "stopped " : "started ";
     text += "playing!";
     console.log(text);
}|
 

preloadTiles: Boolean

               

Defines if the timeline should preload the tiles of the next steps to get smoother transitions. Set it true to preload, false otherwise.

Example:
|preloadTiles = true|
Defaults to false
 

renderHidden: Boolean

               

Defines the timeline initial visibility. Set it true to start with the timeline hidden, false otherwise.

Example:
|renderHidden = true|
Defaults to false
 

steps: Array.<Array.<(String|Object)>>

               

Defines the timeline change steps.

Example:
|steps=[["step_0"], ["step_1"], ["step_2"]]|
Example:
|steps=[['Nome', {style:"step_0_style",name:"CSR:estados"}], ['Região', {style:"step_1_style",name:"CSR:estados"}], ['Geocódigo', {style:"step_2_style",name:"CSR:estados"}]]|
Example:
|steps=[['Nome', 'step_0'], ['Região', 'step_1'], ['Geocódigo', 'step_2']]|
Example:
|steps=[{1990: "layer_style0", 1991: "layer_style1", 1992: "layer_style2"}, 1993: "layer_style3"}]|
 

forceRecalc: function()

               

Force a legend map recalculation.

 

getValue: function(key) : *

               

Get the stored value by his property name, if it does not exists returns null. @param key {String} Stored property name.

 

setValues: function(obj, cancelUpdate, local)

               

Stores object properties for later usage. PS: If has name property collision the older is replaced. @param obj {Object} Object with the properties to be stored. @param cancelUpdate {Boolean} False if this change must cause layer recalculation, True otherwise. @param local {Boolean} True to store the property locally, False otherwise. The local properties aren't sent to 'expression' calbacks. (i.e. If a element is recursive or have DOM elements, it must local avoid stringify errors on 'expression' callbacks)

 

eventNames: Array.<string>

               

Defines the list of events by name. Use this property to define callback functions to any of the following events.

Example:
['added', 'afterrender', 'beforedestroy', 'beforehide', 'beforerender', 'beforeshow', 'beforestaterestore',
'beforestatesave', 'blur', 'change', 'destroy', 'disable', 'enable', 'focus', 'hide', 'invalid', 'move', 'removed', 'render',
'resize', 'show', 'specialkey', 'staterestore', 'statesave', 'valid']
 

ignoreUpdate: Boolean

               

Defines if it should ignore the widget change event. If it's false, it dispatches the update event at every file selection.

Defaults to false
 

description: function(name, config, layer, parameters) : Ext.Container

               

Creates an input of summatory in any arbitrary area. CallBack parameters (context {OpenLayers.Layer}, layersValues {Array[Number]}, inputs {[Object]}, feature {Geometry}) runOnClick {Function} Callback called exactly after sum the map region., PS: 'layersValues' return the sum of each internal layer and an adittional value which is the sum of all pixels of resulting layer. @param name {String} Input name "summedarea". @param config {Object} Properties to customize the element. @param layer {OpenLayers.Layer} Layer which the widget is defined. @param parameters {Array} Array de parametros antes do processamento para o input.

 

btnID: String

               

Defines the id of the button that controls the window visibility.

Example:
|btnID = window-button-id|
 

height: number

               

Defines the floating window initial height.

Example:
|height = 600px|
 

id: String

               

Defines an id for the div contained in the floating window (where the content can be drawn).

Example:
|id = window-div-id|
 

ignoreVisibility: Boolean

               

Defines if the window should ignore the layer visibility state. By default, the window visibility state is the same as the layer's. Set true to ignore the layer visibility state, false otherwise. PS: The 'ignoreVisibility' is not compatible with the 'associatedButtonID' property. When both are used together, the ignoreVisibility value is ignored.

Example:
|ignoreVisibility = false|
 

onBeforeHide: function

               

Defines a callback function to be called before hiding the floating window. @param layer {Object} Scope of the layer @param data {Array} [window, button, windowConfig] window: Window object; button: Button created; windowConfig: Window object configuration

Example:
|onBeforeHide = function (layer, [window, button, windowConfig]){
 console.log(layer);
 console.log([window, button, windowConfig]);
}|
 

resize: function

               

Defines the callback function to be called when the floating window is resized.

Example:
|resize = function (){
 console.log("I was resized!");
}|
 

startVisible: Boolean

               

Defines if the window should start visible or not. Set true if it should, false otherwise.

Example:
|startVisible = false|
 

text: string

               

Defines the window button text.

Example:
|text = I am a button|
Defaults to Show/Hide Window
 

title: String

               

Defines the floating window's title.

Example:
|title = Title of the Window|
Defaults to Window
 

underButtons: Boolean

               

Defines where the floating window will be positioned in relation to the buttons panel. Set true to position the window under the right buttons panel, false otherwise.

Example:
|underButtons = false|
 

width: number

               

Defines the floating window initial width.

Example:
|width = 600px|
 

windowID: String

               

Defines the window id.

Example:
|windowID = window-id|
 

x: Number

               

Defines the initial absolute X position of the window. PS: Can be overwritten if defined together with 'underButtons' property.

 

y: Number

               

Defines the initial absolute Y position of the window. PS: Can be overwritten if defined together with 'underButtons' property.

paramsButtonConfig

The paramsButtonConfig property is an array of objects that manage the layer menu buttons at the top right of the Legend Window. Each object in the array can have the following properties and functions:
 

hideBottomButton: Boolean

               

Define if should hide the buttons at the bottom of the Legend Window. I.e. "Exibir Consulta" e "Exibir Legenda". Set it to 'true' to hide those buttons or 'false' to display them.

Example:
[
  {
     title: 'Example of paramButtonConfig hideBottomButton property',
     color: '#FFA500',
     elements: [
        {
           title: 'The buttons at the bottom of the screen are hidden',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=There are no buttons in here\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 hideBottomButton: false,
              },
           ],
        },
     ],
  },
]
Defaults to false
 

hideButton: Boolean

               

Define if the associated button should be hidden. Set it to 'true' to hide the button or 'false' to show it. This property only applies to the type: 'query'

Example:
[
  {
     title: 'Example of paramButtonConfig hideButton property',
     color: '#FFA500',
     elements: [
        {
           title: 'The query button in hidden',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              { 
                 type: 'query',
                 hideButton: true,
              },
           ],
        },
     ],
  },
]
Defaults to false
 

iconCls: String

               

Define a class that will be added to the html in the associated button. This class can be one that has a image on it like: - 'gxp-icon-togglevisibility' is the icon of the Show/Hide Map Button (The first icon on the Legend Window, from left to right) - 'gxp-icon-removelayers' is the icon of the Remove Layer Button (The second icon on the Legend Window, from left to right) - 'gxp-icon-parameters-expand' is the icon of the Show Query Button (The third icon on the Legend Window, from left to right) - 'gxp-icon-legend-expand' is the icon of the Show Legend Button (The forth icon on the Legend Window, from left to right) - 'gxp-icon-downloadmapbutton' is the icon of the Download Button (The fifth icon on the Legend Window, from left to right)

Example:
[
  {
     title: 'Example of paramButtonConfig iconCls property',
     color: '#A020F0',
     elements: [
        {
           title: 'The query button is the download icon:',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=Here is the query region\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 tooltip: 'This is actually the query button',
                 // Here you can add any class you choose
                 iconCls: 'gxp-icon-downloadmapbutton',
              },
           ],
        },
     ],
  },
]
Defaults to string.empty
 

pressed: Boolean

               

Defines if the button should start pressed or not. Set it to 'true' for it to start pressed or 'false' for start unpressed. For example, the 'query' button type set as pressed will display the Query region (where the descriptionHtml content is) by default instead of the Legend region. This property applies only to the types: 'query',

Example:
[
  {
     title: 'Example of paramButtonConfig pressed property',
     color: '#A020F0',
     elements: [
        {
           title: 'The param button config set the query button to be pressed at the start',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=The region of the descriptionHtml will start opened\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 pressed: true,
              },
           ],
        },
     ],
  },
]
Defaults to false
 

toggleGroup: String

               

Defines a group for all the buttons that has the same toggleGroup name. From all the buttons on the same group, only one can be active at each time. Whenever another one is activated the previous one collapses.

Example:
[
  {
     title: 'Example of paramButtonConfig toogleGroup',
     color: '#FFA500',
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=This is the description of Layer 1. Only one can be open each time.\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 toggleGroup: 'Group1',
              },
           ],
        },
        {
           title: 'Layer 2',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=This is the description of Layer 2. Only one can be open each time.\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 toggleGroup: 'Group1',
              },
           ],
        },
        {
           title: 'Layer 3',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=This is the description of Layer 3. Only one can be open each time.\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 toggleGroup: 'Group1',
              },
           ],
        },
     ],
  },
]
Defaults to string.empty
 

tooltip: String

               

Defines the help tooltip text that is displayed when the mouse hover the associated button.

Example:
[
  {
     title: 'Example of paramButtonConfig tooltip property',
     color: '#A020F0',
     elements: [
        {
           title: 'The query button is the third of the buttons at the right:',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           descriptionHtml:
              '\{\{label|text=Hover the query button. That is the third button from left to right.\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 pressed: true,
              },
           ],
        },
     ],
  },
]
Defaults to string.empty
 

type: String

               

Define which button will be affected by the configurations. The type can be one of the following: - 'query': The query button is the one with sum, subtraction, division and multiplication signs. This button shows or hides the Query region (where the descriptionHtml is placed). - 'download': The download button is the one with a downward arrow. This button allows the user to download the dataset. It also defines which Layer should be downloaded when more than one Layer is shown by its internal layer index. - 'metadata': The metadata button is the one with a script icon. This button displays a popup with more information about the maps used in the actual Layer. You can make it show one of the inside composite Layer by his index. - 'associated': Creates a custom button that is linked to another button defined in the descriptionHtml. When one is pressed the other is also pressed. If the paramButtonsConfig has only one Object inside it and it doesn't have a type, its type will be query. PS: The properties are aditional, so the common must always be present, and for each type his corresponding property must be added.

Example:
// Example on how to use the query type paramsButtonConfig
[
  {
     title: 'Example of paramButtonConfig types',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has custom buttons on the Legend Window',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           startLegendOpen: true,
           descriptionHtml:
              '\{\{label|text=The third button is the Query type\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 tooltip: 'This is the query button',
                 pressed: true,
                 handler: function handleClick(button, clickEvent)  {
                    ExtjsUtils.ALERTIFY.log('You\'ve clicked the query button');
                 },
              },
           ],
        },
     ],
  },
]
Example:
// Example on how to use the metadata type paramsButtonConfig 
[
  {
     title: 'Example of paramButtonConfig types',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has custom buttons on the Legend Window',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           startLegendOpen: true,
           descriptionHtml:
              '\{\{label|text=The third button is the metadata type\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 pressed: true,
              },
              { 
                 type: 'metadata',
                 tooltip: 'This is the metadata button',
                 handler: function handleClick(button, clickEvent)  {
                    ExtjsUtils.ALERTIFY.log('You\'ve clicked the metadata button');
                 },
              },
           ],
        },
     ],
  },
]
Example:
// Example on how to use the download type paramsButtonConfig 
[
  {
     title: 'Example of paramButtonConfig types',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has custom buttons on the Legend Window',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           startLegendOpen: true,
           descriptionHtml:
              '\{\{label|text=The last  button is the download type\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 pressed: true,
              },
              { 
                 type: 'download',
                 tooltip: 'This is the download button',
                 handler: function handleClick(button, clickEvent)  {
                    ExtjsUtils.ALERTIFY.log('You\'ve clicked the download button');
                 },
              },
           ],
        },
     ],
  },
]
Example:
// Example on how to use the associated type paramsButtonConfig
[
  {
     title: 'Example of paramButtonConfig types',
     color: '#FFA500',
     elements: [
        {
           title: 'This Layer has custom buttons on the Legend Window',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           startLegendOpen: true,
           descriptionHtml:
              '\{\{label|text=The third button is the associated type\}\}'
              +
              '\{\{button|id=test_button|text=This is the custom associated button|enableToggle=true\}\}',
           paramsButtonConfig: [
              { 
                 type: 'query',
                 pressed: true,
              },
              { 
                 type: 'associated',
                 tooltip: 'This is the custom button',
                 associatedButtonID: 'test_button',
                 // The handler only triggers for the Legend Window button (not the descriptionHtml associatedButton)
                 handler: function handleClick(button, clickEvent)  {
                    ExtjsUtils.ALERTIFY.log('You\'ve clicked the custom button');
                 },
              },
           ],
        },
     ],
  },
]
Defaults to 'query'
 

handler: function(button, clickEvent)

               

Defines a function that will be called when the associated button is clicked. @param button {Object} is the button that was clicked by the mouse. @param clickEvent {MouseEvent} is the object that carries more information about the click event.

Example:
[
  {
     title: 'Example of callback when clicking in a Legend Window button',
     color: '#A020F0',
     elements: [
        {
           title: 'The handleClick function will be called when the query button is clicked',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              { 
                 type: 'query',
                 handler: function handleClick(button, clickEvent) {
                    ExtjsUtils.ALERTIFY.log('You clicked the query button');
                 },
              },
           ],
        },
     ],
  },
]
 

toggleHandler: function(button, state)

               

This function is called whenever the associated button change its toggle state. PS: Using custom function, ignore the associatedButtonID "It doesnt have to even exists". @param button {Ext.Button} The button element that was clicked @param state {Boolean} The next state of the button, true means pressed

Example:
[
  {
     title: 'Example of paramButtonConfig toogleHandler',
     color: '#FFA500',
     elements: [
        {
           title: 'Layer 1',
           name: 'CSR:geologia',
           source: 'calculate',
           visibility: true,
           paramsButtonConfig: [
              { 
                 type: 'query',
                 toggleHandler: function handleToggle(button, state) {
                    let queryButtonState = state ? 'pressed' : 'unpressed';
                    console.log(`Layer 1 query button is: ${queryButtonState}`);
                 },
              },
           ],
        },
     ],
  },
]
Defaults to null

Sharing Maps

You can share the Queries you create with Mappia through public links.
To save your Query, you need to login at Mappia. Then hover the 'Query' button at the top left, define the name for the Query and, at last, click 'Salvar'.
A 'queryId' will be generated for your custom Query. You can open any saved Query by passing the 'queryId' at the Mappia URL, like this: 'https://maps.csr.ufmg.br/calculator/?queryid=<insert_your_query_id_number>'.
All Queries are saved publicly and can be accessed by anyone, but only the creator can update it.
// Example link for sharing a map just with its visualization
https://maps.csr.ufmg.br/calculator/?queryid=473

// Example link for sharing a map with its Query visible
https://maps.csr.ufmg.br/editor/?queryid=473
 

extent: Array.<Number>

               

Defines in which part of the world the map will start on load. The extents must be in EPSG:4326 (coordinates in lat,long). Also, the values need to be in the order: minX, minY, maxX, maxY, separated by comma with no spaces between them.

Example:
// Example of query in visualization mode
// This extents start the map center at Japan
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&extent=122,24,153,45
Example:
// Example of query in edit mode
// This extents will display the whole world
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&extent=-180.0000,-90.0000,180.0000,90.0000
Defaults to [-443.628,-16.847,-407.373,3.294]
 

lang: String

               

Define in which language the Mappia default messages and texts will be displayed. Actually, Mappia supports the following languages: - Portuguese (Brazil): pt - English: eng

Example:
// Example of query in visualization mode
// The default text will be displayed in portuguese
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&lang=pt
Example:
// Example of query in edit mode
// The default text will be displayed in english
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&lang=eng
Defaults to 'pt'
 

map: string

               

Allow the user to define which 'local' maps to load on the URL. You need to pass the map name like in the ones passed at the 'name' property of a Layer with 'source' set as 'local'. This property only applies for visualization mode.

Example:
// Example of loading a map without any 'queryid' in visualization mode
https://maps.csr.ufmg.br/calculator/?map=CSR:geologia
Example:
// Example of loading two map without any 'queryid' in visualization mode
// and starting with them visible
https://maps.csr.ufmg.br/calculator/?map=CSR:geologia,CSR:estados&visiblelayers=2
Example:
// Example of loading a map without any 'queryid'
https://maps.csr.ufmg.br/?map=CSR:geologia
Defaults to string.empty
 

options: string

               

Allows the user to set some configurations when the map loads, like displaying a scale, how many Layers will start visible, etc…

To learn more about the Options available and how to set them up, check their documentation at: URL Options Section.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&options=&ltoptions_list&gt;
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&options=&ltoptions_list&gt;
Defaults to string.empty
 

queryid: Number

               

Define which Query will be loaded when the map loads. Every saved Query at Mappia receives a Query id number. By adding that number to the 'queryid', you can select the query loaded by the link. You can find all Queries created at Mappia in the 'Query' button at the top left in the editor window. By hovering the button and selecting the 'Carregar Queries' option, a popup will show up with all the Queries created at Mappia. The older Queries are listed first.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=473
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=473
Defaults to null
 

tools: string

               

Define which tools will be available for the user to interact with the map. Every tool listed here will be available for the user. If left empty, Mappia will display all tools for the user.

To learn more about the Tools available and how to set them up, check their documentation at: URL Tools Section.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=&lt;tools_list&gt;
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=&lt;tools_list&gt;
Defaults to 'All tools available'
 

visiblelayers: Number

               

The 'visiblelayers' property is an integer value that defines how many Layers will start visible at load. The 'visiblelayes' can assume 5 type values: - Positive integers: Define how many Layers will start visible when the map loads starting from the first (top) and going to the last (bottom) - Negative integers: Define how many Layers will start visible when the map loads starting from the last (bottom) to the first (top) - Zero: If set to zero, no Layer will start visible - custom: The Layers will start visible as defined by the 'visibility' property of each Layer - null: Set that there is no limit for the amount of visible Layers

Example:
// Example of query in visualization mode
// If the Layer has 3 Layers in the order: Layer1, Layer2 and Layer3,
// By setting 'visibelayers=2', the FIRST two Layers will start visible
// That is, the Layer1 and Layer2 will start visible
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&visiblelayers=2
Example:
// Example of query in edit mode
// If the Layer has 3 Layers in the order: Layer1, Layer2 and Layer3
// By setting 'visiblelayers=-2', the LAST two Layers will start visible
// That is, the Layer3 and Layer2 will start visible
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&visiblelayers=-2
Example:
// Example of query in edit mode
// By setting 'visiblelayers=0', no Layer will start visible when the map loads
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&visiblelayers=0
Example:
// Example of query in visualization mode
// By setting 'visiblelayers=custom', the Layers will start visible based on
// its 'visibility' property. Only if 'visibility: true', the Layer will start visible
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&visiblelayers=custom
Example:
// Example of query in edit mode
// By setting 'visiblelayers=null', there will be no limit for the amount of visible layers
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&visiblelayers=null
Defaults to 100
 

customzoom: Boolean

               

If listed, will display the "Zoom de seleção" button. This button allows the user to drag the mouse to select a region to zoom in on the map.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=customzoom
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=customzoom
Defaults to true
 

getfeature: Boolean

               

If listed, will display the "Indentifica atributos da feição" button. This button, when active, allows the user to click at a specific point in the map and get the more informations of the point that was clicked.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=getfeature
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=getfeature
Defaults to true
 

helpintro: Boolean

               

Define if should display the Help Tutorial button. This button opens a simple tutorial on how to use the Mappia features.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=helpintro
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=helpintro
Defaults to true
 

hovershowlegend: Boolean

               

If listed, will display the "Exibir da legenda da feição sob o mouse" button. This button, when active, allows the user to see the map Legend value of where the mouse is hovering.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=hovershowlegend
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=hovershowlegend
Defaults to true
 

legend: Boolean

               

If listed, will display the Legend popup button. This button shows a popup with the Legend of the active layers.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=legend
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=legend
Defaults to true
 

measure: Boolean

               

If listed, will display the Ruler button. This button allows the user to do measurements of distances in the map.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=measure
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=measure
Defaults to true
 

none: Boolean

               

If passed as the only value for the ‘tools’ property, no tool will be available for the user to interact with the map.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=none
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=none
Defaults to false
 

zoomextent: Boolean

               

If listed, will display the "Zoom nos layer" button. The button that centers the screen at the actual visible layer.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&tools=zoomextent
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&tools=zoomextent
Defaults to true
 

capabilities: Boolean

               

If listed, will load only the maps defined in the 'name' property of the Layers. This can speed up the loading time of the Query.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&options=capabilities
Example:
// Example of query in editor mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&options=capabilities
Defaults to false
 

disabledownload: Boolean

               

If listed, will hide the “download” button of the Legend Window. The “download” button is the same one as the “paramButtonConfig” “download” type.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id>&gt;&options=disabledownload
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id>&gt;&options=disabledownload
Defaults to false
 

grid: Boolean

               

If listed, will display the parallel and meridian lines grid.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&options=grid
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&options=grid
Defaults to false
 

hidemetadata: Boolean

               

If listed, will hide the “metadata” button of the Legend Window. The “metadata” button is the same one as the “paramButtonConfig” “metadata” type.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id>&gt;&options=hidemetadata
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id>&gt;&options=hidemetadata
Defaults to false
 

onlyfirstvisible: Boolean

               

If listed, only the first Layer defined at the Query will be visible when the map loads.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id>&gt;&options=onlyfirstvisible
Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id>&gt;&options=onlyfirstvisible
Defaults to false
 

overview: Boolean

               

If listed, will display a zoom out interactable window at the bottom right when the user zooms in the map.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&options=overview
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&options=overview
Defaults to false
 

scale: Boolean

               

If listed, will display the scale of the map at the bottom left.

Example:
// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=&lt;query_id&gt;&options=scale
Example:
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=&lt;query_id&gt;&options=scale
Defaults to false

General Information

Some General information that may help in sharing and using maps
 

operations: function

               

An enumeration of the possible operations that can be performed on a map. @param Value {Number} is the value of the Enum * RAW Each cell in resulting map has the value of ther most centered cell in aggregated region. * NORMAL A normal map is a map with each cell representing a legend/color and aren't a RAW Maps type. * RGBA Each cell in resulting map has a integer value representing the RGBA composition. PS: The result and also the input are integers represented by RGBA values. * SUM Each resulting cell is the weighted sum of cells in the covering region. PS2: The weight used is the proportion of the covered area against the total area of the cell i.e. VALUE * COVERED_PERCENTAGE. * AVERAGE Each cell is the resulting of the weighted mean of cell in the covered region. * MAX Each resulting cell is the greater cell that is at least partially covered in the given region. * MIN Each resulting cell is the smaller cell that is at least partially covered in the given region. * INTEGRAL A technique that allows to calculate the sum in a region just inspecting the cells on the boundaries of a retangular area i.e. calculate sum in a region using only 4 points. * AREAINTEGRAL TODO: Adicionar descrição * AREA Each cell carry the original map area in the aggregated region. (?) PS3: The 'area' simplifier agregates the original map areas, allowing to calculate the totals in any scale (with total precision). * CELLS Weighted sum of the cell quantity in a given region.

Configuring Layers

Properties that allow to, define, custumize, provide functionalities to layers
 

attribution: String

               

Recognizes someone as the platform author, showing in the "Powered by: {insert name}".

 

enableToggle: Boolean

               

Defines the associated button as a regular button or toggle. PS: When its true the callback function name is 'toggle', otherwise the callback is 'handler'.

Example:
|enableToggle=|
Defaults to true
 

getLayerLegend: function(composedLayer, index) : Array

               

Gets the associated layer legend content by its index. PS: The legend format is the same as expected by the composedLayer.setCalculateLegend function. Usage:this.setCalculateLegend(ExtjsUtils.Layer.getLayerLegend(composedLayer, 0)); @param composedLayer {OpenLayers.Layer.Composed} Layer composed. @param index {Numeric} Index of the inside layer.

 

group: String

               

Defines which group the layer is associated with. Layers from the same group can't be active simultaneously.

 

isCalculationPaused: function() : Boolean

               

Returns calculation status. True if calculations are paused, false otherwise.

 

maxExtent: OpenLayers.Bounds

               

Defines a geographical limit for a map rendering.

 

maxZoom: Numeric

               

Defines the limit of the real max zoom of a given layer. When map zoom exceed this, the image is reused and stretched.

 

maxscale: Numeric

               

Defines the limit of the real max scale of a given layer. When the map scale value exceeds the defined one, the image is reused and stretched.

 

metadataUrl: string|null

               

Defines the url to show custom layers metadata information. If empty, the default value is obtained from layer metadata from the WMS definition. PS: The linked domain must have CORS headers enabled.

 

minscale: Numeric

               

Defines the limit of the real min scale of a given layer. When the map scale reaches a value lower than the defined one, the image is reused and compressed.

 

openGroup: Boolean

               

Defines if the group starts opened, even without any visible layers. Set it true to start open, false otherwise. PS: If one layer is visible, the group will start open.

 

type: String

               

Defines a data source in one of the supported types: 'load', 'csv', 'json' or 'default'. 'load': The user is responsible for load data directly on layer. P.S.: This type, 'load', depends on an additional property, to be added on layer configuration, the 'loadData' callback function (inputs, layerConfig) called on layer scope. The user must inform the starting and ending of each data loading on layer (The calls are accumulative) [respectively this.events.triggerEvent('startLoadingLayer') and this.events.triggerEvent('endLoadingLayer')]. 'csv': Url address to load csv file from. 'json': Json data directly itself. 'jsonurl': Url address to load json from P.S.: Depends on the url: property to give this type a url address. 'empty'

Defaults to "json"
 

useLayerTooltip: Boolean

               

if true, it allows to use the tooltip of a map if its source attribute is calculate.

 

clusterDistance: Numeric

               

Defines the minimum relative distance (in pixels) to clusterize points. Set 0 to never clusterize, or a value greater than 0 to set the minimum distance. PS: When filters are applied, you can use the property 'count' on 'VectorLayer.styleMap' property to check how many points exists in the current cluster.

 

convertJsonEntryToFeature: function(curObj, optionalGetLonLat) : OpenLayers.Feature.Vector

               

Converts a JsonObject into a Layer Feature (that can be added to layer). @param curObj {JsonObject} Object with properties. @param optionalGetLonLat {function} Optional function to get position coordinates from JSON. P.S.: Optional function to get X,Y values from Obj. (By default Longitude and Latitude use fields: lon and lat) function optionalGetLonLat(curObj) returns OpenLayers.LonLat curObj: Object with JSON properties. This function receive the 'curObj' and expects to returns the object properties.

 

coordinates: Object

               

Redefines the coordinate property names to {x, y}. PS: Used only if the 'VectorLayer.getVector' is not defined.

Example:
coordinates: {
              'x': 'lon',
              'y': 'lat'
          }
 

defaultStyle: Object

               

Defines the default style that will be applied to the geometry. PS: Accepts 'context' and 'rules'. Property 'context': allows definition of functions. Property 'rules': allows definition of filters (only the geometries that fit into this rule will be displayed). Look at some examples at: http://dev.openlayers.org/examples/

Example:
defaultStyle: {color: '${getColor}', context: {getColor: function(attr){return 'green';} }
 

fromProj: String

               

Defines the projection of the JSON (accepts only EPSG:4326 and EPSG:900913).

Example:
EPSG:900913
 

getLayerDefinedFunctionsByName: function(name) : function|Undefined

               

Gets the layer inner function. Define the layer inner function at VectorLayer. Ex: { name: 'CSR:map_name', function: { nameFunctionExample: function(){alert('a');} } } @param name {String} Function name

 

getVector: function

               

Defines the callback function to parse the layer data and get the geometry. Callback Function getVector function(attribute, config) @param attribute {Object} Object with attributes. @param config {Object} Layer config.

 

hoverSelectedStyle: Object

               

Defines the style that will be applied to the geometry when the mouse hovers over a selected feature. Default hover selected style is the selected style PS: Accepts 'context' and 'rules'. Property 'context': allows definition of functions. Property 'rules': allows definition of filters (only the geometries that fit into this rule will be displayed). PS2: Hover Select depends on both 'onHover' and 'onClick' properties to work. Look at some examples at: http://dev.openlayers.org/examples/

Example:
[{color: '${getColor}', context: {getColor: function(attr){return 'green';} }]
 

hoverStyle: Object

               

Defines the style that will be applied to the geometry when mouse is hovering. PS: Accepts 'context' and 'rules'. Property 'context': allows definition of functions. Property 'rules': allows definition of filters (only the geometries that fit into this rule will be displayed). PS2: Hover depends on 'onHover' property that allows to hovering. Look at some examples at: http://dev.openlayers.org/examples/

Example:
[{color: '${getColor}', context: {getColor: function(attr){return 'green';} }]
 

loadGeojson: function()

               

Function to load geojson and draw on the layer.

 

onAdded: function

               

Defines the callback function that is called when the layer is added to layer list. AddedEvent { element: {DOM} 'DOM element of the layer', layer: {OpenLayers.Layer.Vector} 'Javascript Object of the layer', map: {Map} 'MapPanel where the layer was added.', type: {String} 'Type of the event ( added )' }

 

onBeforeFeatureChangeCallback: function

               

Defines the callback function that is called before a layer feature is added, removed or edited. PS: If it returns false, the change operation is canceled. @param operationType {String} Receive the operation type: 'add' or 'remove' when adding or removing respectively. @param arrFeatures {Array} Array of features affected.

Example:
{
     ...,
     onBeforeFeatureChangeCallback: function(operationType, arrFeatures) {
         
     },
     ...
}
 

onClick: function

               

Defines the callback function to the click event. @param event {Object} The click event Object. @param source {VectorFileSource} Auxiliary functions to deal with Vector Layer. @param inputs {Array.<Object>} Array with all layer input values.

Example:
{
     ...,
     onClick: function (event) {
         console.log("Triggered click event!");
     },
     ...
}
 

onClickCfg: function

               

Defines the callback function to the Click Select controller. The additional parameters are listed in http://dev.openlayers.org/docs/files/OpenLayers/Control/SelectFeature-js.html.

 

onFeatureChangeCallback: function

               

Defines a function that is called after a layer feature is added, removed or edited. @param operationType {String} Receive the operation type: 'add' or 'remove' when adding or removing respectively. @param arrFeatures {Array} Array of features affected.

Example:
{
     ...,
     onFeatureChangeCallback: function (operationType, arrFeatures) {
         
     },
     ...
}
 

onHover: function

               

Defines the callback function on 'Vector Layer' hover. @param evt {Object} Features. @param state {Boolean} True when hover starts, false when it ends. @param controller {Object} The controller itself. @param inputs {Object} Layer widget values.

Example:
{
     ...,
     onHover: function (evt, state, controller, inputs) {
         console.log(state ? "Started": "Ended");
     },
     ...
}
 

onLoad: function

               

Defines the callback function to be called after the layer is loaded or added to a map. PS: You can use 'this' to access layer properties. @param widgetValues {Array} inputs for onLoad callback

Example:
{
     ...,
     onLoad: function (widgetValues) {
         print(this.title) // prints the layer title
     },
     ...
}
 

popupCallback: function

               

Defines the callback function to be called on popup. @param attributes {Array} attributes for popupCallback @param inputs {Array} inputs for popupCallback

Example:
{
     ...,
     popupCallback: function (attributes, inputs) {
         
     },
     ...
}
 

popupTemplate: String

               

Defines the template to popup content.

Example:
popupTemplate: '<div><a target="_blank" href="{link}">{description}</a></div>'
Defaults to '{description}'
 

selectStyle: Object

               

Defines the default style that will be applied to the selected geometry. PS: Accepts 'context' and 'rules'. Property 'context': allows definition of functions. Property 'rules': allows definition of filters (only the geometries that fit into this rule will be displayed). PS2: Selected depends on 'onClick' property that allows to select. Look at some examples at: http://dev.openlayers.org/examples/

Example:
[{color: '${getColor}', context: {getColor: function(attr){return 'green';} }]
 

setDrawing: function(enabled, callbackOnAdd)

               

Defines drawing features on layers. PS: Function is available to the VectorLayer. @param enabled {Boolean} True to enable drawing, False otherwise. @param callbackOnAdd {function} Callback when a new feature is drew. P.S.: You can use 'this' to access layer properties. P.S.2: The callback function receives 2 parameters: - vectorLayer: Current layer. - drawEvent: The info of the added polygon.

Example:
this.setDrawing(false, function (vectorLayer, drawEvent) {})
 

styleMap: Object|OpenLayers.StyleMap

               

Customizes the layer visualization. PS: It is an advanced parameter, so it might be easier to use selectedStyle, defaultStyle and hoverStyle. PS2: The 'temporary' style is applied on hover event.

Example:
StyleMap{[default, select, temporary]: Style {rules:[Rule,], context: {getRadius: function() {return Math.random()}}}
 

name: String

               

Defines a map identifier. This name should be unique.

Example:
[
 ...
     {
        source: "xyz",
        name:"XYZ:map_name",
     }
 ...
]
 

source: Object

               

Adds a layer to store the source. @param layerCfg {LayerConfig} Layer XYZ configuration. LayerConfig { url: url, name: name, isBaseLayer: isBaseLayer, sphericalMercator: sphericalMercator }

 

url: String

               

Defines the url where the map can be fetched from. Use the ${x} ${y} ${z} as placeholder for x, y and z coordinates.

Example:
"https://tiles.planet.com/basemaps/v1/planet-tiles/planet_medres_visual_2021-09_mosaic/gmap/${z}/${x}/${y}.png?api_key=b24ae87a99624d2cbd8ed6aeb9703280"
 

onError: function

               

Defines callback function to be called when the store failes to be loaded.

 

onLoad: function

               

Defines callback function to be called when the store is successfully loaded.

Helper Functions

Set of functions that help creating map interactions
 

changeLayers: function(newConfig, force)

               

Replaces an internal layer at a given index. PS: It's highly recommended to pass multiple configurations in an array, instead of calling this function multiple times in the same callback. @param newConfig {Array|Object} One or more layers configurations with a property 'index' indicating the replacing layer. Each config object must contain at least the following properties: [{name: 'MAP_FULL_NAME', styles: 'MAP_STYLE', index: 'MAP_INDEX_TO_CHANGE'}, ... ] @param force {Boolean} Force redraw even if no change is done when the layer is the same.

Example:
{
     name: "CSR:rodovias,CSR:municipios",
     otherNames: "CSR:roads",
     beforeCalc: function(layerVals, inputVals) {
         this.changeLayers([{name: 'CSR:roads', styles: fMapName + "_1", index: 0}]);
     }
  }
 

otherNames: String

               

Defines additional maps to be available for the query, which will be listed in the filtered stored capabilities. Every map included in layer definition needs to be either in 'name' property or 'otherNames' property. PS: This property must be used along with the 'capabilities' url option, which filters the 'GetCapabilities' response with only the maps included in layer definition. (Performance Optimization, faster loading). PS2: This property is only needed outside of the editor mode.

Example:
{
     name: "CSR:estados,CSR:airports",
     otherNames: "CSR:municipios,CSR:rodovias",
     beforeCalc: function(layerVals, inputVals) {
         this.changeLayers([{name: 'CSR:municipios', styles: fMapName + "_1", index: 0},
             {name: 'CSR:rodovias', styles: 'rodovias_1', index: 1}]);
     }
  }

  Function 'changeLayers' needs the definition of the 4 maps: 'estados', 'airports', 'municipios' and 'rodovias'. 
  If the 'otherNames' is not defined, only the maps defined at 'name' property will be available.
 

CreateTooltipOnPosition: function(title, contentHtml, position, additionalConfig) : Ext.Tooltip

               

Create a tooltip at a fixed position. If the position is the mouse event, the tooltip will be at the right side and below the pointer. If the position is a array[x,y] will anchor the top left at this point. @param title {String} Tooltip title. @param contentHtml {String} Tooltip HTML content. @param position {Event|Array.<Number>} Defines the top left position of the tooltip. Can be either a mouse event at or an array [x:Number, y:Number] with the cursor position. @param additionalConfig {Object} Additional configuration for the tooltip.

 

escapeRegExp: function(str) : String

               

Escape regular expression special characters from a string. Escape characters are '-', '[', ']', '/', '{', '}', '(', ')', '*', '+', '?', '.', '\', '^', '$', '|'. @param str {String} Expression to be escaped

 

getHighchartById: function(id) : Object

               

Gets the highchart by its DOM id. @param id {String} Id of the highchart.

Example:
Extjs.getHighchartById("highchart-01");
 

alert: function(msg)

               

Shows an user non blocking alert. PS: If layer is loading only the last message will be shown after load end. @param msg {String} Notification HTML content.

 

log: function(msg, config)

               

Shows an user notification (if enabled). PS: The messages before layer loading are delayed, when it finishes only the last message will be shown. @param msg {String} The message that will be displayed in the alert. It can be in HTML format. @param config {Object} Configuration parameters for the message. { force: {Boolean} Force to show notification even when disabled. func: {Callback} Callback function when the notification is clicked. onlyMsg: {Boolean} True to only show message and hide the close and the stop notifications, False otherwise. delay: {Numeric} Amout of time in milisseconds before the message hide. spamTime: {Numeric} Time the same message to be shown again is considered spam. (even with force = true). }

 

addLayer: function(cfg)

               

Adds a layer from its definition. @param cfg {Object} Layer definition

 

addRemoteWMSServer: function(wmsDefinitions, QUERY_DESCRIPTION) : boolean

               

Adds custom remote servers. @param wmsDefinitions {Object} A object with all custom WMS definitions. The object could contain the following properties: *url: {String} Url of the source (Mandatory). ?cors: {Boolean} True to accept (Cross Domain Request Security) CORS for servers without permission, False otherwise. ?updateWMS: {Boolean} True to purge the WMS cache and get the updated content, False otherwise. (Useful to avoid long waitings) ?storage: {String} Name of the storage service, supported services so far: 'github'. Storage type tips: 'github': The Github contenct directly. 'jsdelivr': The jsDelivr cache the results to force a instantly update the user could use different release version. Tutorial about creating releases: https://help.github.com/en/articles/creating-releases After creating the user could append @VERSION_NUMBER to the URL to force updating the map cache. @param QUERY_DESCRIPTION {ConfigLayer} Array Array of layers in the query. Usage: ExtjsUtils.QUERY.setQueryGlobalProperties({globalCount: 0}) && QUERY_DESCRIPTION

 

decorate: function(pageProperties)

               

Defines custom 'CSS' properties to decorate the page, allowing to add headers and footers, change the top bar color, and other settings. @param pageProperties {Object} Object with the custom properties to customize the page.

 

runNow: function()

               

Defines functions to be called before layer definition, inside 'QUERY.setQueryGlobalProperties'.

Example:
ExtjsUtils.QUERY.setQueryGlobalProperties({
 runNow: function(){...}
 }) && QUERY_DESCRIPTION
 

runOnceLayerVisible: function(layer, callback)

               

Defines a function that is called after the specified layer is rendered. If the layer is already visible, the function is executed immediately. PS: This is used inside of layer callback functions. @param layer {OpenLayers.Layer} Layer that has to be rendered. @param callback {function} Function to be called.

Example:
runOnceLayerVisible: function (layer, callback) {}
 

setMappiaIoCallback: function(onMsgCallback)

               

Defines a function that receives a message from the parent window, allowing communication between the Mappia/iframe and the parent window. (Compatible with MappiaIO library) The 'QUERY.postMessage' is responsible for sending message. @param onMsgCallback {function} Callback that will receive the param passed on 'MappiaIO.postMessage'. - jsStr {Object|String} Received param from parent window to Mappia/iframe.

Example:
ExtjsUtils.QUERY.setMappiaIoCallback(function onMsgCallback(jsStr) {})
 

setQueryGlobalProperties: function(globalProperties) : Boolean

               

Allows to define custom global functions that can be used to define properties. PS: All properties defined here are added to the global scope and are removed when the query is changed. PS2: QUERY_DESCRIPTION is the definition of layers in the query used immediately after the function. @param globalProperties {Object} The object that all his functions will become globals, each property can be a value or a object or even a function.

Example:
ExtjsUtils.QUERY.setQueryGlobalProperties({globalCount: 0}) && QUERY_DESCRIPTION
 

shapefile2GeojsonAsync: function(shpFile, paramOptions)

               

Parse shapefile to compatible Layer features. DBF file is optional. PS:ParamOptions { callback: {Function} 'Callback function with parsed shapefile' function(layer, parsedGeojson, originalData), fromProj: {String?} 'Projection name.' (EPSG:4326 or EPSG:900913), dbf: (Optional?)'DBF file to load along with shapefile.', limitCount: (Optional?)'Limit the amount of processed geometries' } @param shpFile {File} Shapefile content (Needs to be in projection EPSG:4326 or EPSG:900913. @param paramOptions {ParamOptions} Additional configuration for handling shapefile. ParamOptions { callback: {Function} 'Callback function with parsed shapefile' function(layer, parsedGeojson, originalData), fromProj: {String?} 'Projection name.' (EPSG:4326 or EPSG:900913), dbf: (Optional?)'DBF file to load along with shapefile.', limitCount: (Optional?)'Limit the amount of processed geometries' }

 

limitZoomLevel: function()

               

Sets the maximum zoom level.

Example:
ExtjsUtils.ZOOM.limitZoomLevel(ZOOM_MAX_LVL: integer);
 

getLayersRecord: function(layerName, storeName) : Array.<Ext.data.Record>|Ext.data.Record|Null

               

Gets the store layer information from its full name. PS: The parameter must be the full layer name, such as: 'CSR:estados' or 'CSR:altimetria'. @param layerName {String} Optional Full layer name to look for, otherwise it will return all records. @param storeName {String} Optional Name to search only in specific sources for the 'layerName' (fill it to prevent from searching in all stores).

Example:
Layer.getLayersRecord("CSR:estados");
 

isOnHover: function(layer, mouseEvt) : Boolean

               

Informs if the mouse is over the current layer. @param layer {Layer|Composer} Layer to check if the mouse is over. @param mouseEvt {Event} The mouse event.

 

abbreviateNumber: function(value, useFixed, abbreviateNumbers) : Number|String

               

Auxiliary function to shorten the display of numbers. PS: The number loses a little precision but becomes more meaningful. @param value {Number} Value to be displayed. @param useFixed {Number} If set it will limit the number of decimal places, otherwise it will use the default value. @param abbreviateNumbers {Array.<Number>} Number suffix name.

 

isLocalUrl: function(url) : Boolean

               

Identify if the 'url' is from the localhost or is from the maps.csr.ufmg.br domain. PS: If url is left blank it uses the current site url. @param url {String} String with the url to be checked.

Example:
ExtjsUtils.REQUEST.isLocalUrl() // true
Example:
ExtjsUtils.REQUEST.isLocalUrl("www.google.com") // false
 

postMessage: function(jsStr)

               

Sends a message to the Mappia/iframe, allowing communication between the Mappia/iframe and the parent window. (Compatible with MappiaIO library) The 'QUERY.setMappiaIoCallback' is responsible to interpret the sent message. @param jsStr {Object|String} Object to be sent from inside Mappia/iframe to parent window.

Example:
ExtjsUtils.QUERY.postMessage({a:1,b:2})

External Libraries

External libraries that may be useful for creating data visualisation