Skip to content
  1. Extras
  2. YandexMaps2
  3. Plugin events
  4. Examples

Examples

Check which map triggered the plugin

Use $snippetProperties to see which map called the plugin:

Snippet call:

fenom
{'!YandexMaps2' | snippet: [
  'map' => 'custom-map',
  ...
]}

Plugin code:

php
switch ($modx->event->name) {
  case 'ymOnLoadObjects':
    if ($snippetProperties['map'] != 'custom-map') {
      break;
    }

    /**
     * Plugin logic
     */

    break;
}