• Resolved lynxlynxlynx

    (@lynxlynxlynx)


    Firefox users can disable geolocation completely, so they don’t get pestered with the popup whenever a site tries to use geolocation. Useful for development and desktops. Anyway, here’s a simple patch that makes the map load when geolocation is disabled, feel free to integrate it:

    --- wp-content/plugins/wp-google-map-gold/assets/js/vendor/maps/maps.js.orig    2024-08-07 22:07:27.292173804 +0200
    +++ wp-content/plugins/wp-google-map-gold/assets/js/vendor/maps/maps.js 2024-08-07 22:19:33.266661744 +0200
    @@ -2048,7 +2048,7 @@
    get_user_position: function () {

    var map_obj = this;
    -
    + if (typeof navigator.geolocation == 'undefined') return;
    navigator.geolocation.getCurrentPosition(function (position) {

    map_obj.user_lat_lng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
    @@ -6020,6 +6020,11 @@

    var map = this;

    + if (typeof navigator.geolocation == 'undefined') {
    + if (error_func)
    + error_func({});
    + return;
    + }
    if (typeof map.user_location == 'undefined') {

    navigator.geolocation.getCurrentPosition(function (position) {
    --- wp-content/plugins/wp-google-map-gold/wp-google-map-gold.php.orig 2024-08-07 22:11:08.681542525 +0200
    +++ wp-content/plugins/wp-google-map-gold/wp-google-map-gold.php 2024-08-07 22:12:42.157120402 +0200
    @@ -617,7 +617,7 @@
    });

    $(".wpgmp_mcurrent_loction").click(function() {
    -
    + if (typeof navigator.geolocation == 'undefined') return;
    navigator.geolocation.getCurrentPosition(function(position) {

    var position = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Ashok Singh

    (@flippercode0505)

    Hello,

    Thank you for the patch!

    Our development team will review your code and, pending approval, we’ll plan to integrate it into our next version release.

    We appreciate your contribution and collaboration.

    Best Regards

    Plugin Support Ashok Singh

    (@flippercode0505)

    Hello,

    If you have any further questions or concerns, please feel free to reopen the ticket.

    Best Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.