{% block yandex_maps_widget %}
    <div id="{{ id }}" class="{{ attr.class }}" style="width: {{ width }}px; height: {{ height }}px;"></div>

    {% for child in form %}
        {% if child.vars.value is empty %}
            {{ form_row(child, {
                value: default[ child.vars.name ]
            }) }}
        {% else %}
            {{ form_row(child) }}
        {% endif %}
    {% endfor %}

    <script>
        new YandexMapsWidgetClass('{{ id }}', {{ parameters | json_encode | raw }});
    </script>
{% endblock %}

{% block yandex_maps_widget %}
    <div id="{{ id }}" class="{{ attr.class }}" style="width: {{ width }}px; height: {{ height }}px;"></div>

    {% for child in form %}
        {% if child.vars.value is empty %}
            {{ form_row(child, {
                value: default[ child.vars.name ]
            }) }}
        {% else %}
            {{ form_row(child) }}
        {% endif %}
    {% endfor %}

    <script>
        var {{ name }}YandexMap = new YandexMapsWidgetClass('{{ id }}', {{ parameters | json_encode | raw }});
    </script>
{% endblock %}

Add ability to access the map object
Add ability to access the map object