What this solution does
Purpose
The module provides centralized management for Yandex Maps API connections by replacing all direct links to api-maps.yandex.ru with a single URL configured in the settings. This prevents conflicts and errors that occur when multiple modules (awz.ydelivery, awz.belpost, awz.europost) operate simultaneously using different keys or versions of the ymaps library.
Key Features
Automatic script replacement: The module intercepts the page HTML content and substitutes all requests to api-maps.yandex.ru with the address specified in the configuration.
Flexible control: The ability to enable or disable the module for individual sites within multi-site solutions.
URL-based exclusions: Configuration of rules to disable the module on specific pages using regular expressions.
Parameter-based exclusions: The option to disable functionality on pages containing specific GET parameters.
Automatic key retrieval: If modules awz.ydelivery, awz.belpost, awz.europost, or fileman are installed, the system attempts to automatically extract and use API keys from their settings.
Enterprise support: When an Enterprise version key is available, the module automatically switches the connection to enterprise.api-maps.yandex.ru.
How it works
The AWZ: Yandex Maps Conflict Resolution module integrates with the Bitrix core via the OnEndBufferContent event. Processing occurs only at the final stage of HTML page generation for standard GET requests, explicitly excluding the administrative panel, POST requests, and AJAX calls. In multisite projects, settings are retrieved specifically for the current site (SITE_ID). Before execution, the script checks the current URL and GET parameters against regular expressions to disable the module if required.
The code processing algorithm searches for all tags containing the api-maps.yandex.ru connection. The first found connection is replaced with the URL specified in the settings, appending the #awzfixymap marker for subsequent cleanup. All other duplicate connections to Yandex Maps are removed. The #awzfixymap marker is also stripped from the final HTML output.
Installation involves automatic registration within the system, which triggers the connection of the event handler. Configuration is managed via the administrative section 'Module Settings' → 'AWZ: Yandex Maps Conflict Resolution Module Settings'. In multisite configurations, settings are stored separately for each site, allowing flexible control over module behavior. The primary option 'Enable Module (ACTIVE)' allows activation or deactivation of the functionality on the current site; the default value is set to 'No'.
AWZ: Yandex Maps Conflict Resolution
Ymaps Library URL
Enter the full URL to connect the ymaps library. If left empty, the address will be generated automatically based on keys defined in other modules.
Disable on pages with GET parameters (DSBL_GET)
List GET parameters separated by commas. The module will remain inactive if any of these parameters are present in the URL. For example, specifying preview,edit will disable the module on pages like /catalog/?preview=1 or /product/?edit=true.
Disable by regular expression (DSBL_REJ)
Enter a list of regular expressions, each on a new line. If the current URL matches any of them, the module will not run. Examples:
/catalog/ — exact path match (applies to /catalog/index.php).
#\/catalog\/*#i — regular expression (does not apply to */catalog/*).
These rules take precedence over enable rules.
Enable by regular expression (ENBL_REJ)
Specify a list of regular expressions, each on a new line. If at least one expression is provided, the module will function only on pages matching these patterns.
Access Rights
User group access permissions are configured in a separate settings tab.
General iT can install and configure this module and check how it works on your website.