In this step you learn
  • How a query is saved and gets its number, the queryid.
  • The parameters of a map link: tools, options, language.
  • How to embed the map in another page.

Save it

Open the Mappia editor, paste your query and press Apply to see it. Save keeps it on the map server and gives it a number - its queryid. From then on the map is a link:

https://maps.csr.ufmg.br/calculator/?queryid=123

The editor writes and saves; the calculator shows. Opening the editor with ?queryid=123 loads the saved query to edit it again.

The link takes parameters, each &name=value:

ParameterWhat it does
queryidThe saved query to show
langeng or pt: the language of the interface
toolsThe optional buttons of the toolbar, separated by commas: legend, measure, getfeature, hovershowlegend, zoomextent, customzoom, metadata, helpintro
optionsPage options, separated by commas: scale (a scale bar), startopened (the layer panel opens), hidestylechooser, hidemetadata, disabledownload, capabilities…
visiblelayersHow many layers start visible - 2 the first two, 0 none - instead of each layer’s own visibility

These parameters belong to the link, not to the query: another link can open the same saved query with other buttons. Without tools, the map shows every optional button; with it, only the ones listed - zoom and navigation are always there. They are toolbar buttons, not the widgets of a layer’s panel (step 5).

options=capabilities is worth adding to every link of a saved query: the map reads a catalogue of only the maps your query uses instead of the server’s whole catalogue, and opens much faster. Each tool and option is described in the API reference, and the map tools page shows them on a live map.

Embed it

Any page can show the map in an <iframe>:

<iframe src="https://maps.csr.ufmg.br/calculator/?queryid=123&lang=eng&tools=zoomextent&options=scale,capabilities"
        width="100%" height="600" style="border: 0"></iframe>

That map lives on its own inside the page. To make the page and the map work together - your buttons driving it, the map reporting clicks - there is MappiaIO, the last step.

Try this

  1. Paste the query of step 5 into the editor, apply it and save it; open /calculator/?queryid= with its number.
  2. Add &tools=measure,getfeature to the link: only those two optional buttons appear.
  3. Add capabilities to options=: the map opens faster, reading only the maps your query uses.

Read more