Map toolbar tools and page options

Quick start

The example below, running in the Mappia calculator - click it to run it live. Full-size picture

  1. Run it

    Click the picture: the map opens right here and runs the example. Nothing is saved, and nothing to install.

  2. Try it
    • Click the ruler button, then click two points on the map: the distance between them appears.
    • Turn on the identify button and click a state: the attributes of that state appear.
    • In your own map’s address, set tools=measure: of the optional buttons, only the ruler remains.
  3. Make it yours

    Copy the query, change it - the key parameters are below - and run it again in the playground, or paste it into the Mappia editor to save it as your map.

Key parameters

ParameterExampleWhat it does
measuretools=legend,measure,getfeatureAdds the ruler, for measuring distances on the map.
getfeaturetools=getfeature,zoomextentAdds the identify button: click the map to see the attributes of what is under the click.
legendtools=legend,measureAdds the button that opens the legend of the visible layers.
scaleoptions=scale,grid,overviewShows a scale bar at the bottom left of the map.
startopenedoptions=scale,startopenedOpens the layer panel when the map loads, instead of leaving it closed behind its button.
capabilitiesoptions=scale,capabilitiesLoads only the maps the query names, for a faster start. Needs a saved query id.

Every parameter, with its type and default, is in the reference at the end of this page.

Complete example

The query 6 lines · runs as is
// Map toolbar tools and page options are chosen in the page URL, not in the query:
//   /calculator/?queryid=...&tools=legend,measure,getfeature,hovershowlegend,zoomextent,customzoom,metadata,helpintro
//                          &options=scale,grid,overview
[
  { name: "CSR:estados", title: "States", visibility: true, opacity: 0.5 },
];

Customize it

They live in the address, not in the query

The toolbar and the page options are chosen by the address of the page that shows the map, so the same query can have a full toolbar in one place and a bare map in another:

https://maps.csr.ufmg.br/calculator/?queryid=YOUR_QUERY_ID&tools=legend,measure,getfeature,zoomextent,customzoom,metadata&options=scale,grid,overview

Lists are comma-separated, without spaces.

Toolbar buttons: tools=

TokenButton
legendOpens the legend of the visible layers
zoomextentZooms to the visible layers
customzoomDrag a box to zoom into it
getfeatureIdentify: click the map to read the attributes under the click
measureRuler for distances
metadataShows the published description of the visible maps
hovershowlegendShows the legend value under the mouse pointer
helpintroA short guided tour of the interface

Without tools= every button is shown. With it, only the listed ones are. The zoom buttons and a few platform buttons are always there, whatever the list says.

Page options: options=

TokenEffect
scaleA scale bar at the bottom left
gridLines of latitude and longitude
overviewA small overview map at the bottom right
startopenedThe layer panel starts open
hidestylechooserHides the style list of every layer
hidemetadataHides the metadata button of every layer
disabledownloadHides the download button of every layer
onlyfirstvisibleOnly the first layer starts visible
capabilitiesLoads only the maps the query names (needs a real queryid)
keeponleaveControls mouse-wheel zoom when the map is embedded in another page

Use a single options=

Put every option in one comma-separated options= parameter. Repeating options= in the same address froze the page in our tests.

Other useful parameters

  • visiblelayers=custom starts each layer as its own visibility says; a number N starts the first N layers visible.
  • extent=minX,minY,maxX,maxY sets the starting view, in longitude and latitude.
  • lang=eng shows the interface in English (pt is the default).

Tokens that do nothing

Many shared links carry tools=layerchooser and options=enablequeries. Neither has any effect: they are harmless in old links, but leave them out of new ones. Options for single layers - such as hiding one layer’s buttons - are layer properties: see layer panel buttons.

Reference: the parameters used here

Generated from the platform source. Every entry, searchable, is in the API reference; the raw data is api.json. Open an entry for its description, parameters and example; # links to it.

Toolbar buttons (tools=)

URLTools9 entries
Values of tools=, separated by commas: the optional buttons of the map toolbar. Listing them replaces the default set; zoom and navigation are always there.
Example
// Example with all possible tools
https://maps.csr.ufmg.br/calculator/?queryid=474&tools=legend,measure,hovershowlegend,getfeature,customzoom,zoomextent,helpintro,metadata

customzoom

Boolean= truelink parameter# If listed, will display the "Zoom de seleção" button.

Written as tools=customzoom

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 of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=customzoom
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=customzoom

getfeature

Boolean= truelink parameter# If listed, will display the "Indentifica atributos da feição" button.

Written as tools=getfeature

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 of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=getfeature
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=getfeature

helpintro

Boolean= truelink parameter# Define if should display the Help Tutorial button.

Written as tools=helpintro

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=helpintro
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=helpintro

hovershowlegend

Boolean= truelink parameter# If listed, will display the "Exibir da legenda da feição sob o mouse" button.

Written as tools=hovershowlegend

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 of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=hovershowlegend
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=hovershowlegend

legend

Boolean= truelink parameter# If listed, will display the Legend popup button.

Written as tools=legend

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=legend
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=legend

measure

Boolean= truelink parameter# If listed, will display the Ruler button.

Written as tools=measure

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=measure
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=measure

metadata

Boolean= truelink parameter# If listed, will display the metadata button.

Written as tools=metadata

If listed, will display the metadata button. This button opens the description of the visible maps as published - source, date, scale and the other metadata recorded with each map.

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=metadata

none

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

Written as tools=none

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=none
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=none

zoomextent

Boolean= truelink parameter# If listed, will display the "Zoom nos layer" button.

Written as tools=zoomextent

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=zoomextent
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=zoomextent

Page options (options=)

URLOptions10 entries
Values of options=, separated by commas, that change how the page opens the map. Some also exist as a layer key or a query setting; the guide Where to find it says which one wins.
Example
// Example with all possible options
https://maps.csr.ufmg.br/calculator/?queryid=474&options=capabilities,grid,scale,disabledownload,hidemetadata,overview,onlyfirstvisible

capabilities

Boolean= falselink parameter# If listed, will load only the maps defined in the 'name' property of the Layers.

Written as options=capabilities

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 of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=capabilities
// Example of query in editor mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=capabilities

disabledownload

Boolean= falselink parameter# If listed, will hide the “download” button of the Legend Window.

Written as options=disabledownload

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=disabledownload
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=disabledownload

grid

Boolean= falselink parameter# If listed, will display the parallel and meridian lines grid.

Written as options=grid

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=grid
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=grid

hidemetadata

Boolean= falselink parameter# If listed, will hide the “metadata” button of the Legend Window.

Written as options=hidemetadata

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=hidemetadata
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=hidemetadata

hidestylechooser

Boolean= falselink parameter# If listed, hides the style chooser of every layer in the layer panel, so the reader sees each map only in the style the query selected.

Written as options=hidestylechooser

If listed, hides the style chooser of every layer in the layer panel, so the reader sees each map only in the style the query selected. The per-layer equivalent is the layer property hideStyleChooser.

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=hidestylechooser

keeponleave

Boolean= truelink parameter# Controls mouse wheel zoom when the map is embedded in an iframe.

Written as options=keeponleave

Controls mouse wheel zoom when the map is embedded in an iframe.

Only applies when the page runs inside an iframe. When false, leaving the document (mouseout with destination HTML) blocks wheel zoom until the user clicks the map; wheel events over the viewport then show Lang.navigationWheelDisabled.

// Query-level setting (preferred for shared maps)
ExtjsUtils.CONFIGURATION.setOptions({ keepOnLeave: false }) && QUERY_DESCRIPTION
// Plugin config (tools array in calculator / composer)
{ ptype: "gxp_usabilityhelper", keepOnLeave: false }
// URL option (sets keepOnLeave via advToolsOptions; same as default true)
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=keeponleave

onlyfirstvisible

Boolean= falselink parameter# If listed, only the first Layer defined at the Query will be visible when the map loads.

Written as options=onlyfirstvisible

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=onlyfirstvisible
// Example of query in visualization mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=onlyfirstvisible

overview

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

Written as options=overview

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=overview
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=overview

scale

Boolean= falselink parameter# If listed, will display the scale of the map at the bottom left.

Written as options=scale

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=scale
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=scale

startopened

Boolean= falselink parameter# If listed, the layer panel (the Legend Window with the query's groups and layers) starts open when the map loads, instead of collapsed behind its button.

Written as options=startopened

If listed, the layer panel (the Legend Window with the query's groups and layers) starts open when the map loads, instead of collapsed behind its button. Use it when the layer list is part of what the page is for; leave it out to give the map the whole screen.

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=startopened

Link parameters (?name=value)

URLProperties5 entries
Parameters of the link that opens a saved map: ?queryid=123&lang=eng&tools=...&options=... tools and options take the lists below.

extent

Array.<Number>= [-443.628,-16.847,-407.373,3.294]link parameter# Defines in which part of the world the map will start on load.

Written as ?extent=

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 of query in visualization mode
// This extents start the map center at Japan
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&extent=122,24,153,45
// Example of query in edit mode
// This extents will display the whole world
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&extent=-180.0000,-90.0000,180.0000,90.0000

lang

String= 'pt'link parameter# Define in which language the Mappia default messages and texts will be displayed.

Written as ?lang=

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 of query in visualization mode
// The default text will be displayed in portuguese
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&lang=pt
// Example of query in edit mode
// The default text will be displayed in english
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&lang=eng

options

string= string.emptylink parameter# Allows the user to set some configurations when the map loads, like displaying a scale, how many Layers will start visible, etc…

Written as ?options=

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

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&options=<options_list>
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&options=<options_list>

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

tools

string= 'All tools available'link parameter# Define which tools will be available for the user to interact with the map.

Written as ?tools=

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.

// Example of query in visualization mode
https://maps.csr.ufmg.br/calculator/?queryid=<query_id>&tools=<tools_list>
// Example of query in edit mode
https://maps.csr.ufmg.br/editor/?queryid=<query_id>&tools=<tools_list>

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

visiblelayers

Number|String= customlink parameter# How many layers start visible.

Written as ?visiblelayers=

How many layers start visible. When the parameter is present it overrides the 'visibility' of every layer: all layers start hidden, then this many are turned on, counted in query order.

  • A positive number N: the first N layers of the query start visible.

  • A negative number -N: the last N layers start visible.

  • 0: no layer starts visible.

  • custom: the same as leaving the parameter out: each layer's own 'visibility' decides.

Leaving it out (the default) lets each layer's 'visibility' decide; options=onlyfirstvisible is the same as visiblelayers=1. Any other text, null included, hides every layer.

// 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=<query_id>&visiblelayers=2
// 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=<query_id>&visiblelayers=-2
// 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=<query_id>&visiblelayers=0
// 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=<query_id>&visiblelayers=custom