Map Field (PRO)
A map with markers. Each marker carries a title, an alias, a phone, an email, an address and a description, so one field describes a whole set of points.
Which map is drawn
The provider is chosen once for the site, by the pageblocks_map_type system setting:
| Value | Provider | Key needed |
|---|---|---|
leaflet | Leaflet over OpenStreetMap | No |
ymaps | Yandex Maps | Yes — pageblocks_yandex_apikey |
The setting's dropdown offers these two and nothing else: Google Maps is not on it in 3.0. The code behind it has not been removed — set the value to googlemaps by hand and the component loads Google's script with a key from pageblocks_googlemaps_apikey, a setting the package does not create, so you have to add it yourself. Unsupported, and the field's Google branch is not maintained.
Settings common to all: map center (48.737, 18.893 is the format, not a default) and zoom. Leaflet adds a marker icon, its size, the tile style (light, dark, voyager or your own) and the interaction switches — dragging, scroll zoom, double-click zoom, keyboard, touch zoom. Yandex takes only center and zoom.
Leaflet is the default, and it needs nothing
After installing, pageblocks_map_type is set to leaflet: it works with no key and no registration anywhere. For most sites that is the whole of map configuration.
Switch to ymaps and you must fill in pageblocks_yandex_apikey, or the map stays blank.
Output is yours to write
The value is a JSON array of markers:
[{"lat": 55.755826, "lng": 37.617299, "title": "Office", "address": "…"}]No ready-made snippet renders it. Decode the value and feed the coordinates to whichever map library the theme already loads:
<div id="map" data-markers='{$points}'></div>That is deliberate on the front end: the manager needs one provider, a page may need another, and the markers are plain data either way.