Skip to content

Commit

Permalink
Compatibility for WP 6.4 and bug fix for clicked pins
Browse files Browse the repository at this point in the history
  • Loading branch information
ali7ali committed Nov 11, 2023
1 parent bfc0ab6 commit ceefcc6
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 34 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Contributors: ali7ali

Tags: google-map, google, premium, elementor, alpha, page builder, landing page, drag-and-drop

Requires at least: 5.0
Requires at least: 6.0

Tested up to: 6.3
Tested up to: 6.4

Requires PHP: 5.6
Requires PHP: 7.3

Stable tag: 1.0.8
Stable tag: 1.0.9

License: GPLv3

Expand Down Expand Up @@ -59,8 +59,8 @@ Use the WordPress.org forums for community support. If you spot a bug, you can o

= Minimum Requirements =

- WordPress 5.0 or greater
- PHP version 5.6 or greater
- WordPress 6.0 or greater
- PHP version 7.3 or greater
- MySQL version 5.0 or greater

= We recommend your host supports: =
Expand Down Expand Up @@ -88,8 +88,8 @@ Manual or using sFTP install:

== Upgrade Notice ==

= 1.0.8 =
Compatibility for WP 6.3.
= 1.0.9 =
Compatibility for WP 6.4 and bug fix for clicked pins.

== Frequently Asked Questions ==

Expand All @@ -109,6 +109,10 @@ No. You need to install Elementor Website Builder first.

== Changelog ==

= 1.0.9 - 2023-11-11 =

- Compatibility for WP 6.4 and bug fix for clicked pins.

= 1.0.8 - 2023-08-17 =

- Compatibility for WP 6.3.
Expand Down
4 changes: 2 additions & 2 deletions alpha-google-map-for-elementor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description: Premium Google Map features for WordPress.
* Author: Ali Ali
* Author URI: https://github.com/Ali7Ali
* Version: 1.0.8
* Version: 1.0.9
* Text Domain: alpha-google-map-for-elementor
* Domain Path: /languages
* License: GPLv3
Expand Down Expand Up @@ -37,7 +37,7 @@
exit; // Exit if accessed directly.
}

define('ALPHAMAP_VERSION', '1.0.8');
define('ALPHAMAP_VERSION', '1.0.9');
define('ALPHAMAP_ADDONS_PL_ROOT', __FILE__);
define('ALPHAMAP_PL_URL', plugins_url('/', ALPHAMAP_ADDONS_PL_ROOT));
define('ALPHAMAP_PL_PATH', plugin_dir_path(ALPHAMAP_ADDONS_PL_ROOT));
Expand Down
22 changes: 14 additions & 8 deletions assets/js/alpha-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jQuery(window).on("elementor/frontend/init", function () {

var alphaMapMarkers = [];

var selectedMarker = null;
var selectedMarker = {};

alphaMap = newMap(mapElement, mapSettings, mapStyle);

Expand All @@ -30,7 +30,7 @@ jQuery(window).on("elementor/frontend/init", function () {
var args = {
zoom: settings["zoom"],
mapTypeId: settings["maptype"],
center: {lat: locationLat, lng: locationLong},
center: { lat: locationLat, lng: locationLong },
scrollwheel: scrollwheel,
streetViewControl: streetViewControl,
fullscreenControl: fullscreenControl,
Expand All @@ -47,6 +47,7 @@ jQuery(window).on("elementor/frontend/init", function () {
var map = new google.maps.Map(map[0], args);

map.markers = [];
var prev_infowindow = false;
// add markers
markers.each(function () {
add_marker(jQuery(this), map, autoOpen, hoverOpen, hoverClose);
Expand All @@ -59,7 +60,7 @@ jQuery(window).on("elementor/frontend/init", function () {
var latlng = new google.maps.LatLng(
pin.attr("data-lat"),
pin.attr("data-lng")
),
),
icon_img = pin.attr("data-icon"),
icon_hover_img = pin.attr("data-icon-active"),
maxWidth = pin.attr("data-max-width"),
Expand Down Expand Up @@ -88,7 +89,8 @@ jQuery(window).on("elementor/frontend/init", function () {
var marker = new google.maps.Marker({
position: latlng,
map: map,
icon: icon
icon: icon,
marker_id: customID
});


Expand All @@ -97,6 +99,7 @@ jQuery(window).on("elementor/frontend/init", function () {

alphaMapMarkers.push(marker);


// if marker contains HTML, add it to an infoWindow
if (
pin.find(".alpha-map-info-title").html() ||
Expand Down Expand Up @@ -126,16 +129,19 @@ jQuery(window).on("elementor/frontend/init", function () {
}
// show info window when marker is clicked
google.maps.event.addListener(marker, "click", function () {
if (selectedMarker) {
selectedMarker.setIcon(icon_url);
if (typeof prev_infowindow !== 'undefined' && typeof selectedMarker !== 'undefined' && typeof selectedMarker.marker !== 'undefined') {
selectedMarker.marker.setIcon(selectedMarker.icon);
prev_infowindow.close();
}
marker.setIcon(icon_onHover);
selectedMarker = marker;
selectedMarker.marker = marker;
selectedMarker.icon = icon_url;
infowindow.open(map, marker);
prev_infowindow = infowindow;
});
google.maps.event.addListener(map, "click", function (event) {
if (selectedMarker) {
selectedMarker.setIcon(icon_url);
selectedMarker.marker.setIcon(selectedMarker.icon);
}
infowindow.close();
});
Expand Down
2 changes: 1 addition & 1 deletion assets/js/pa-maps-finder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions include/class-alpha-google-map-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -1036,13 +1036,10 @@ protected function render()
'data-icon-active' => $pin['pin_active_icon']['url'],
'data-icon-size' => $pin['pin_icon_size']['size'],
'data-max-width' => $marker_width,
'data-id' => $index,
)
);

if (!empty($pin['custom_id'])) {
$this->add_render_attribute($key, 'data-id', esc_attr($pin['custom_id']));
}

$ids = wp_list_pluck($pin['pin_desc_gallery'], 'id');
$count = count($ids);
$this->add_render_attribute('shortcode' . $index, 'ids', implode(',', $ids));
Expand Down
2 changes: 1 addition & 1 deletion include/class-alpha-google-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
final class Alpha_Google_Map
{
const MINIMUM_ELEMENTOR_VERSION = '3.0.0';
const MINIMUM_PHP_VERSION = '5.6';
const MINIMUM_PHP_VERSION = '7.3';
/**
* Self instance.
*
Expand Down
1 change: 1 addition & 0 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Direct access security.
*
Expand Down
4 changes: 2 additions & 2 deletions languages/alpha-google-map-for-elementor.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GPLv3.
msgid ""
msgstr ""
"Project-Id-Version: Alpha Google Map For Elementor 1.0.8\n"
"Project-Id-Version: Alpha Google Map For Elementor 1.0.9\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/alpha-google-map-for-elementor\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-08-17T03:19:11+00:00\n"
"POT-Creation-Date: 2023-11-11T13:54:59+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.5.0\n"
"X-Domain: alpha-google-map-for-elementor\n"
Expand Down
19 changes: 11 additions & 8 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Author: ali7ali
Contributors: ali7ali
Tags: google-map, google, premium, elementor, alpha, page builder, landing page, drag-and-drop
Requires at least: 5.0
Tested up to: 6.3
Requires PHP: 5.6
Stable tag: 1.0.8
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.3
Stable tag: 1.0.9
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -38,8 +38,8 @@ Use the WordPress.org forums for community support. If you spot a bug, you can o

= Minimum Requirements =

* WordPress 5.0 or greater
* PHP version 5.6 or greater
* WordPress 6.0 or greater
* PHP version 7.3 or greater
* MySQL version 5.0 or greater

= We recommend your host supports: =
Expand All @@ -66,8 +66,8 @@ Manual or using sFTP install:

== Upgrade Notice ==

= 1.0.8 =
Compatibility for WP 6.3.
= 1.0.9 =
Compatibility for WP 6.4 and bug fix for clicked pins.

== Frequently Asked Questions ==

Expand All @@ -87,6 +87,9 @@ No. You need to install Elementor Website Builder first.

== Changelog ==

= 1.0.9 - 2023-11-11 =
* Compatibility for WP 6.4 and bug fix for clicked pins.

= 1.0.8 - 2023-08-17 =
* Compatibility for WP 6.3.

Expand Down

0 comments on commit ceefcc6

Please sign in to comment.