Add Yandex Maps and Yandex Geocoder support#1868
Open
Teese999 wants to merge 3 commits intocode4recovery:mainfrom
Open
Add Yandex Maps and Yandex Geocoder support#1868Teese999 wants to merge 3 commits intocode4recovery:mainfrom
Teese999 wants to merge 3 commits intocode4recovery:mainfrom
Conversation
- Add map provider selection in settings (OpenStreetMap/Yandex Maps) - Add Yandex Maps API key configuration field - Implement dual map provider support in maps.js - Conditionally load Leaflet or Yandex Maps scripts based on selection - Support all existing map features (markers, popups, bounds, search) - Maintain backward compatibility with default Leaflet provider
- Fix map initialization to wait for ymaps.ready() callback - Add map_provider to admin localized script data - Fix map centering to use actual location coordinates instead of default Moscow - Ensure setMapMarkers is called after Yandex Maps API is fully loaded
- Add geocoding provider selection (default/Yandex) - Implement tsml_geocode_yandex() function using Yandex Geocoder API - Clear address cache when switching geocoding providers - Recommended for Russia, Ukraine, and CIS countries for accurate addresses - Fixes issue with addresses being incorrectly geocoded by default provider
joshreisner
reviewed
Feb 1, 2026
| wp_enqueue_style('leaflet', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css', [], '1.9.4'); | ||
| // Load map provider scripts | ||
| if ($tsml_map_provider == 'yandex' && !empty($tsml_yandex_api_key)) { | ||
| wp_enqueue_script('yandex-maps', 'https://api-maps.yandex.ru/2.1/?apikey=' . esc_attr($tsml_yandex_api_key) . '&lang=ru_RU', [], null, true); |
Contributor
There was a problem hiding this comment.
should the locale here be dynamic? esc_attr(get_locale())
Contributor
|
thanks for the contribution! we'll discuss it at our next team meeting - saturday at 1pm New York time - you'd be welcome to join us if that time works for you |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for Yandex Maps as an alternative map provider and Yandex Geocoder for accurate address geocoding in Russia, Ukraine, and CIS countries.
Motivation
The default geocoding service (geo.code4recovery.org) sometimes provides inaccurate results for addresses in Russia, Ukraine, and other CIS countries. Yandex services are more accurate for these regions.
Changes
Map Display
maps.jsGeocoding
tsml_geocode_yandex()function using Yandex Geocoder APIAdmin Panel
map_providerto admin localized script dataymaps.ready()callbackBackward Compatibility
✅ Fully backward compatible - no breaking changes
Configuration
Users can enable Yandex features in Meetings → Settings:
Testing
Use Cases
Recommended for:
Example:
https://na-rnd.ru/meetings/donbass-2/