Plugin Directory

Changeset 3451258


Ignore:
Timestamp:
02/01/2026 07:24:00 AM (5 weeks ago)
Author:
ali7ali
Message:

Modernized Google Maps loader

Location:
alpha-google-map-for-elementor/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • alpha-google-map-for-elementor/trunk/README.md

    r3276970 r3451258  
    1414**Tags:** google-map, google, elementor, maps, page builder 
    1515**Requires at least:** 6.0 
    16 **Tested up to:** 6.8 
     16**Tested up to:** 6.9 
    1717**Requires PHP:** 7.4 
    18 **Stable tag:** 1.3 
     18**Stable tag:** 1.4.0 
    1919**License:** [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html)
    2020
     
    3030- Customizable info-box with image gallery support
    3131- Extensive map controls
     32- Optional Map ID (Cloud Styling) support with locale-aware Google Maps loader
    3233- Responsive Live Editing within Elementor
    3334- Compatibility with the latest Google Maps API standards
     
    7576## Upgrade Notice
    7677
    77 ### 1.3
     78### 1.4
    7879
    79 Compatibility for WP 6.8
    80 Feature: One finger scroll on mobile (GestureHandling)
     80Modernized Google Maps loader
    8181
    8282## Frequently Asked Questions
     
    9797
    9898## Changelog
     99
     100### 1.4.0 - 2026-02-01
     101
     102- Modernized Google Maps loader (async, locale-aware) with optional Map ID support.
     103- Conditional Elementor asset loading to avoid loading scripts/styles on pages without the widget.
     104- Improved multi-instance safety and marker/gallery handling.
     105- Activation-only copy of default pin assets for backward compatibility.
    99106
    100107### 1.3 - 2025-04-19
  • alpha-google-map-for-elementor/trunk/alpha-google-map-for-elementor.php

    r3276970 r3451258  
    66 * Author:      Ali Ali
    77 * Author URI:  https://github.com/Ali7Ali
    8  * Version:     1.3
     8 * Version:     1.4.0
    99 * Text Domain: alpha-google-map-for-elementor
    1010 * Domain Path: /languages
     
    3636}
    3737
    38 define( 'ALPHAMAP_VERSION', '1.3' );
     38define( 'ALPHAMAP_VERSION', '1.4.0' );
    3939define( 'ALPHAMAP_ADDONS_PL_ROOT', __FILE__ );
    4040define( 'ALPHAMAP_PL_URL', plugins_url( '/', ALPHAMAP_ADDONS_PL_ROOT ) );
     
    4444define( 'ALPHAMAP_PL_LANGUAGES', trailingslashit( ALPHAMAP_PL_PATH . 'languages' ) );
    4545define( 'ALPHAMAP_PLUGIN_BASE', plugin_basename( ALPHAMAP_ADDONS_PL_ROOT ) );
     46
     47/**
     48 * Plugin activation hook.
     49 */
     50function alpha_google_map_activate(): void {
     51    include_once ALPHAMAP_PL_INCLUDE . '/class-alpha-google-map.php';
     52
     53    if ( class_exists( '\AlphaGoogleMap\Alpha_Google_Map' ) ) {
     54        \AlphaGoogleMap\Alpha_Google_Map::activate();
     55    }
     56}
     57register_activation_hook( __FILE__, 'alpha_google_map_activate' );
    4658
    4759/**
  • alpha-google-map-for-elementor/trunk/assets/css/alpha-map-widget.css

    r2541250 r3451258  
    1 .alpha-map-info-container{margin-top:10px;margin-bottom:10px;}.alpha-map-info-desc,.alpha-map-info-time-desc,.alpha-map-info-title{margin:0;padding:0}.alpha-map-container .gm-style-iw{text-align:center}.alpha-map-container .gm-style img{max-width:none!important}.alpha-image-gallery{margin:30px 3px 5px 3px}.gallery,.alpha-image-gallery{display:flex;flex-direction:row;max-height:85px;max-width:394px}.alpha-image-gallery .gallery .gallery-item{position:relative;text-align:center;color:#fff}.alpha-image-gallery .gallery img{width:85px;height:85px;margin:0 3px}.alpha-image-gallery figure:nth-child(n+5){display:none}.alpha-google-map-title{position:absolute;z-index:9;width:100%}.alpha-google-map-title .alpha-map-title.elementor-size-xxl{font-size:15px}.alpha-google-map-title .alpha-map-title.elementor-size-medium{font-size:19px}.alpha-google-map-title.alpha-map-title.elementor-size-large{font-size:29px}.alpha-google-map-title .alpha-map-title.elementor-size-xl{font-size:39px}.alpha-google-map-title .alpha-map-title.elementor-size-xxl{font-size:59px}
     1.alpha-map-info-container{margin-top:10px;margin-bottom:10px;}.alpha-map-info-desc,.alpha-map-info-time-desc,.alpha-map-info-title{margin:0;padding:0}.alpha-map-container .gm-style-iw{text-align:center}.alpha-map-container .gm-style img{max-width:none!important}.alpha-image-gallery{margin:30px 3px 5px 3px}.gallery,.alpha-image-gallery{display:flex;flex-direction:row;max-height:85px;max-width:394px}.alpha-image-gallery .gallery .gallery-item{position:relative;text-align:center;color:#fff}.alpha-image-gallery .gallery img{width:85px;height:85px;margin:0 3px}.alpha-image-gallery figure:nth-child(n+5){display:none}.alpha-google-map-title{position:absolute;z-index:9;width:100%}.alpha-google-map-title .alpha-map-title.elementor-size-xxl{font-size:15px}.alpha-google-map-title .alpha-map-title.elementor-size-medium{font-size:19px}.alpha-google-map-title.alpha-map-title.elementor-size-large{font-size:29px}.alpha-google-map-title .alpha-map-title.elementor-size-xl{font-size:39px}.alpha-google-map-title .alpha-map-title.elementor-size-xxl{font-size:59px}.alpha-gallery-more{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);color:#fff;font-size:16px;font-weight:600;white-space:nowrap;pointer-events:none}
  • alpha-google-map-for-elementor/trunk/assets/js/alpha-map.js

    r3276970 r3451258  
    1 jQuery(window).on("elementor/frontend/init", function () {
    2 
    3     elementorFrontend.hooks.addAction(
    4         "frontend/element_ready/alpha-google-map.default",
    5         function ($scope, $) {
    6 
    7             var mapElement = $scope.find(".alpha_map_height");
    8 
    9             var mapSettings = mapElement.data("settings");
    10 
    11             var mapStyle = mapElement.data("style");
    12 
    13             var alphaMapMarkers = [];
    14 
    15             var selectedMarker = {};
    16 
    17             alphaMap = newMap(mapElement, mapSettings, mapStyle);
    18 
    19             function newMap(map, settings, mapStyle) {
    20                 var scrollwheel = JSON.parse(settings["scrollwheel"]);
    21                 var streetViewControl = JSON.parse(settings["streetViewControl"]);
    22                 var fullscreenControl = JSON.parse(settings["fullScreen"]);
    23                 var zoomControl = JSON.parse(settings["zoomControl"]);
    24                 var mapTypeControl = JSON.parse(settings["typeControl"]);
    25                 var locationLat = JSON.parse(settings["locationlat"]);
    26                 var locationLong = JSON.parse(settings["locationlong"]);
    27                 var autoOpen = JSON.parse(settings["automaticOpen"]);
    28                 var hoverOpen = JSON.parse(settings["hoverOpen"]);
    29                 var hoverClose = JSON.parse(settings["hoverClose"]);
    30                 var args = {
    31                     zoom: settings["zoom"],
    32                     mapTypeId: settings["maptype"],
    33                     center: { lat: locationLat, lng: locationLong },
    34                     scrollwheel: scrollwheel,
    35                     streetViewControl: streetViewControl,
    36                     fullscreenControl: fullscreenControl,
    37                     zoomControl: zoomControl,
    38                     mapTypeControl: mapTypeControl,
    39                     styles: mapStyle
    40                 };
    41 
    42                 if ( settings.gestureHandling ) {
    43                     args.gestureHandling = settings.gestureHandling;
    44                 }
    45 
    46                 if ( "yes" === settings.drag ) {
    47                     args.gestureHandling = 'none';
    48                 }
    49 
    50                 var markers = map.find(".alpha-pin");
    51 
    52                 var map = new google.maps.Map(map[0], args);
    53 
    54                 map.markers = [];
    55                 var prev_infowindow = false;
    56                 // add markers
    57                 markers.each(function () {
    58                     add_marker(jQuery(this), map, autoOpen, hoverOpen, hoverClose);
    59                 });
    60 
    61                 return map;
    62             }
    63 
    64             function add_marker(pin, map, autoOpen, hoverOpen, hoverClose) {
    65                 var latlng = new google.maps.LatLng(
    66                     pin.attr("data-lat"),
    67                     pin.attr("data-lng")
    68                 ),
    69                     icon_img = pin.attr("data-icon"),
    70                     icon_hover_img = pin.attr("data-icon-active"),
    71                     maxWidth = pin.attr("data-max-width"),
    72                     customID = pin.attr("data-id"),
    73                     iconSize = parseInt(pin.attr("data-icon-size"));
    74 
    75                 if (icon_img != "") {
    76                     var icon = {
    77                         url: pin.attr("data-icon")
    78                     };
    79 
    80                     if (icon_hover_img != "") {
    81                         icon.hover = pin.attr("data-icon-active");
    82                     }
    83 
    84                     if (iconSize) {
    85 
    86                         icon.scaledSize = new google.maps.Size(iconSize, iconSize);
    87                         icon.origin = new google.maps.Point(0, 0);
    88                         icon.anchor = new google.maps.Point(iconSize / 2, iconSize);
    89                     }
    90                 }
    91 
    92 
    93                 // create marker
    94                 var marker = new google.maps.Marker({
    95                     position: latlng,
    96                     map: map,
    97                     icon: icon,
    98                     marker_id: customID
    99                 });
    100 
    101 
    102                 // add to array
    103                 map.markers.push(marker);
    104 
    105                 alphaMapMarkers.push(marker);
    106 
    107 
    108                 // if marker contains HTML, add it to an infoWindow
    109                 if (
    110                     pin.find(".alpha-map-info-title").html() ||
    111                     pin.find(".alpha-map-info-desc").html()
    112                 ) {
    113                     // create info window
    114                     var infowindow = new google.maps.InfoWindow({
    115                         maxWidth: maxWidth,
    116                         content: pin.html()
    117                     });
    118                     var icon_url = marker.icon.url;
    119                     var icon_onHover = marker.icon.hover;
    120                     if (autoOpen) {
    121                         infowindow.open(map, marker);
    122                     }
    123                     if (hoverOpen) {
    124                         google.maps.event.addListener(marker, "mouseover", function () {
    125                             marker.setIcon(icon_onHover);
    126                             infowindow.open(map, marker);
    127                         });
    128                         if (hoverClose) {
    129                             google.maps.event.addListener(marker, "mouseout", function () {
    130                                 marker.setIcon(icon_url);
    131                                 infowindow.close(map, marker);
    132                             });
    133                         }
    134                     }
    135                     // show info window when marker is clicked
    136                     google.maps.event.addListener(marker, "click", function () {
    137                         if (typeof prev_infowindow !== 'undefined' && typeof selectedMarker !== 'undefined' && typeof selectedMarker.marker !== 'undefined') {
    138                             selectedMarker.marker.setIcon(selectedMarker.icon);
    139                             prev_infowindow.close();
    140                         }
    141                         marker.setIcon(icon_onHover);
    142                         selectedMarker.marker = marker;
    143                         selectedMarker.icon = icon_url;
    144                         infowindow.open(map, marker);
    145                         prev_infowindow = infowindow;
    146                     });
    147                     google.maps.event.addListener(map, "click", function (event) {
    148                         if (selectedMarker) {
    149                             selectedMarker.marker.setIcon(selectedMarker.icon);
    150                         }
    151                         infowindow.close();
    152                     });
    153                 }
    154             }
    155         }
    156     );
    157 });
    158 
    159 jQuery(function () {
    160     jQuery("body").click(function (e) {
    161         let count = jQuery('.alpha-image-gallery').attr("data-count");
    162         count = parseInt(count);
    163         jQuery('.alpha-image-gallery').find("figure:nth-child(4)").append('<div style="position: absolute; color: #fff; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; font-weight: 600; white-space: nowrap;">' + count + ' more </div>');
    164     });
    165 });
     1(function ($) {
     2    const MAP_READY_MAX_TRIES = 20;
     3    const MAP_READY_DELAY = 150;
     4
     5    const waitForGoogleMaps = () =>
     6        new Promise((resolve, reject) => {
     7            let attempts = 0;
     8            const timer = setInterval(() => {
     9                attempts += 1;
     10                if (
     11                    window.google &&
     12                    window.google.maps &&
     13                    typeof window.google.maps.Map === 'function'
     14                ) {
     15                    clearInterval(timer);
     16                    resolve(window.google.maps);
     17                    return;
     18                }
     19
     20                if (attempts >= MAP_READY_MAX_TRIES) {
     21                    clearInterval(timer);
     22                    reject(new Error('Google Maps failed to load'));
     23                }
     24            }, MAP_READY_DELAY);
     25        });
     26
     27    const applyGalleryOverlay = ($root) => {
     28        $root.find('.alpha-image-gallery').each(function () {
     29            const $gallery = $(this);
     30            const remaining = parseInt($gallery.attr('data-count'), 10) || 0;
     31
     32            if (remaining <= 0) {
     33                return;
     34            }
     35
     36            const $figures = $gallery.find('figure');
     37            const $items = $figures.length ? $figures : $gallery.find('.gallery-item');
     38            const $target = $items.eq(3);
     39
     40            if (!$target.length || $target.find('.alpha-gallery-more').length) {
     41                return;
     42            }
     43
     44            $('<div class="alpha-gallery-more" />')
     45                .text(`${remaining} more`)
     46                .appendTo($target);
     47        });
     48    };
     49
     50    const addMarker = ({ $pin, map, settings, state }) => {
     51        const lat = parseFloat($pin.attr('data-lat'));
     52        const lng = parseFloat($pin.attr('data-lng'));
     53
     54        if (Number.isNaN(lat) || Number.isNaN(lng)) {
     55            return;
     56        }
     57
     58        const iconUrl = $pin.attr('data-icon');
     59        const hoverIconUrl = $pin.attr('data-icon-active');
     60        const iconSize = parseInt($pin.attr('data-icon-size'), 10);
     61        let icon = null;
     62
     63        if (iconUrl) {
     64            icon = { url: iconUrl };
     65
     66            if (iconSize) {
     67                icon.scaledSize = new google.maps.Size(iconSize, iconSize);
     68                icon.origin = new google.maps.Point(0, 0);
     69                icon.anchor = new google.maps.Point(iconSize / 2, iconSize);
     70            }
     71
     72            if (hoverIconUrl) {
     73                icon.hover = hoverIconUrl;
     74            }
     75        }
     76
     77        const markerOptions = {
     78            position: { lat, lng },
     79            map,
     80            marker_id: $pin.attr('data-id'),
     81        };
     82
     83        if (icon) {
     84            markerOptions.icon = icon;
     85        }
     86
     87        const marker = new google.maps.Marker(markerOptions);
     88
     89        const hasInfo =
     90            $pin.find('.alpha-map-info-title').length ||
     91            $pin.find('.alpha-map-info-desc').length ||
     92            $pin.find('.alpha-map-info-time-desc').length;
     93
     94        if (!hasInfo) {
     95            return;
     96        }
     97
     98        applyGalleryOverlay($pin);
     99
     100        const infoWindow = new google.maps.InfoWindow({
     101            maxWidth: parseInt($pin.attr('data-max-width'), 10) || undefined,
     102            content: $pin.html(),
     103        });
     104
     105        const defaultIconUrl = icon && icon.url ? icon.url : null;
     106        const activeIconUrl = icon && icon.hover ? icon.hover : null;
     107
     108        if (settings.automaticOpen) {
     109            infoWindow.open(map, marker);
     110            state.activeInfo = infoWindow;
     111            state.activeMarker = marker;
     112        }
     113
     114        if (settings.hoverOpen) {
     115            marker.addListener('mouseover', () => {
     116                if (activeIconUrl && marker.setIcon) {
     117                    marker.setIcon(activeIconUrl);
     118                }
     119                infoWindow.open(map, marker);
     120            });
     121
     122            if (settings.hoverClose) {
     123                marker.addListener('mouseout', () => {
     124                    if (defaultIconUrl && marker.setIcon) {
     125                        marker.setIcon(defaultIconUrl);
     126                    }
     127                    infoWindow.close();
     128                });
     129            }
     130        }
     131
     132        marker.addListener('click', () => {
     133            if (state.activeMarker && state.activeMarker !== marker) {
     134                if (state.activeMarker.setIcon && defaultIconUrl) {
     135                    state.activeMarker.setIcon(defaultIconUrl);
     136                }
     137                if (state.activeInfo) {
     138                    state.activeInfo.close();
     139                }
     140            }
     141
     142            if (activeIconUrl && marker.setIcon) {
     143                marker.setIcon(activeIconUrl);
     144            }
     145
     146            state.activeMarker = marker;
     147            state.activeInfo = infoWindow;
     148            infoWindow.open(map, marker);
     149        });
     150
     151        map.addListener('click', () => {
     152            if (state.activeMarker && defaultIconUrl && state.activeMarker.setIcon) {
     153                state.activeMarker.setIcon(defaultIconUrl);
     154            }
     155            if (state.activeInfo) {
     156                state.activeInfo.close();
     157            }
     158        });
     159    };
     160
     161    const initMapInstance = ($scope) => {
     162        const $mapElement = $scope.find('.alpha_map_height');
     163
     164        if (!$mapElement.length) {
     165            return;
     166        }
     167
     168        const settings = $mapElement.data('settings') || {};
     169        const centerLat = parseFloat(settings.locationlat);
     170        const centerLng = parseFloat(settings.locationlong);
     171
     172        if (Number.isNaN(centerLat) || Number.isNaN(centerLng)) {
     173            return;
     174        }
     175
     176        const mapOptions = {
     177            zoom: Number(settings.zoom) || 12,
     178            mapTypeId: settings.maptype || 'roadmap',
     179            center: { lat: centerLat, lng: centerLng },
     180            scrollwheel: Boolean(settings.scrollwheel),
     181            streetViewControl: Boolean(settings.streetViewControl),
     182            fullscreenControl: Boolean(settings.fullScreen),
     183            zoomControl: Boolean(settings.zoomControl),
     184            mapTypeControl: Boolean(settings.typeControl),
     185            gestureHandling: settings.gestureHandling || 'auto',
     186        };
     187
     188        if (settings.mapId) {
     189            mapOptions.mapId = settings.mapId;
     190        }
     191
     192        if (settings.drag) {
     193            mapOptions.gestureHandling = 'none';
     194            mapOptions.draggable = false;
     195        }
     196
     197        const mapStyle = $mapElement.data('style');
     198        if (mapStyle) {
     199            mapOptions.styles = mapStyle;
     200        }
     201
     202        // Capture pins before Google Maps mutates the DOM.
     203        const $pins = $mapElement.find('.alpha-pin');
     204
     205        const map = new google.maps.Map($mapElement[0], mapOptions);
     206        const state = {
     207            activeMarker: null,
     208            activeInfo: null,
     209        };
     210
     211        $pins.each(function () {
     212            addMarker({
     213                $pin: $(this),
     214                map,
     215                settings: {
     216                    automaticOpen: Boolean(settings.automaticOpen),
     217                    hoverOpen: Boolean(settings.hoverOpen),
     218                    hoverClose: Boolean(settings.hoverClose),
     219                },
     220                state,
     221            });
     222        });
     223
     224        applyGalleryOverlay($scope);
     225    };
     226
     227    const bootstrap = () => {
     228        elementorFrontend.hooks.addAction('frontend/element_ready/alpha-google-map.default', ($scope) => {
     229            const config = window.AlphaMapConfig || {};
     230
     231            if (!config.hasApiKey) {
     232                if (config.missingApiKeyMessage) {
     233                    console.warn(config.missingApiKeyMessage);
     234                }
     235                return;
     236            }
     237
     238            const hasMapCtor =
     239                window.google &&
     240                window.google.maps &&
     241                typeof window.google.maps.Map === 'function';
     242
     243            const ready = hasMapCtor ? Promise.resolve(window.google.maps) : waitForGoogleMaps();
     244
     245            ready
     246                .then(() => initMapInstance($scope))
     247                .catch(() => {
     248                    console.warn('Alpha Google Map: Google Maps failed to load.');
     249                });
     250        });
     251    };
     252
     253    $(window).on('elementor/frontend/init', bootstrap);
     254})(jQuery);
  • alpha-google-map-for-elementor/trunk/include/class-alpha-google-map-widget.php

    r3276970 r3451258  
    7373
    7474    /**
     75     * Widget styles dependencies.
     76     *
     77     * @return array
     78     */
     79    public function get_style_depends(): array {
     80        return array( 'alphamap-widget' );
     81    }
     82
     83    /**
     84     * Widget script dependencies.
     85     *
     86     * @return array
     87     */
     88    public function get_script_depends(): array {
     89        return array( 'alphamap' );
     90    }
     91
     92    /**
    7593     * Register widget controls.
    7694     */
     
    304322        );
    305323
     324        $this->add_control(
     325            'alpha_map_id',
     326            array(
     327                'label'       => __( 'Map ID (Cloud Styling)', 'alpha-google-map-for-elementor' ),
     328                'type'        => Controls_Manager::TEXT,
     329                'description' => __( 'Optional. Provide a Google Maps Map ID for Cloud-based map styling.', 'alpha-google-map-for-elementor' ),
     330                'label_block' => true,
     331            )
     332        );
     333
    306334        $this->add_responsive_control(
    307335            'alpha_map_height',
     
    957985        $settings = $this->get_settings_for_display();
    958986
    959         $map_pins = $settings['alpha_map_pins'];
    960 
    961         $gesture = 'yes' === $settings['alpha_map_gesture_handling'] ? 'greedy' : 'auto';
    962 
    963         $street_view = 'yes' === $settings['alpha_map_option_streeview'] ? 'true' : 'false';
    964 
    965         $scroll_wheel = 'yes' === $settings['alpha_map_option_mapscroll'] ? 'true' : 'false';
    966 
    967         $full_screen = 'yes' === $settings['alpha_map_option_fullscreen_control'] ? 'true' : 'false';
    968 
    969         $zoom_control = 'yes' === $settings['alpha_map_option_zoom_controls'] ? 'true' : 'false';
    970 
    971         $type_control = 'yes' === $settings['alpha_map_option_map_type_control'] ? 'true' : 'false';
    972 
    973         $automatic_open = 'yes' === $settings['alpha_map_marker_open'] ? 'true' : 'false';
    974 
    975         $hover_open = 'yes' === $settings['alpha_map_marker_hover_open'] ? 'true' : 'false';
    976 
    977         $hover_close = 'yes' === $settings['alpha_map_marker_mouse_out'] ? 'true' : 'false';
     987        $map_pins = ! empty( $settings['alpha_map_pins'] ) && is_array( $settings['alpha_map_pins'] ) ? $settings['alpha_map_pins'] : array();
     988
     989        $gesture = ! empty( $settings['alpha_map_gesture_handling'] ) && 'yes' === $settings['alpha_map_gesture_handling'] ? 'greedy' : 'auto';
    978990
    979991        $locationlat = ! empty( $settings['alpha_location_lat'] ) ? sanitize_text_field( $settings['alpha_location_lat'] ) : '18.591212';
     
    981993        $locationlong = ! empty( $settings['alpha_location_long'] ) ? sanitize_text_field( $settings['alpha_location_long'] ) : '73.741261';
    982994
    983         $marker_width = ! empty( $settings['alpha_markers_width'] ) ? $settings['alpha_markers_width'] : 1000;
     995        $marker_width = ! empty( $settings['alpha_markers_width'] ) ? (int) $settings['alpha_markers_width'] : 1000;
     996
     997        $map_id = ! empty( $settings['alpha_map_id'] ) ? sanitize_text_field( $settings['alpha_map_id'] ) : '';
    984998
    985999        $map_settings = array(
    986             'zoom'              => $settings['alpha_map_zoom']['size'],
    987             'maptype'           => $settings['alpha_map_type'],
    988             'streetViewControl' => $street_view,
     1000            'zoom'              => isset( $settings['alpha_map_zoom']['size'] ) ? (int) $settings['alpha_map_zoom']['size'] : 12,
     1001            'maptype'           => isset( $settings['alpha_map_type'] ) ? sanitize_text_field( $settings['alpha_map_type'] ) : 'roadmap',
     1002            'streetViewControl' => ! empty( $settings['alpha_map_option_streeview'] ) && 'yes' === $settings['alpha_map_option_streeview'],
    9891003            'gestureHandling'   => $gesture,
    9901004            'locationlat'       => $locationlat,
    9911005            'locationlong'      => $locationlong,
    992             'scrollwheel'       => $scroll_wheel,
    993             'fullScreen'        => $full_screen,
    994             'zoomControl'       => $zoom_control,
    995             'typeControl'       => $type_control,
    996             'automaticOpen'     => $automatic_open,
    997             'hoverOpen'         => $hover_open,
    998             'hoverClose'        => $hover_close,
    999             'drag'              => $settings['disable_drag'],
     1006            'scrollwheel'       => ! empty( $settings['alpha_map_option_mapscroll'] ) && 'yes' === $settings['alpha_map_option_mapscroll'],
     1007            'fullScreen'        => ! empty( $settings['alpha_map_option_fullscreen_control'] ) && 'yes' === $settings['alpha_map_option_fullscreen_control'],
     1008            'zoomControl'       => ! empty( $settings['alpha_map_option_zoom_controls'] ) && 'yes' === $settings['alpha_map_option_zoom_controls'],
     1009            'typeControl'       => ! empty( $settings['alpha_map_option_map_type_control'] ) && 'yes' === $settings['alpha_map_option_map_type_control'],
     1010            'automaticOpen'     => ! empty( $settings['alpha_map_marker_open'] ) && 'yes' === $settings['alpha_map_marker_open'],
     1011            'hoverOpen'         => ! empty( $settings['alpha_map_marker_hover_open'] ) && 'yes' === $settings['alpha_map_marker_hover_open'],
     1012            'hoverClose'        => ! empty( $settings['alpha_map_marker_mouse_out'] ) && 'yes' === $settings['alpha_map_marker_mouse_out'],
     1013            'drag'              => ! empty( $settings['disable_drag'] ) && 'yes' === $settings['disable_drag'],
     1014            'mapId'             => $map_id,
    10001015        );
    10011016
     
    10091024
    10101025        ?>
    1011         <div class="alpha-map-container" id="alpha-map-container">
     1026        <div class="alpha-map-container" id="<?php echo esc_attr( 'alpha-map-container-' . sanitize_html_class( $this->get_id() ) ); ?>">
    10121027            <div class="alpha-google-map-title">
    10131028                <?php
     
    11031118
    11041119                        // Sanitize IDs.
    1105                         $ids        = array_map( 'intval', wp_list_pluck( $pin['pin_desc_gallery'], 'id' ) );
     1120                        $gallery_ids = ! empty( $pin['pin_desc_gallery'] ) && is_array( $pin['pin_desc_gallery'] ) ? $pin['pin_desc_gallery'] : array();
     1121                        $ids         = array_map( 'intval', wp_list_pluck( $gallery_ids, 'id' ) );
    11061122                        $count      = count( $ids );
    1107                         $data_count = absint( $count - 4 );
     1123                        $data_count = max( 0, $count - 4 );
    11081124                        $this->add_render_attribute( 'shortcode' . $index, 'ids', implode( ',', $ids ) );
    11091125
  • alpha-google-map-for-elementor/trunk/include/class-alpha-google-map.php

    r3276970 r3451258  
    8181
    8282    /**
    83      * Load the plugin text domain.
    84      */
    85     public function i18n(): void {
    86         load_plugin_textdomain( 'alpha-google-map-for-elementor', false, ALPHAMAP_PL_LANGUAGES );
    87     }
    88 
    89     /**
    9083     * Compatibility Checks
    9184     *
     
    122115     */
    123116    public function init(): void {
    124         $this->i18n();
    125 
    126         $this->add_assets();
    127         add_action( 'elementor/frontend/after_enqueue_styles', array( $this, 'frontend_styles' ) );
    128         add_action( 'elementor/frontend/after_register_scripts', array( $this, 'frontend_scripts' ) );
     117        add_action( 'elementor/frontend/after_register_styles', array( $this, 'register_frontend_styles' ) );
     118        add_action( 'elementor/frontend/after_register_scripts', array( $this, 'register_frontend_scripts' ) );
    129119
    130120        add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) );
     
    132122
    133123    /**
    134      * Loading plugin media assets.
    135      */
    136     public function add_assets(): void {
    137         if ( ! function_exists( 'WP_Filesystem' ) ) {
    138             include_once ABSPATH . 'wp-admin/includes/file.php';
    139         }
    140         WP_Filesystem();
    141         global $wp_filesystem;
    142 
    143         $upload_dir = wp_upload_dir( null, true );
    144         $dir        = trailingslashit( $upload_dir['basedir'] ) . 'alpha-map/';
    145 
    146         if ( ! $wp_filesystem->is_dir( $dir ) ) {
    147             $wp_filesystem->mkdir( $dir );
    148         }
    149 
    150         $plugin_assets_dir = ALPHAMAP_PL_ASSETS . 'img/';
    151 
    152         $files = array(
    153             'alpha-pin.png',
    154             'alpha-pin-hover.png',
    155         );
    156 
    157         foreach ( $files as $file ) {
    158             $destination = $dir . $file;
    159             if ( ! $wp_filesystem->exists( $destination ) ) {
    160                 $source = $plugin_assets_dir . $file;
    161 
    162                 if ( $wp_filesystem->exists( $source ) ) {
    163                     $contents = $wp_filesystem->get_contents( $source );
    164                     if ( ! empty( $contents ) ) {
    165                         $wp_filesystem->put_contents( $destination, $contents, FS_CHMOD_FILE );
    166                     }
    167                 }
    168             }
    169         }
     124     * Register plugin styles for Elementor widgets.
     125     */
     126    public function register_frontend_styles(): void {
     127        wp_register_style(
     128            'alphamap-widget',
     129            ALPHAMAP_PL_ASSETS . 'css/alpha-map-widget.css',
     130            array(),
     131            ALPHAMAP_VERSION
     132        );
    170133    }
    171134
     
    280243
    281244    /**
    282      * Loading plugin css.
    283      */
    284     public function frontend_styles(): void {
    285         wp_enqueue_style( 'alphamap-widget', ALPHAMAP_PL_ASSETS . 'css/alpha-map-widget.css', '', ALPHAMAP_VERSION );
    286     }
    287 
    288     /**
    289      * Loading plugin JavaScript.
    290      */
    291     public function frontend_scripts(): void {
    292         // Script register.
    293         wp_enqueue_script(
     245     * Register plugin scripts for Elementor widgets.
     246     */
     247    public function register_frontend_scripts(): void {
     248        $api_key     = trim( (string) get_option( 'elementor_google_maps_api_key' ) );
     249        $maps_handle = 'alpha-google-maps-api';
     250        $script_deps = array( 'jquery' );
     251
     252        if ( ! empty( $api_key ) ) {
     253            $maps_api_url = $this->build_maps_api_url( $api_key );
     254
     255            if ( ! wp_script_is( $maps_handle, 'registered' ) ) {
     256                wp_register_script(
     257                    $maps_handle,
     258                    $maps_api_url,
     259                    array(),
     260                    ALPHAMAP_VERSION,
     261                    array(
     262                        'in_footer' => true,
     263                        'strategy'  => 'defer',
     264                    )
     265                );
     266            }
     267            $script_deps[] = $maps_handle;
     268        }
     269
     270        wp_register_script(
    294271            'alphamap',
    295272            ALPHAMAP_PL_ASSETS . 'js/alpha-map.js',
    296             array( 'jquery', 'alpha-api-js' ),
     273            $script_deps,
    297274            ALPHAMAP_VERSION,
    298275            array(
     
    302279        );
    303280
    304         // get an option.
    305         $api_key = get_option( 'elementor_google_maps_api_key' );
    306 
    307         $api = sprintf( 'https://maps.googleapis.com/maps/api/js?key=%1$s&language=en&callback=blur', $api_key );
    308         wp_enqueue_script(
    309             'alpha-api-js',
    310             $api,
    311             array(),
    312             '1.0.0',
    313             array(
    314                 'in_footer' => true,
    315                 'strategy'  => 'defer',
    316             )
    317         );
     281        $locale   = determine_locale();
     282        $language = $this->get_language_from_locale( $locale );
     283        $region   = $this->get_region_from_locale( $locale );
     284
     285        $config = array(
     286            'hasApiKey'            => ! empty( $api_key ),
     287            'missingApiKeyMessage' => __( 'Google Maps API key is missing. Set it under Elementor > Settings > Integrations.', 'alpha-google-map-for-elementor' ),
     288            'language'             => $language,
     289            'region'               => $region,
     290        );
     291
     292        wp_localize_script( 'alphamap', 'AlphaMapConfig', $config );
     293    }
     294
     295    /**
     296     * Build the Google Maps API URL using locale-aware params.
     297     *
     298     * @param string $api_key API key.
     299     */
     300    private function build_maps_api_url( string $api_key ): string {
     301        $locale   = determine_locale();
     302        $language = $this->get_language_from_locale( $locale );
     303        $region   = $this->get_region_from_locale( $locale );
     304
     305        $params = array(
     306            'key'     => $api_key,
     307            'v'       => 'weekly',
     308            'loading' => 'async',
     309        );
     310
     311        if ( $language ) {
     312            $params['language'] = $language;
     313        }
     314
     315        if ( $region ) {
     316            $params['region'] = $region;
     317        }
     318
     319        $params = apply_filters( 'alphamap_google_maps_params', $params );
     320
     321        return add_query_arg( $params, 'https://maps.googleapis.com/maps/api/js' );
     322    }
     323
     324    /**
     325     * Extract language code from locale.
     326     *
     327     * @param string $locale WordPress locale.
     328     */
     329    private function get_language_from_locale( string $locale ): string {
     330        if ( preg_match( '/^[a-zA-Z]{2}/', $locale, $matches ) ) {
     331            return strtolower( $matches[0] );
     332        }
     333        return '';
     334    }
     335
     336    /**
     337     * Extract region code from locale.
     338     *
     339     * @param string $locale WordPress locale.
     340     */
     341    private function get_region_from_locale( string $locale ): string {
     342        if ( preg_match( '/_[a-zA-Z]{2}$/', $locale, $matches ) ) {
     343            return strtoupper( str_replace( '_', '', $matches[0] ) );
     344        }
     345        return '';
     346    }
     347
     348    /**
     349     * Plugin activation tasks.
     350     */
     351    public static function activate(): void {
     352        self::copy_pin_assets();
     353    }
     354
     355    /**
     356     * Copy default pin assets to the uploads folder for backward compatibility.
     357     */
     358    private static function copy_pin_assets(): void {
     359        if ( ! function_exists( 'WP_Filesystem' ) ) {
     360            include_once ABSPATH . 'wp-admin/includes/file.php';
     361        }
     362
     363        WP_Filesystem();
     364        global $wp_filesystem;
     365
     366        if ( ! $wp_filesystem ) {
     367            return;
     368        }
     369
     370        $upload_dir = wp_upload_dir( null, true );
     371
     372        if ( empty( $upload_dir['basedir'] ) ) {
     373            return;
     374        }
     375
     376        $destination_dir = trailingslashit( $upload_dir['basedir'] ) . 'alpha-map/';
     377
     378        if ( ! $wp_filesystem->is_dir( $destination_dir ) ) {
     379            $wp_filesystem->mkdir( $destination_dir );
     380        }
     381
     382        $source_dir = trailingslashit( ALPHAMAP_PL_PATH . 'assets/img' );
     383
     384        $files = array(
     385            'alpha-pin.png',
     386            'alpha-pin-hover.png',
     387        );
     388
     389        foreach ( $files as $file ) {
     390            $source      = $source_dir . $file;
     391            $destination = $destination_dir . $file;
     392
     393            if ( $wp_filesystem->exists( $destination ) || ! $wp_filesystem->exists( $source ) ) {
     394                continue;
     395            }
     396
     397            $contents = $wp_filesystem->get_contents( $source );
     398
     399            if ( ! empty( $contents ) ) {
     400                $wp_filesystem->put_contents( $destination, $contents, FS_CHMOD_FILE );
     401            }
     402        }
    318403    }
    319404
  • alpha-google-map-for-elementor/trunk/languages/alpha-google-map-for-elementor.pot

    r3276970 r3451258  
    1 # Copyright (C) 2025 Ali Ali
     1# Copyright (C) 2026 Ali Ali
    22# This file is distributed under the GPLv3.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Alpha Google Map For Elementor 1.3\n"
     5"Project-Id-Version: Alpha Google Map For Elementor 1.4.0\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/alpha-google-map-for-elementor\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-04-17T10:34:32+00:00\n"
     12"POT-Creation-Date: 2026-02-01T07:06:36+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.11.0\n"
     
    1717#. Plugin Name of the plugin
    1818#: alpha-google-map-for-elementor.php
    19 #: include/class-alpha-google-map.php:184
    20 #: include/class-alpha-google-map.php:231
    21 #: include/class-alpha-google-map.php:262
     19#: include/class-alpha-google-map.php:147
     20#: include/class-alpha-google-map.php:194
     21#: include/class-alpha-google-map.php:225
    2222msgid "Alpha Google Map For Elementor"
    2323msgstr ""
     
    4747msgstr ""
    4848
    49 #: include/class-alpha-google-map-widget.php:81
     49#: include/class-alpha-google-map-widget.php:99
    5050msgid "Map Window Location"
    5151msgstr ""
    5252
    5353#. translators: 1: Integration settings link open tag, 2: Create API key link open tag, 3: Link close tag.
    54 #: include/class-alpha-google-map-widget.php:93
     54#: include/class-alpha-google-map-widget.php:111
    5555msgid "Set your Google Maps API Key in Elementor's %1$sIntegrations Settings%3$s page. Create your key %2$shere.%3$s"
    5656msgstr ""
    5757
    5858#. translators: 1: Demo link open tag, 2: Link close tag.
    59 #: include/class-alpha-google-map-widget.php:109
     59#: include/class-alpha-google-map-widget.php:127
    6060msgid "Check this widget demo %1$shere%2$s."
    6161msgstr ""
    6262
    63 #: include/class-alpha-google-map-widget.php:120
     63#: include/class-alpha-google-map-widget.php:138
    6464msgid "Location Latitude"
    6565msgstr ""
    6666
    67 #: include/class-alpha-google-map-widget.php:123
     67#: include/class-alpha-google-map-widget.php:141
    6868msgid "Enter your location latitude"
    6969msgstr ""
    7070
    71 #: include/class-alpha-google-map-widget.php:132
     71#: include/class-alpha-google-map-widget.php:150
    7272msgid "Location Longitude"
    7373msgstr ""
    7474
    75 #: include/class-alpha-google-map-widget.php:135
     75#: include/class-alpha-google-map-widget.php:153
    7676msgid "Enter your location longitude"
    7777msgstr ""
    7878
    79 #: include/class-alpha-google-map-widget.php:146
     79#: include/class-alpha-google-map-widget.php:164
    8080msgid "Markers"
    8181msgstr ""
    8282
    83 #: include/class-alpha-google-map-widget.php:153
     83#: include/class-alpha-google-map-widget.php:171
    8484msgid "Max Width"
    8585msgstr ""
    8686
    87 #: include/class-alpha-google-map-widget.php:155
     87#: include/class-alpha-google-map-widget.php:173
    8888msgid "Set the Maximum width for markers description box"
    8989msgstr ""
    9090
    91 #: include/class-alpha-google-map-widget.php:164
     91#: include/class-alpha-google-map-widget.php:182
    9292msgid "Custom Icon"
    9393msgstr ""
    9494
    95 #: include/class-alpha-google-map-widget.php:176
     95#: include/class-alpha-google-map-widget.php:194
    9696msgid "Icon On Active Pin"
    9797msgstr ""
    9898
    99 #: include/class-alpha-google-map-widget.php:189
    100 #: include/class-alpha-google-map-widget.php:789
     99#: include/class-alpha-google-map-widget.php:207
     100#: include/class-alpha-google-map-widget.php:817
    101101msgid "Size"
    102102msgstr ""
    103103
    104 #: include/class-alpha-google-map-widget.php:208
     104#: include/class-alpha-google-map-widget.php:226
    105105msgid "Pin Latitude"
    106106msgstr ""
    107107
    108 #: include/class-alpha-google-map-widget.php:218
     108#: include/class-alpha-google-map-widget.php:236
    109109msgid "Pin Longitude"
    110110msgstr ""
    111111
    112 #: include/class-alpha-google-map-widget.php:228
    113 #: include/class-alpha-google-map-widget.php:435
     112#: include/class-alpha-google-map-widget.php:246
     113#: include/class-alpha-google-map-widget.php:463
    114114msgid "Title"
    115115msgstr ""
    116116
    117 #: include/class-alpha-google-map-widget.php:238
    118 #: include/class-alpha-google-map-widget.php:520
     117#: include/class-alpha-google-map-widget.php:256
     118#: include/class-alpha-google-map-widget.php:548
    119119msgid "Description"
    120120msgstr ""
    121121
    122 #: include/class-alpha-google-map-widget.php:248
    123 #: include/class-alpha-google-map-widget.php:605
     122#: include/class-alpha-google-map-widget.php:266
     123#: include/class-alpha-google-map-widget.php:633
    124124msgid "Time Table"
    125125msgstr ""
    126126
    127 #: include/class-alpha-google-map-widget.php:258
     127#: include/class-alpha-google-map-widget.php:276
    128128msgid "Pin Gallery"
    129129msgstr ""
    130130
    131 #: include/class-alpha-google-map-widget.php:268
     131#: include/class-alpha-google-map-widget.php:286
    132132msgid "Map Pins"
    133133msgstr ""
    134134
    135 #: include/class-alpha-google-map-widget.php:273
     135#: include/class-alpha-google-map-widget.php:291
    136136msgid "Alpha Google Maps"
    137137msgstr ""
    138138
    139 #: include/class-alpha-google-map-widget.php:274
     139#: include/class-alpha-google-map-widget.php:292
    140140msgid "Add an optional description to your map pin"
    141141msgstr ""
    142142
    143 #: include/class-alpha-google-map-widget.php:275
     143#: include/class-alpha-google-map-widget.php:293
    144144msgid "Add a time table for the location pin"
    145145msgstr ""
    146146
    147 #: include/class-alpha-google-map-widget.php:287
     147#: include/class-alpha-google-map-widget.php:305
    148148msgid "Controls"
    149149msgstr ""
    150150
    151 #: include/class-alpha-google-map-widget.php:294
     151#: include/class-alpha-google-map-widget.php:312
    152152msgid "Map Type"
    153153msgstr ""
    154154
    155 #: include/class-alpha-google-map-widget.php:297
     155#: include/class-alpha-google-map-widget.php:315
    156156msgid "Road Map"
    157157msgstr ""
    158158
    159 #: include/class-alpha-google-map-widget.php:298
     159#: include/class-alpha-google-map-widget.php:316
    160160msgid "Satellite"
    161161msgstr ""
    162162
    163 #: include/class-alpha-google-map-widget.php:299
     163#: include/class-alpha-google-map-widget.php:317
    164164msgid "Terrain"
    165165msgstr ""
    166166
    167 #: include/class-alpha-google-map-widget.php:300
     167#: include/class-alpha-google-map-widget.php:318
    168168msgid "Hybrid"
    169169msgstr ""
    170170
    171 #: include/class-alpha-google-map-widget.php:309
     171#: include/class-alpha-google-map-widget.php:327
     172msgid "Map ID (Cloud Styling)"
     173msgstr ""
     174
     175#: include/class-alpha-google-map-widget.php:329
     176msgid "Optional. Provide a Google Maps Map ID for Cloud-based map styling."
     177msgstr ""
     178
     179#: include/class-alpha-google-map-widget.php:337
    172180msgid "Height"
    173181msgstr ""
    174182
    175 #: include/class-alpha-google-map-widget.php:329
     183#: include/class-alpha-google-map-widget.php:357
    176184msgid "Zoom"
    177185msgstr ""
    178186
    179 #: include/class-alpha-google-map-widget.php:346
     187#: include/class-alpha-google-map-widget.php:374
    180188msgid "Disable Map Drag"
    181189msgstr ""
    182190
    183 #: include/class-alpha-google-map-widget.php:354
     191#: include/class-alpha-google-map-widget.php:382
    184192msgid "Map Type Controls"
    185193msgstr ""
    186194
    187 #: include/class-alpha-google-map-widget.php:362
     195#: include/class-alpha-google-map-widget.php:390
    188196msgid "Zoom Controls"
    189197msgstr ""
    190198
    191 #: include/class-alpha-google-map-widget.php:370
     199#: include/class-alpha-google-map-widget.php:398
    192200msgid "Street View Control"
    193201msgstr ""
    194202
    195 #: include/class-alpha-google-map-widget.php:378
     203#: include/class-alpha-google-map-widget.php:406
    196204msgid "Fullscreen Control"
    197205msgstr ""
    198206
    199 #: include/class-alpha-google-map-widget.php:386
     207#: include/class-alpha-google-map-widget.php:414
    200208msgid "Scroll Wheel Zoom"
    201209msgstr ""
    202210
    203 #: include/class-alpha-google-map-widget.php:394
     211#: include/class-alpha-google-map-widget.php:422
    204212msgid "One‑Finger Scroll (Gesture Handling)"
    205213msgstr ""
    206214
    207 #: include/class-alpha-google-map-widget.php:396
     215#: include/class-alpha-google-map-widget.php:424
    208216msgid "Enabled"
    209217msgstr ""
    210218
    211 #: include/class-alpha-google-map-widget.php:397
     219#: include/class-alpha-google-map-widget.php:425
    212220msgid "Disabled"
    213221msgstr ""
    214222
    215 #: include/class-alpha-google-map-widget.php:406
     223#: include/class-alpha-google-map-widget.php:434
    216224msgid "Info Container Always Opened"
    217225msgstr ""
    218226
    219 #: include/class-alpha-google-map-widget.php:414
     227#: include/class-alpha-google-map-widget.php:442
    220228msgid "Info Container Opened when Hovered"
    221229msgstr ""
    222230
    223 #: include/class-alpha-google-map-widget.php:422
     231#: include/class-alpha-google-map-widget.php:450
    224232msgid "Info Container Closed when Mouse Out"
    225233msgstr ""
    226234
    227 #: include/class-alpha-google-map-widget.php:443
    228 #: include/class-alpha-google-map-widget.php:528
    229 #: include/class-alpha-google-map-widget.php:613
     235#: include/class-alpha-google-map-widget.php:471
     236#: include/class-alpha-google-map-widget.php:556
     237#: include/class-alpha-google-map-widget.php:641
    230238msgid "Color"
    231 msgstr ""
    232 
    233 #: include/class-alpha-google-map-widget.php:468
    234 #: include/class-alpha-google-map-widget.php:553
    235 #: include/class-alpha-google-map-widget.php:638
    236 #: include/class-alpha-google-map-widget.php:727
    237 #: include/class-alpha-google-map-widget.php:909
    238 msgid "Margin"
    239 msgstr ""
    240 
    241 #: include/class-alpha-google-map-widget.php:480
    242 #: include/class-alpha-google-map-widget.php:565
    243 #: include/class-alpha-google-map-widget.php:650
    244 #: include/class-alpha-google-map-widget.php:739
    245 #: include/class-alpha-google-map-widget.php:921
    246 msgid "Padding"
    247 msgstr ""
    248 
    249 #: include/class-alpha-google-map-widget.php:492
    250 #: include/class-alpha-google-map-widget.php:577
    251 #: include/class-alpha-google-map-widget.php:662
    252 #: include/class-alpha-google-map-widget.php:826
    253 msgid "Alignment"
    254239msgstr ""
    255240
     
    257242#: include/class-alpha-google-map-widget.php:581
    258243#: include/class-alpha-google-map-widget.php:666
    259 #: include/class-alpha-google-map-widget.php:830
     244#: include/class-alpha-google-map-widget.php:755
     245#: include/class-alpha-google-map-widget.php:937
     246msgid "Margin"
     247msgstr ""
     248
     249#: include/class-alpha-google-map-widget.php:508
     250#: include/class-alpha-google-map-widget.php:593
     251#: include/class-alpha-google-map-widget.php:678
     252#: include/class-alpha-google-map-widget.php:767
     253#: include/class-alpha-google-map-widget.php:949
     254msgid "Padding"
     255msgstr ""
     256
     257#: include/class-alpha-google-map-widget.php:520
     258#: include/class-alpha-google-map-widget.php:605
     259#: include/class-alpha-google-map-widget.php:690
     260#: include/class-alpha-google-map-widget.php:854
     261msgid "Alignment"
     262msgstr ""
     263
     264#: include/class-alpha-google-map-widget.php:524
     265#: include/class-alpha-google-map-widget.php:609
     266#: include/class-alpha-google-map-widget.php:694
     267#: include/class-alpha-google-map-widget.php:858
    260268msgid "Left"
    261269msgstr ""
    262270
    263 #: include/class-alpha-google-map-widget.php:500
    264 #: include/class-alpha-google-map-widget.php:585
    265 #: include/class-alpha-google-map-widget.php:670
     271#: include/class-alpha-google-map-widget.php:528
     272#: include/class-alpha-google-map-widget.php:613
     273#: include/class-alpha-google-map-widget.php:698
     274#: include/class-alpha-google-map-widget.php:862
     275msgid "Center"
     276msgstr ""
     277
     278#: include/class-alpha-google-map-widget.php:532
     279#: include/class-alpha-google-map-widget.php:617
     280#: include/class-alpha-google-map-widget.php:702
     281#: include/class-alpha-google-map-widget.php:866
     282msgid "Right"
     283msgstr ""
     284
     285#: include/class-alpha-google-map-widget.php:718
     286msgid "Map"
     287msgstr ""
     288
     289#: include/class-alpha-google-map-widget.php:734
     290msgid "Border Radius"
     291msgstr ""
     292
     293#: include/class-alpha-google-map-widget.php:746
     294msgid "Shadow"
     295msgstr ""
     296
     297#: include/class-alpha-google-map-widget.php:782
     298#: include/class-alpha-google-map-widget.php:789
     299#: include/class-alpha-google-map-widget.php:896
     300msgid "Map Title"
     301msgstr ""
     302
     303#: include/class-alpha-google-map-widget.php:794
     304msgid "Enter your title"
     305msgstr ""
     306
     307#: include/class-alpha-google-map-widget.php:795
     308msgid "Add Your Title Text Here"
     309msgstr ""
     310
     311#: include/class-alpha-google-map-widget.php:802
     312msgid "Link"
     313msgstr ""
     314
     315#: include/class-alpha-google-map-widget.php:821
     316msgid "Default"
     317msgstr ""
     318
     319#: include/class-alpha-google-map-widget.php:822
     320msgid "Small"
     321msgstr ""
     322
     323#: include/class-alpha-google-map-widget.php:823
     324msgid "Medium"
     325msgstr ""
     326
     327#: include/class-alpha-google-map-widget.php:824
     328msgid "Large"
     329msgstr ""
     330
     331#: include/class-alpha-google-map-widget.php:825
     332msgid "XL"
     333msgstr ""
     334
     335#: include/class-alpha-google-map-widget.php:826
     336msgid "XXL"
     337msgstr ""
     338
    266339#: include/class-alpha-google-map-widget.php:834
    267 msgid "Center"
    268 msgstr ""
    269 
    270 #: include/class-alpha-google-map-widget.php:504
    271 #: include/class-alpha-google-map-widget.php:589
    272 #: include/class-alpha-google-map-widget.php:674
    273 #: include/class-alpha-google-map-widget.php:838
    274 msgid "Right"
    275 msgstr ""
    276 
    277 #: include/class-alpha-google-map-widget.php:690
    278 msgid "Map"
    279 msgstr ""
    280 
    281 #: include/class-alpha-google-map-widget.php:706
    282 msgid "Border Radius"
    283 msgstr ""
    284 
    285 #: include/class-alpha-google-map-widget.php:718
    286 msgid "Shadow"
    287 msgstr ""
    288 
    289 #: include/class-alpha-google-map-widget.php:754
    290 #: include/class-alpha-google-map-widget.php:761
    291 #: include/class-alpha-google-map-widget.php:868
    292 msgid "Map Title"
    293 msgstr ""
    294 
    295 #: include/class-alpha-google-map-widget.php:766
    296 msgid "Enter your title"
    297 msgstr ""
    298 
    299 #: include/class-alpha-google-map-widget.php:767
    300 msgid "Add Your Title Text Here"
    301 msgstr ""
    302 
    303 #: include/class-alpha-google-map-widget.php:774
    304 msgid "Link"
    305 msgstr ""
    306 
    307 #: include/class-alpha-google-map-widget.php:793
    308 msgid "Default"
    309 msgstr ""
    310 
    311 #: include/class-alpha-google-map-widget.php:794
    312 msgid "Small"
    313 msgstr ""
    314 
    315 #: include/class-alpha-google-map-widget.php:795
    316 msgid "Medium"
    317 msgstr ""
    318 
    319 #: include/class-alpha-google-map-widget.php:796
    320 msgid "Large"
    321 msgstr ""
    322 
    323 #: include/class-alpha-google-map-widget.php:797
    324 msgid "XL"
    325 msgstr ""
    326 
    327 #: include/class-alpha-google-map-widget.php:798
    328 msgid "XXL"
    329 msgstr ""
    330 
    331 #: include/class-alpha-google-map-widget.php:806
    332340msgid "HTML Tag"
    333341msgstr ""
    334342
    335 #: include/class-alpha-google-map-widget.php:842
     343#: include/class-alpha-google-map-widget.php:870
    336344msgid "Justified"
    337345msgstr ""
    338346
    339 #: include/class-alpha-google-map-widget.php:856
     347#: include/class-alpha-google-map-widget.php:884
    340348msgid "View"
    341349msgstr ""
    342350
    343 #: include/class-alpha-google-map-widget.php:876
     351#: include/class-alpha-google-map-widget.php:904
    344352msgid "Text Color"
    345353msgstr ""
    346354
    347355#. translators: 1: Plugin name 2: Elementor
    348 #: include/class-alpha-google-map.php:183
     356#: include/class-alpha-google-map.php:146
    349357msgid "\"%1$s\" requires \"%2$s\" to be installed and activated."
    350358msgstr ""
    351359
    352 #: include/class-alpha-google-map.php:185
    353 #: include/class-alpha-google-map.php:232
     360#: include/class-alpha-google-map.php:148
     361#: include/class-alpha-google-map.php:195
    354362msgid "Elementor"
    355363msgstr ""
    356364
    357 #: include/class-alpha-google-map.php:194
     365#: include/class-alpha-google-map.php:157
    358366msgid "Activate Elementor"
    359367msgstr ""
    360368
    361 #: include/class-alpha-google-map.php:197
     369#: include/class-alpha-google-map.php:160
    362370msgid "Install Elementor"
    363371msgstr ""
    364372
    365373#. translators: 1: Plugin name 2: Elementor 3: Required Elementor version
    366 #: include/class-alpha-google-map.php:230
     374#: include/class-alpha-google-map.php:193
    367375msgid "\"%1$s\" requires \"%2$s\" version %3$s or greater"
    368376msgstr ""
    369377
    370378#. translators: 1: Plugin name 2: PHP 3: Required PHP version
    371 #: include/class-alpha-google-map.php:261
     379#: include/class-alpha-google-map.php:224
    372380msgid "\"%1$s\" requires \"%2$s\" version %3$s or greater."
    373381msgstr ""
    374382
    375 #: include/class-alpha-google-map.php:263
     383#: include/class-alpha-google-map.php:226
    376384msgid "PHP"
    377385msgstr ""
     386
     387#: include/class-alpha-google-map.php:287
     388msgid "Google Maps API key is missing. Set it under Elementor > Settings > Integrations."
     389msgstr ""
  • alpha-google-map-for-elementor/trunk/readme.txt

    r3276970 r3451258  
    44Tags: google-map, google, elementor, maps, page builder
    55Requires at least: 6.0
    6 Tested up to: 6.8
     6Tested up to: 6.9
    77Requires PHP: 7.4
    8 Stable tag: 1.3
     8Stable tag: 1.4.0
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2121- Customizable info-box with image gallery support
    2222- Extensive map controls
     23- Optional Map ID (Cloud Styling) support with a locale-aware Google Maps loader
    2324- Responsive live editing within Elementor
    2425- Compatibility with the latest Google Maps API standards
     
    6465== Upgrade Notice ==
    6566
    66 = 1.3 =
    67 Compatibility for WP 6.8
    68 Feature: One finger scroll on mobile (GestureHandling)
     67= 1.4 =
     68Modernized Google Maps loader
    6969
    7070== Frequently Asked Questions ==
     
    8585
    8686== Changelog ==
     87
     88= 1.4.0 - 2026-02-01 =
     89* Modernized Google Maps loader (async, locale-aware) with optional Map ID support.
     90* Conditional Elementor asset loading to avoid loading scripts/styles on pages without the widget.
     91* Improved multi-instance safety and marker/gallery handling.
     92* Activation-only copy of default pin assets for backward compatibility.
    8793
    8894= 1.3 - 2025-04-19 =
Note: See TracChangeset for help on using the changeset viewer.