- 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.
Shape the map with the link
The link takes parameters, each &name=value:
| Parameter | What it does |
|---|---|
queryid | The saved query to show |
lang | eng or pt: the language of the interface |
tools | The optional buttons of the toolbar, separated by commas: legend, measure, getfeature, hovershowlegend, zoomextent, customzoom, metadata, helpintro |
options | Page options, separated by commas: scale (a scale bar), startopened (the layer panel opens), hidestylechooser, hidemetadata, disabledownload, capabilities… |
visiblelayers | How 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
- Paste the query of step 5 into the editor, apply it and save it; open
/calculator/?queryid=with its number. - Add
&tools=measure,getfeatureto the link: only those two optional buttons appear. - Add
capabilitiestooptions=: the map opens faster, reading only the maps your query uses.
Read more
- Map tools - the tools and options of a link, running
- URL parameters in the API reference
- Page options in the API reference
- Where to find it - which part of the API to open