Title: [PATCH] Add support for disabled geolocation
Last modified: August 7, 2024

---

# [PATCH] Add support for disabled geolocation

 *  Resolved [lynxlynxlynx](https://wordpress.org/support/users/lynxlynxlynx/)
 * (@lynxlynxlynx)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/patch-add-support-for-disabled-geolocation/)
 * 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-block-code
       --- 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](https://wordpress.org/support/users/flippercode0505/)
 * (@flippercode0505)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/patch-add-support-for-disabled-geolocation/#post-17940205)
 * 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](https://wordpress.org/support/users/flippercode0505/)
 * (@flippercode0505)
 * [1 year, 7 months ago](https://wordpress.org/support/topic/patch-add-support-for-disabled-geolocation/#post-17984372)
 * 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)

The topic ‘[PATCH] Add support for disabled geolocation’ is closed to new replies.

 * ![](https://ps.w.org/wp-google-map-plugin/assets/icon-256x256.gif?rev=3111000)
 * [WP Maps - Store Locator,Google Maps,OpenStreetMap,Mapbox,Listing,Directory & Filters](https://wordpress.org/plugins/wp-google-map-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-google-map-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-google-map-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-google-map-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-google-map-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-google-map-plugin/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Ashok Singh](https://wordpress.org/support/users/flippercode0505/)
 * Last activity: [1 year, 7 months ago](https://wordpress.org/support/topic/patch-add-support-for-disabled-geolocation/#post-17984372)
 * Status: resolved