Skip to content

Map ​

The Map tab of an index plots its documents that have a _geo field. The tab appears when at least one document has one.

The Map tab with documents clustered by city on a world outline

Use it to check that your locations are where you expect, to see how they are spread, and to get a geo filter for an area without working out coordinates by hand.

What you see ​

  • Documents as dots. Where several fall close together on screen they share a circle with their count; click it to zoom in. Click a single dot to open that document beside the map.
  • The land outline, a latitude and longitude grid, and a scale bar. Drag to move, scroll or double-click to zoom. Fit zooms to the documents shown, World zooms all the way out.
  • How many are shown. The map asks Meilisearch only for what is in view, spread evenly across the screen, up to 2,700 documents. When more than that are in view it says so; zoom in to see them all. It also says how many of the index's documents have a location at all.

Getting a filter for an area ​

Choose Box or Circle and drag on the map. The matching filter appears under the map with the number of documents it matches:

ToolFilter
Box_geoBoundingBox([top, right], [bottom, left])
Circle (drag from the centre outwards)_geoRadius(lat, lng, metres)

Copy it for your own code, or Show in Documents to open the Documents tab with it applied.

A circle drawn on the map, with its _geoRadius filter and the number of matching documents under it

When _geo isn't filterable ​

Asking for "what is in this part of the map" is a filter, so _geo must be in the index's filterableAttributes. If it isn't, the map shows the documents with a location among the first 1,000 instead, says so, and offers Make _geo filterable. That changes the index's settings and makes Meilisearch re-index it, so it asks first and isn't offered to read-only users.

No tiles, no third parties ​

The map makes no request to anyone but your Meilisearch server. There is no tile server and no map library: the background is a coarse outline of the world's land (Natural Earth 1:110m, public domain) that ships inside the app and is about 27 KB.

The price is detail. The outline is good at world, continent and country scale. Zoomed in to a city you see your documents against a plain background with the grid and the scale bar, and no streets or place names.

Things to know ​

  • Documents whose _geo is missing or not a pair of numbers aren't drawn.
  • Counts stop at the index's pagination.maxTotalHits (1,000 by default), which is why a busy view says "or more".
  • Only _geo points are drawn, not _geojson shapes.

Released under the MIT License. Not affiliated with Meilisearch.