WordPress plugin
The iframe plugin as a WordPress block and shortcode: map, points of interest, travel times and neighbourhood summary on your property pages, configured from the WordPress admin instead of URL parameters.
The same plugin also writes an indexable neighbourhood text into your pages.
Install
The plugin is on the official WordPress directory: wordpress.org/plugins/yatmo-map/. Install it from Plugins > Add New, then open Settings > Yatmo Map, enter your license key and choose your country, language and default look. Every block and shortcode starts from these defaults.
Block editor
Add the Yatmo Neighbourhood Map block (Embed category). Type the property address and press Enter, or enter its coordinates: the preview updates in the editor. The sidebar holds every option of the iframe plugin: layout, height, zoom, map style, pin or circle, colours, isochrones and routes, country and language.
Shortcode
For the classic editor, page builders (Elementor, Divi, WPBakery...) and PHP templates, use [yatmo-map]. All attributes are optional: anything left out comes from the settings page.
[yatmo-map address="Rue de la Loi 16, 1000 Bruxelles"]
[yatmo-map latitude="50.8461" longitude="4.3664" mode="map-top" marker="circle" circle_radius="400" isochrone="right"]
[yatmo-map latitude="48.8566" longitude="2.3522" country="FR" language="FR" mode="summary-tabs" height="70vh"]
Listing templates
Real estate themes and listing plugins store the coordinates of each property in custom fields. Enter the names of these fields in Settings > Yatmo Map > Property location and leave the location of the block or shortcode empty: one block in the listing template then shows the neighbourhood of every property.
<?php echo do_shortcode( '[yatmo-map]' ); ?>
If one field holds both values (50.85,4.35), enter it as the latitude field and leave the longitude field empty. Coordinates given on the block or shortcode take precedence, then the address, then the custom fields.
All attributes
Shortcode attribute names are lowercase with underscores (WordPress lowercases them). Each maps to a parameter of the iframe plugin.
| Name | In | Type | Description |
|---|---|---|---|
| address | string | Property address, located by the Yatmo geocoder in the selected country. Looked up once, then cached for 90 days. | |
| latitude / longitude | number | Property coordinates. Take precedence over the address. A decimal comma is accepted. | |
| country | string | Country code (BE, FR, UK...). Default: the settings page. | |
| language | string | Language code (EN, FR, NL...). Default: the language of the page, which follows WPML and Polylang. | |
| mode | string | overlay, overlay-scores, map-top, map, summary or summary-tabs. See display modes. | |
| height | string |
Pixels (560) or a CSS length (70vh). The width fills the content column.
Default: 560. |
|
| zoom | integer 7-20 |
Initial zoom.
Default: 15. |
|
| map_style | integer 1-7 |
Basemap style.
Default: 1. |
|
| marker | string |
pin, circle (with circle_radius in metres, 50 to 2000) or custom (with custom_marker_url, custom_marker_width, custom_marker_height).
Default: pin. |
|
| accent_color | string |
Hex colour of the pin and highlights.
Default: #428BFF. |
|
| summary_background_color / summary_line_color | string | Hex colours of the summary background and separator lines. | |
| rounded | integer 0-15 |
Corner radius in pixels.
Default: 0. |
|
| isochrone | string | left, right or off. See Isochrones. | |
| route_from | string | left, right, popup or off. | |
| title | string | Accessible title of the iframe. | |
| class | string | Extra CSS class on the wrapper. |
Favourite addresses are switched on in the settings page: for logged-in visitors, the plugin passes a hash of their WordPress user id as userId. See Favorite addresses.
Developers
// Location from your own storage.
add_filter( 'yatmo_map_location', function ( $location, $atts ) {
if ( $location ) {
return $location;
}
$listing = my_listing_for( get_the_ID() );
return $listing ? array( 'lat' => $listing->lat, 'lng' => $listing->lng ) : null;
}, 10, 2 );
// Any iframe parameter, after the plugin has built them.
add_filter( 'yatmo_map_iframe_params', function ( $params, $atts ) {
$params['summaryBorder'] = '1';
return $params;
}, 10, 2 );
Upgrading from 1.x
Version 2 shows one property per embed, through the iframe plugin. On [yatmo-map], the old lat, lng, style and enable_isochrone attributes still work. [yatmo-marker] is ignored and prints nothing: give the location on [yatmo-map]. Multiple markers and marker popups are no longer available. The license key, language, zoom, style and isochrone settings are carried over.