WP Google Maps - Version 6.4.04

Version Description

  • 2017-06-08 - Low priority =
  • Tested on WordPress 4.8
Download this release

Release Info

Developer WPGMaps
Plugin Icon 128x128 WP Google Maps
Version 6.4.04
Comparing to
See all releases

Code changes from version 6.4.03 to 6.4.04

base/classes/WPGM_templates.php CHANGED
@@ -3,14 +3,29 @@
3
  class WPGMAPS_templates {
4
 
5
 
 
 
 
 
 
6
  function welcome_page_v6() {
7
  include(dirname(dirname(__FILE__))."/includes/welcome.php");
8
  }
 
 
 
 
 
 
9
  function welcome_page_credits() {
10
  include(dirname(dirname(__FILE__))."/includes/credits.php");
11
  }
12
 
13
-
 
 
 
 
14
  function welcome_page() {
15
  global $wpgmza_global_array;
16
  ?>
3
  class WPGMAPS_templates {
4
 
5
 
6
+ /**
7
+ * Includes WP Google Maps V6 Welome Page
8
+ *
9
+ * @return void
10
+ */
11
  function welcome_page_v6() {
12
  include(dirname(dirname(__FILE__))."/includes/welcome.php");
13
  }
14
+
15
+ /**
16
+ * Includes credits page
17
+ *
18
+ * @return void
19
+ */
20
  function welcome_page_credits() {
21
  include(dirname(dirname(__FILE__))."/includes/credits.php");
22
  }
23
 
24
+ /**
25
+ * Outputs WP Google Maps V5 Welcome Page
26
+ *
27
+ * @return void
28
+ */
29
  function welcome_page() {
30
  global $wpgmza_global_array;
31
  ?>
base/classes/widget_module.class.php CHANGED
@@ -1,6 +1,9 @@
1
  <?php
2
  class wpgmza_widget extends WP_Widget {
3
 
 
 
 
4
  function __construct() {
5
  parent::__construct(
6
  'wpgmza_map_widget',
@@ -12,6 +15,14 @@ class wpgmza_widget extends WP_Widget {
12
  );
13
  }
14
 
 
 
 
 
 
 
 
 
15
  public function widget( $args, $instance ) {
16
  $title = apply_filters( 'widget_title', $instance['title'] );
17
 
@@ -29,6 +40,13 @@ class wpgmza_widget extends WP_Widget {
29
  echo $args['after_widget'];
30
  }
31
 
 
 
 
 
 
 
 
32
  public function form($instance) {
33
  if( $instance) {
34
  if (isset($instance['title'])) { $title = esc_attr($instance['title']); } else { $title = ""; }
@@ -50,7 +68,15 @@ class wpgmza_widget extends WP_Widget {
50
  echo "</select></p>";
51
 
52
  }
53
- // Updating widget replacing old instances with new
 
 
 
 
 
 
 
 
54
  public function update( $new_instance, $old_instance ) {
55
  $instance = array();
56
  $instance['selection'] = ( ! empty( $new_instance['selection'] ) ) ? strip_tags( $new_instance['selection'] ) : '';
@@ -60,9 +86,20 @@ class wpgmza_widget extends WP_Widget {
60
  }
61
  }
62
 
 
 
 
 
 
63
  function wpgmza_load_widget() {
64
  register_widget( 'wpgmza_widget' );
65
  }
 
 
 
 
 
 
66
  function wpgmza_get_widget_select_field($selection) {
67
  global $wpdb;
68
  global $wpgmza_tblname_maps;
1
  <?php
2
  class wpgmza_widget extends WP_Widget {
3
 
4
+ /**
5
+ * Widget Constructor
6
+ */
7
  function __construct() {
8
  parent::__construct(
9
  'wpgmza_map_widget',
15
  );
16
  }
17
 
18
+ /**
19
+ * Outputs Widget Content
20
+ *
21
+ * @param array $args Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
22
+ * @param array $instance The settings for the instance of a widget
23
+ *
24
+ * @return void
25
+ */
26
  public function widget( $args, $instance ) {
27
  $title = apply_filters( 'widget_title', $instance['title'] );
28
 
40
  echo $args['after_widget'];
41
  }
42
 
43
+ /**
44
+ * Outputs the settings update form.
45
+ *
46
+ * @param array $instance Display arguments including 'before_title', 'after_title', 'before_widget', and 'after_widget'.
47
+ *
48
+ * @return void/string 'noform' (Default - Inherited)
49
+ */
50
  public function form($instance) {
51
  if( $instance) {
52
  if (isset($instance['title'])) { $title = esc_attr($instance['title']); } else { $title = ""; }
68
  echo "</select></p>";
69
 
70
  }
71
+
72
+ /**
73
+ * Updates a particular instance of a widget.
74
+ *
75
+ * @param array $new_instance New settings for this instance as input
76
+ * @param array $old_instance Old settings for this instance
77
+ *
78
+ * @return array $instance
79
+ */
80
  public function update( $new_instance, $old_instance ) {
81
  $instance = array();
82
  $instance['selection'] = ( ! empty( $new_instance['selection'] ) ) ? strip_tags( $new_instance['selection'] ) : '';
86
  }
87
  }
88
 
89
+ /**
90
+ * Registers the 'wpgmza' widget
91
+ *
92
+ * @return void
93
+ */
94
  function wpgmza_load_widget() {
95
  register_widget( 'wpgmza_widget' );
96
  }
97
+
98
+ /**
99
+ * Outputs the 'options' for the map select field
100
+ *
101
+ * @return void
102
+ */
103
  function wpgmza_get_widget_select_field($selection) {
104
  global $wpdb;
105
  global $wpgmza_tblname_maps;
css/wp-google-maps-admin.css CHANGED
@@ -432,3 +432,12 @@ input.cmn-toggle-yes-no:checked + label:after {
432
  margin-left: 1%;
433
  }
434
 
 
 
 
 
 
 
 
 
 
432
  margin-left: 1%;
433
  }
434
 
435
+ #wpgmza_store_locator_default_radius_km,
436
+ #wpgmza_store_locator_default_radius_mi {
437
+ display: none;
438
+ }
439
+
440
+ #wpgmza_store_locator_default_radius_km.active,
441
+ #wpgmza_store_locator_default_radius_mi.active {
442
+ display: block;
443
+ }
css/wpgmza_style.css CHANGED
@@ -371,6 +371,52 @@ ul.wpgmza_marker_list_class {
371
  max-width: 600px;
372
  }
373
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  .wpgmaps_fullscreen {
375
  position: fixed !important;
376
  top:0;
@@ -378,4 +424,5 @@ ul.wpgmza_marker_list_class {
378
  width:100% !important;
379
  height: 100% !important;
380
  z-index:9999;
 
381
  }
371
  max-width: 600px;
372
  }
373
 
374
+
375
+ .wpgmza-clearfix {
376
+ zoom: 1;
377
+ }
378
+
379
+ .wpgmza-clearfix:before,
380
+ .wpgmza-clearfix:after {
381
+ content: '';
382
+ display: table;
383
+ table-layout: fixed;
384
+ }
385
+
386
+ .wpgmza-clearfix:after {
387
+ clear: both;
388
+ }
389
+
390
+ .wpgmza_sl_main_div {
391
+ overflow: hidden;
392
+ position: relative;
393
+ top: 10px;
394
+ }
395
+
396
+ .wpgmza_sl_query_div,
397
+ .wpgmza_sl_radius_div {
398
+ height: auto;
399
+ margin-bottom: 10px;
400
+ }
401
+
402
+ .wpgmza_sl_radius_div {
403
+ margin-bottom: 20px;
404
+ }
405
+
406
+ .wpgmza-not-found-msg {
407
+ display: none;
408
+ margin-top: 20px;
409
+ color: #777;
410
+ }
411
+
412
+ .wpgmza-not-found-msg.is-active {
413
+ display: block;
414
+ }
415
+
416
+ .wpgmza-not-found-msg p {
417
+ margin-bottom: 0;
418
+ }
419
+
420
  .wpgmaps_fullscreen {
421
  position: fixed !important;
422
  top:0;
424
  width:100% !important;
425
  height: 100% !important;
426
  z-index:9999;
427
+
428
  }
js/admin-basic.js CHANGED
@@ -36,4 +36,22 @@ jQuery(document).ready(function(){
36
 
37
  });
38
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  });
36
 
37
  });
38
 
39
+ var radiusStoreLocator = jQuery('.wpgmza-store-locator-default-radius'),
40
+ radiusStoreLocatorKm = jQuery('#wpgmza_store_locator_default_radius_km'),
41
+ radiusStoreLocatorMi = jQuery('#wpgmza_store_locator_default_radius_mi');
42
+
43
+ radiusStoreLocator.on('change', function() {
44
+ radiusStoreLocator.val(jQuery(this).val());
45
+ });
46
+
47
+ jQuery('#wpgmza_store_locator_distance').on('change', function() {
48
+ radiusStoreLocator.removeClass('active');
49
+
50
+ if (jQuery(this).attr('checked')){
51
+ radiusStoreLocatorMi.addClass('active');
52
+ } else {
53
+ radiusStoreLocatorKm.addClass('active');
54
+ }
55
+ });
56
+
57
  });
js/wpgmaps-admin-core.js CHANGED
@@ -1,33 +1,146 @@
1
- var placeSearch, autocomplete;
2
- var wpgmza_table_length;
3
- var wpgmzaTable;
4
- var marker_added = false;
5
- var wpgmaps_markers_array = [];
6
- var infoWindow = new Array();
7
- var tmp_marker;
8
- var WPGM_Path_Polygon = new Array();
9
- var WPGM_Path = new Array();
10
-
11
-
12
- if ('undefined' == typeof window.jQuery) {
13
- alert("jQuery is not installed. WP Google Maps requires jQuery in order to function properly. Please ensure you have jQuery installed.")
14
- } else {
15
- // all good.. continue...
16
- }
17
-
 
18
 
19
-
20
- jQuery(function() {
21
-
22
-
23
  function fillInAddress() {
24
  // Get the place details from the autocomplete object.
25
  var place = autocomplete.getPlace();
26
  }
27
 
28
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  jQuery(document).ready(function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32
  jQuery("select[name=wpgmza_table_length]").change(function () {
33
  wpgmza_table_length = jQuery(this).val();
@@ -50,7 +163,7 @@ jQuery(function() {
50
  "bProcessing": true,
51
  "aaSorting": [[ 0, "desc" ]]
52
  });
53
-
54
  function wpgmza_reinitialisetbl() {
55
  //wpgmzaTable.fnClearTable( 0 );
56
  if (wpgmza_table_length === "") { wpgmza_table_length = 10; }
@@ -59,7 +172,7 @@ jQuery(function() {
59
  "iDisplayLength": wpgmza_table_length
60
  });
61
  }
62
-
63
  function wpgmza_InitMap() {
64
  var myLatLng = new google.maps.LatLng(wpgmaps_localize[wpgmaps_mapid].map_start_lat ,wpgmaps_localize[wpgmaps_mapid].map_start_lng);
65
  MYMAP.init('#wpgmza_map', myLatLng, parseInt(wpgmaps_localize[wpgmaps_mapid].map_start_zoom));
@@ -80,19 +193,25 @@ jQuery(function() {
80
 
81
  jQuery("body").on("click", ".wpgmza_del_btn", function() {
82
  var cur_id = jQuery(this).attr("id");
 
 
 
 
 
 
 
 
83
  var data = {
84
  action: 'delete_marker',
85
  security: wpgmaps_nonce,
86
  map_id: wpgmaps_mapid,
87
  marker_id: cur_id
88
  };
 
89
  jQuery.post(ajaxurl, data, function(response) {
90
  returned_data = JSON.parse(response);
91
  wpgmaps_localize_marker_data = returned_data.marker_data;
92
- //wpgmza_InitMap();
93
- wpgmaps_markers_array[cur_id].setMap(null);
94
- delete wpgmaps_markers_array[cur_id];
95
-
96
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
97
  wpgmza_reinitialisetbl();
98
  });
@@ -175,12 +294,21 @@ jQuery(function() {
175
  });
176
 
177
  jQuery("#wpgmza_addmarker").click(function(){
178
- jQuery("#wpgmza_addmarker").hide();
179
- jQuery("#wpgmza_addmarker_loading").show();
 
 
 
 
 
 
 
 
180
 
181
  var wpgm_address = "0";
182
  var wpgm_gps = "0";
183
- if (document.getElementsByName("wpgmza_add_address").length > 0) { wpgm_address = jQuery("#wpgmza_add_address").val(); }
 
184
  var wpgm_anim = "0";
185
  var wpgm_infoopen = "0";
186
  if (document.getElementsByName("wpgmza_animation").length > 0) { wpgm_anim = jQuery("#wpgmza_animation").val(); }
@@ -223,15 +351,14 @@ jQuery(function() {
223
 
224
  //wpgmza_InitMap();
225
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
226
- jQuery("#wpgmza_addmarker").show();
227
- jQuery("#wpgmza_addmarker_loading").hide();
228
  jQuery("#wpgmza_add_address").val("");
229
  jQuery("#wpgmza_animation").val("0");
230
  jQuery("#wpgmza_infoopen").val("0");
231
  wpgmza_reinitialisetbl();
232
 
233
  MYMAP.map.setCenter(marker_data.point);
234
- marker_added = false;
235
 
236
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
237
 
@@ -275,15 +402,14 @@ jQuery(function() {
275
  add_marker(marker_data);
276
 
277
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
278
- jQuery("#wpgmza_addmarker").show();
279
- jQuery("#wpgmza_addmarker_loading").hide();
280
  jQuery("#wpgmza_add_address").val("");
281
  jQuery("#wpgmza_animation").val("0");
282
  jQuery("#wpgmza_infoopen").val("0");
283
  wpgmza_reinitialisetbl();
284
  var myLatLng = new google.maps.LatLng(wpgm_lat,wpgm_lng);
285
  MYMAP.map.setCenter(myLatLng);
286
- marker_added = false;
287
 
288
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
289
 
@@ -295,8 +421,7 @@ jQuery(function() {
295
 
296
  } else {
297
  alert("Geocode was not successful for the following reason: " + status);
298
- jQuery("#wpgmza_addmarker").show();
299
- jQuery("#wpgmza_addmarker_loading").hide();
300
 
301
  }
302
  });
@@ -371,7 +496,7 @@ jQuery(function() {
371
  jQuery("#wpgmza_editmarker_loading").hide();
372
  jQuery("#wpgmza_edit_id").val("");
373
  wpgmza_reinitialisetbl();
374
- marker_added = false;
375
 
376
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
377
 
@@ -417,7 +542,7 @@ jQuery(function() {
417
  jQuery("#wpgmza_editmarker_loading").hide();
418
  jQuery("#wpgmza_edit_id").val("");
419
  wpgmza_reinitialisetbl();
420
- marker_added = false;
421
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
422
 
423
  jQuery("#wpgmaps_marker_cache_reminder").fadeIn();
@@ -431,8 +556,6 @@ jQuery(function() {
431
  });
432
  });
433
 
434
- });
435
-
436
  var MYMAP = {
437
  map: null,
438
  bounds: null
@@ -499,7 +622,10 @@ MYMAP.init = function(selector, latLng, zoom) {
499
  } );
500
  jQuery("#wpgmza_add_address").val(event.latLng.lat()+', '+event.latLng.lng());
501
  jQuery("#wpgm_notice_message_save_marker").show();
502
- marker_added = true;
 
 
 
503
  setTimeout(function() {
504
  jQuery("#wpgm_notice_message_save_marker").fadeOut('slow')
505
  }, 3000);
@@ -565,6 +691,7 @@ MYMAP.init = function(selector, latLng, zoom) {
565
  var location = MYMAP.map.getCenter();
566
  jQuery("#wpgmza_start_location").val(location.lat()+","+location.lng());
567
  jQuery("#wpgmaps_save_reminder").show();
 
568
  });
569
 
570
  }
@@ -920,3 +1047,5 @@ function add_polyline(polyline) {
920
 
921
 
922
  }
 
 
1
+ (function($) {
2
+
3
+ var placeSearch, autocomplete;
4
+ var wpgmza_table_length;
5
+ var wpgmzaTable;
6
+ var marker_added = false;
7
+ var wpgmaps_markers_array = [];
8
+ var infoWindow = new Array();
9
+ var tmp_marker;
10
+ var WPGM_Path_Polygon = new Array();
11
+ var WPGM_Path = new Array();
12
+ var saveReminderBound = false;
13
+
14
+ if ('undefined' == typeof window.jQuery) {
15
+ alert("jQuery is not installed. WP Google Maps requires jQuery in order to function properly. Please ensure you have jQuery installed.")
16
+ } else {
17
+ // all good.. continue...
18
+ }
19
 
 
 
 
 
20
  function fillInAddress() {
21
  // Get the place details from the autocomplete object.
22
  var place = autocomplete.getPlace();
23
  }
24
 
25
+ function enableAddMarkerButton(enable)
26
+ {
27
+ var button = $("#wpgmza_addmarker");
28
+ button.prop("disabled", (enable ? false : "disabled"));
29
+ button.val(enable ? button.data("original-text") : "Saving...");
30
+ }
31
+ $("#wpgmza_addmarker").data("original-text", $("#wpgmza_addmarker").val());
32
+ $("#wpgmza_addmarker_loading").hide();
33
+
34
+ function setMarkerAdded(added)
35
+ {
36
+ var button = $("#wpgmza_addmarker");
37
+ var caption = (added ? "Save Marker" : "Add Marker");
38
+ button.data("original-text", caption);
39
+ button.val(caption);
40
+ marker_added = added;
41
+ }
42
+
43
+ function onBeforeUnload(event)
44
+ {
45
+ var message = "You have unsaved changes to your map, leaving this page will discard them";
46
+ event.returnValue = message;
47
+ return message;
48
+ }
49
+
50
+ function bindSaveReminder()
51
+ {
52
+ if(saveReminderBound)
53
+ return;
54
+
55
+ window.addEventListener("beforeunload", onBeforeUnload);
56
+ }
57
+
58
+ function unbindSaveReminder()
59
+ {
60
+ window.removeEventListener("beforeunload", onBeforeUnload);
61
+ }
62
+
63
+ function wpgmza_select_all_markers()
64
+ {
65
+ $("#wpgmza_table input[name='mark']").prop("checked", "checked");
66
+ }
67
+
68
+ function wpgmza_bulk_delete()
69
+ {
70
+ var ids = [];
71
+
72
+ // Gather IDs to delete
73
+ $("#wpgmza_table input[name='mark']:checked").each(function(index, el) {
74
+ ids.push( $(el).closest("tr").attr("id").match(/\d+$/)[0] );
75
+ });
76
+
77
+ if(ids.length == 0)
78
+ {
79
+ alert("No markers selected");
80
+ return;
81
+ }
82
+
83
+ // Prompt user to confirm
84
+ if(!confirm("Confirm deleting " + ids.length + " marker(s)"))
85
+ return;
86
+
87
+ // Get ready
88
+ var data = {
89
+ action: "delete_marker",
90
+ security: wpgmaps_nonce,
91
+ map_id: wpgmaps_mapid
92
+ };
93
+
94
+ // Count responses separately since were shifting ids straight off the array async
95
+ var counter = ids.length;
96
+
97
+ function sendDeleteRequest(id)
98
+ {
99
+ $.post(ajaxurl, $.extend({marker_id: id}, data), function(response) {
100
+ if(--counter == 1)
101
+ {
102
+ // Send very last one synchronous so tables don't collide
103
+ var last = ids.shift();
104
+ sendDeleteRequest(last);
105
+ }
106
+ else if(counter == 0)
107
+ {
108
+ // Receive last response
109
+ jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
110
+ wpgmza_reinitialisetbl();
111
+ }
112
+ });
113
+
114
+ wpgmaps_markers_array[id].setMap(null);
115
+ delete wpgmaps_markers_array[id];
116
+ }
117
+
118
+ // Send all but one delete request async, last one is send inside sendDeleteRequest
119
+ while(ids.length > 1)
120
+ {
121
+ var id = ids.shift();
122
+ sendDeleteRequest(id);
123
+ }
124
+ }
125
 
126
  jQuery(document).ready(function(){
127
+ $("input[type='submit'].button-primary").on("click", function() {
128
+ unbindSaveReminder();
129
+ });
130
+
131
+ $(document.body).on("click", function(event) {
132
+ if($(event.target).is(".wpgmza.bulk_delete"))
133
+ {
134
+ wpgmza_bulk_delete();
135
+ return;
136
+ }
137
+
138
+ if($(event.target).is(".wpgmza.select_all_markers"))
139
+ {
140
+ wpgmza_select_all_markers();
141
+ return;
142
+ }
143
+ });
144
 
145
  jQuery("select[name=wpgmza_table_length]").change(function () {
146
  wpgmza_table_length = jQuery(this).val();
163
  "bProcessing": true,
164
  "aaSorting": [[ 0, "desc" ]]
165
  });
166
+
167
  function wpgmza_reinitialisetbl() {
168
  //wpgmzaTable.fnClearTable( 0 );
169
  if (wpgmza_table_length === "") { wpgmza_table_length = 10; }
172
  "iDisplayLength": wpgmza_table_length
173
  });
174
  }
175
+
176
  function wpgmza_InitMap() {
177
  var myLatLng = new google.maps.LatLng(wpgmaps_localize[wpgmaps_mapid].map_start_lat ,wpgmaps_localize[wpgmaps_mapid].map_start_lng);
178
  MYMAP.init('#wpgmza_map', myLatLng, parseInt(wpgmaps_localize[wpgmaps_mapid].map_start_zoom));
193
 
194
  jQuery("body").on("click", ".wpgmza_del_btn", function() {
195
  var cur_id = jQuery(this).attr("id");
196
+ var marker = wpgmaps_markers_array[cur_id];
197
+
198
+ if(!wpgmaps_markers_array[cur_id])
199
+ return;
200
+
201
+ wpgmaps_markers_array[cur_id].setMap(null);
202
+ delete wpgmaps_markers_array[cur_id];
203
+
204
  var data = {
205
  action: 'delete_marker',
206
  security: wpgmaps_nonce,
207
  map_id: wpgmaps_mapid,
208
  marker_id: cur_id
209
  };
210
+
211
  jQuery.post(ajaxurl, data, function(response) {
212
  returned_data = JSON.parse(response);
213
  wpgmaps_localize_marker_data = returned_data.marker_data;
214
+
 
 
 
215
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
216
  wpgmza_reinitialisetbl();
217
  });
294
  });
295
 
296
  jQuery("#wpgmza_addmarker").click(function(){
297
+ var addressInput = $("#wpgmza_add_address")
298
+
299
+ if(!marker_added && addressInput.val().length == 0)
300
+ {
301
+ alert("Please enter an address or right click on the map");
302
+ addressInput.focus();
303
+ return;
304
+ }
305
+
306
+ enableAddMarkerButton(false);
307
 
308
  var wpgm_address = "0";
309
  var wpgm_gps = "0";
310
+ if ($("#wpgmza_add_address").length > 0)
311
+ wpgm_address = $("#wpgmza_add_address").val();
312
  var wpgm_anim = "0";
313
  var wpgm_infoopen = "0";
314
  if (document.getElementsByName("wpgmza_animation").length > 0) { wpgm_anim = jQuery("#wpgmza_animation").val(); }
351
 
352
  //wpgmza_InitMap();
353
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
354
+ enableAddMarkerButton(true);
 
355
  jQuery("#wpgmza_add_address").val("");
356
  jQuery("#wpgmza_animation").val("0");
357
  jQuery("#wpgmza_infoopen").val("0");
358
  wpgmza_reinitialisetbl();
359
 
360
  MYMAP.map.setCenter(marker_data.point);
361
+ setMarkerAdded(false);
362
 
363
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
364
 
402
  add_marker(marker_data);
403
 
404
  jQuery("#wpgmza_marker_holder").html(JSON.parse(response).table_html);
405
+ enableAddMarkerButton(true);
 
406
  jQuery("#wpgmza_add_address").val("");
407
  jQuery("#wpgmza_animation").val("0");
408
  jQuery("#wpgmza_infoopen").val("0");
409
  wpgmza_reinitialisetbl();
410
  var myLatLng = new google.maps.LatLng(wpgm_lat,wpgm_lng);
411
  MYMAP.map.setCenter(myLatLng);
412
+ setMarkerAdded(false);
413
 
414
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
415
 
421
 
422
  } else {
423
  alert("Geocode was not successful for the following reason: " + status);
424
+ enableAddMarkerButton(true);
 
425
 
426
  }
427
  });
496
  jQuery("#wpgmza_editmarker_loading").hide();
497
  jQuery("#wpgmza_edit_id").val("");
498
  wpgmza_reinitialisetbl();
499
+ setMarkerAdded(false);
500
 
501
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
502
 
542
  jQuery("#wpgmza_editmarker_loading").hide();
543
  jQuery("#wpgmza_edit_id").val("");
544
  wpgmza_reinitialisetbl();
545
+ setMarkerAdded(false);
546
  if( jQuery("#wpgmaps_marker_cache_reminder").length > 0 ){
547
 
548
  jQuery("#wpgmaps_marker_cache_reminder").fadeIn();
556
  });
557
  });
558
 
 
 
559
  var MYMAP = {
560
  map: null,
561
  bounds: null
622
  } );
623
  jQuery("#wpgmza_add_address").val(event.latLng.lat()+', '+event.latLng.lng());
624
  jQuery("#wpgm_notice_message_save_marker").show();
625
+
626
+ setMarkerAdded("true");
627
+ bindSaveReminder();
628
+
629
  setTimeout(function() {
630
  jQuery("#wpgm_notice_message_save_marker").fadeOut('slow')
631
  }, 3000);
691
  var location = MYMAP.map.getCenter();
692
  jQuery("#wpgmza_start_location").val(location.lat()+","+location.lng());
693
  jQuery("#wpgmaps_save_reminder").show();
694
+ bindSaveReminder();
695
  });
696
 
697
  }
1047
 
1048
 
1049
  }
1050
+
1051
+ })(jQuery);
js/wpgmaps.js CHANGED
@@ -19,17 +19,30 @@ function InitMap() {
19
  MYMAP.placeMarkers(wpgmaps_markerurl+'?u='+UniqueCode,wpgmaps_localize[wpgmaps_mapid].id,null,null,null);
20
  }
21
  jQuery(function() {
22
-
23
  jQuery(document).ready(function(){
24
- if (/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)) {
25
  setTimeout(function(){
26
  document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
27
  }, 6000);
28
  } else {
29
- jQuery("#wpgmza_map").css({
30
- height:wpgmaps_localize[wpgmaps_mapid]['map_height']+''+wpgmaps_localize[wpgmaps_mapid]['map_height_type'],
31
- width:wpgmaps_localize[wpgmaps_mapid]['map_width']+''+wpgmaps_localize[wpgmaps_mapid]['map_width_type']
 
 
 
 
 
 
 
 
 
 
 
 
32
  });
 
33
  InitMap();
34
  jQuery('body').on('tabsactivate', function(){setTimeout(function(){InitMap();}, 500); });
35
  jQuery('body').on('tabsshow', function(){setTimeout(function(){InitMap();}, 500); });
@@ -73,7 +86,7 @@ if ('undefined' === typeof wpgmaps_localize[wpgmaps_mapid]['other_settings']['ma
73
 
74
 
75
  MYMAP.init = function(selector, latLng, zoom) {
76
-
77
  if (typeof wpgmaps_localize[wpgmaps_mapid].type !== "undefined") {
78
  if (wpgmaps_localize[wpgmaps_mapid].type === "1") { maptype = google.maps.MapTypeId.ROADMAP; }
79
  else if (wpgmaps_localize[wpgmaps_mapid].type === "2") { maptype = google.maps.MapTypeId.SATELLITE; }
@@ -103,21 +116,44 @@ MYMAP.init = function(selector, latLng, zoom) {
103
  if(typeof wpgmza_force_greedy_gestures !== "undefined"){
104
  myOptions.gestureHandling = wpgmza_force_greedy_gestures;
105
  }
 
 
 
 
 
 
 
 
 
 
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
  this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
109
  this.bounds = new google.maps.LatLngBounds();
110
 
111
-
112
- if ("undefined" !== typeof wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] && wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] !== false && wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] !== "") {
113
- wpgmza_theme_data = jQuery.parseJSON(wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data']);
114
- this.map.setOptions({styles: jQuery.parseJSON(wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'])});
115
- }
116
-
 
117
  jQuery( "#wpgmza_map").trigger( 'wpgooglemaps_loaded' );
118
 
119
-
120
-
121
  if (wpgmaps_localize_polygon_settings !== null) {
122
  if (typeof wpgmaps_localize_polygon_settings !== "undefined") {
123
  for(var poly_entry in wpgmaps_localize_polygon_settings) {
@@ -150,8 +186,11 @@ MYMAP.init = function(selector, latLng, zoom) {
150
  infoWindow.close();
151
  });
152
 
153
-
154
-
 
 
 
155
  }
156
 
157
  var infoWindow = new google.maps.InfoWindow();
@@ -162,7 +201,8 @@ google.maps.event.addDomListener(window, 'resize', function() {
162
  MYMAP.map.setCenter(myLatLng);
163
  });
164
  MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_type) {
165
- var check1 = 0;
 
166
  if (wpgmaps_localize_global_settings.wpgmza_settings_marker_pull === '1') {
167
  jQuery.get(filename, function(xml){
168
  jQuery(xml).find("marker").each(function(){
@@ -269,7 +309,7 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
269
 
270
 
271
  var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;
272
- if (wpmgza_infoopen === "1") {
273
  infoWindow.setContent(html);
274
  infoWindow.open(MYMAP.map, marker);
275
  }
@@ -279,8 +319,11 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
279
  }
280
  google.maps.event.addListener(marker, temp_actiontype, function() {
281
  infoWindow.close();
282
- infoWindow.setContent(html);
283
- infoWindow.open(MYMAP.map, marker);
 
 
 
284
  });
285
  }
286
  }
@@ -288,28 +331,32 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
288
 
289
  });
290
  } else {
291
- if (typeof wpgmaps_localize_marker_data !== "undefined") {
 
 
 
 
 
292
  jQuery.each(wpgmaps_localize_marker_data, function(i, val) {
293
-
294
-
295
  var wpmgza_map_id = val.map_id;
296
 
297
  if (wpmgza_map_id == map_id) {
298
-
299
  var wpmgza_address = val.address;
300
  var wpmgza_anim = val.anim;
301
  var wpmgza_infoopen = val.infoopen;
302
  var lat = val.lat;
303
  var lng = val.lng;
304
  var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
305
-
306
-
307
  var current_lat = val.lat;
308
  var current_lng = val.lng;
309
  var show_marker_radius = true;
310
 
311
  if (radius !== null) {
312
- if (check1 > 0 ) { } else {
313
 
314
 
315
  var point = new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));
@@ -344,23 +391,28 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
344
  radius: parseInt(radius / 0.001)
345
  };
346
  }
347
-
348
  cityCircle = new google.maps.Circle(populationOptions);
349
  check1 = check1 + 1;
350
  }
351
  var R = 0;
352
  if (distance_type === "1") {
353
- R = 3958.7558657440545;
354
  } else {
355
- R = 6378.16;
356
  }
357
  var dLat = toRad(searched_center.lat()-current_lat);
358
- var dLon = toRad(searched_center.lng()-current_lng);
359
- var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(toRad(current_lat)) * Math.cos(toRad(searched_center.lat())) * Math.sin(dLon/2) * Math.sin(dLon/2);
360
- var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
361
  var d = R * c;
362
-
363
- if (d < radius) { show_marker_radius = true; } else { show_marker_radius = false; }
 
 
 
 
 
364
  }
365
 
366
 
@@ -389,9 +441,9 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
389
  });
390
  }
391
  var d_string = "";
392
- if (radius !== null) {
393
  if (distance_type === "1") {
394
- d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";
395
  } else {
396
  d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";
397
  }
@@ -399,7 +451,7 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
399
 
400
 
401
  var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;
402
- if (wpmgza_infoopen === "1") {
403
  infoWindow.setContent(html);
404
  infoWindow.open(MYMAP.map, marker);
405
  }
@@ -409,13 +461,24 @@ MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_ty
409
  }
410
  google.maps.event.addListener(marker, temp_actiontype, function() {
411
  infoWindow.close();
412
- infoWindow.setContent(html);
413
- infoWindow.open(MYMAP.map, marker);
 
 
 
414
  });
415
  }
416
  }
417
  });
 
 
 
 
 
 
 
418
  }
 
419
  }
420
  }
421
 
@@ -463,8 +526,11 @@ function add_polygon(polygonid) {
463
  } else {
464
  var content = tmp_data['title'];
465
  }
466
- infoWindow_poly[polygonid].setContent(content);
467
- infoWindow_poly[polygonid].open(MYMAP.map,this.position);
 
 
 
468
  });
469
  }
470
 
19
  MYMAP.placeMarkers(wpgmaps_markerurl+'?u='+UniqueCode,wpgmaps_localize[wpgmaps_mapid].id,null,null,null);
20
  }
21
  jQuery(function() {
22
+
23
  jQuery(document).ready(function(){
24
+ if (/1\.([0-7])\.([0-9])/.test(jQuery.fn.jquery)) {
25
  setTimeout(function(){
26
  document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
27
  }, 6000);
28
  } else {
29
+ var temp;
30
+ var selector = "#wpgmza_map";
31
+ var mapElement = jQuery(selector);
32
+
33
+ var width = wpgmaps_localize[wpgmaps_mapid]['map_width']+wpgmaps_localize[wpgmaps_mapid]['map_width_type'];
34
+ var height = wpgmaps_localize[wpgmaps_mapid]['map_height']+wpgmaps_localize[wpgmaps_mapid]['map_height_type'];
35
+
36
+ if((temp = mapElement.attr("data-shortcode-width")) != "inherit")
37
+ width = temp;
38
+ if((temp = mapElement.attr("data-shortcode-height")) != "inherit")
39
+ height = temp;
40
+
41
+ mapElement.css({
42
+ width: width,
43
+ height: height
44
  });
45
+
46
  InitMap();
47
  jQuery('body').on('tabsactivate', function(){setTimeout(function(){InitMap();}, 500); });
48
  jQuery('body').on('tabsshow', function(){setTimeout(function(){InitMap();}, 500); });
86
 
87
 
88
  MYMAP.init = function(selector, latLng, zoom) {
89
+
90
  if (typeof wpgmaps_localize[wpgmaps_mapid].type !== "undefined") {
91
  if (wpgmaps_localize[wpgmaps_mapid].type === "1") { maptype = google.maps.MapTypeId.ROADMAP; }
92
  else if (wpgmaps_localize[wpgmaps_mapid].type === "2") { maptype = google.maps.MapTypeId.SATELLITE; }
116
  if(typeof wpgmza_force_greedy_gestures !== "undefined"){
117
  myOptions.gestureHandling = wpgmza_force_greedy_gestures;
118
  }
119
+
120
+ // NB: Perry: Moved this block up here and altered it so it plays nicely with other maps styles settings
121
+ if ("undefined" !== typeof wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] && wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] !== false && wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data'] !== "") {
122
+ if(!myOptions.styles)
123
+ myOptions.styles = [];
124
+
125
+ wpgmza_theme_data = jQuery.parseJSON(wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data']);
126
+
127
+ myOptions.styles = myOptions.styles.concat(jQuery.parseJSON(wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_theme_data']));
128
+ }
129
 
130
+ if(!wpgmaps_localize[wpgmaps_mapid]['other_settings']['wpgmza_show_points_of_interest'])
131
+ {
132
+ // Only create a new array if styles aren't set already, so no existing styles are overwritten
133
+ if(!myOptions.styles)
134
+ myOptions.styles = [];
135
+
136
+ // Push a style to hide all points of interest
137
+ myOptions.styles.push(
138
+ {
139
+ featureType: "poi",
140
+ stylers: [{visibility: "off"}]
141
+ }
142
+ );
143
+ }
144
 
145
  this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
146
  this.bounds = new google.maps.LatLngBounds();
147
 
148
+ /*var map = this.map;
149
+ google.maps.event.addDomListener(window, "resize", function() {
150
+ var center = map.getCenter();
151
+ google.maps.event.trigger(map, "resize");
152
+ map.setCenter(center);
153
+ });*/
154
+
155
  jQuery( "#wpgmza_map").trigger( 'wpgooglemaps_loaded' );
156
 
 
 
157
  if (wpgmaps_localize_polygon_settings !== null) {
158
  if (typeof wpgmaps_localize_polygon_settings !== "undefined") {
159
  for(var poly_entry in wpgmaps_localize_polygon_settings) {
186
  infoWindow.close();
187
  });
188
 
189
+ window.addEventListener("keydown", function(e) {
190
+ var k = (e.which ? e.which : e.keyCode);
191
+ if(k == 27)
192
+ infoWindow.close();
193
+ });
194
  }
195
 
196
  var infoWindow = new google.maps.InfoWindow();
201
  MYMAP.map.setCenter(myLatLng);
202
  });
203
  MYMAP.placeMarkers = function(filename,map_id,radius,searched_center,distance_type) {
204
+ var check1 = 0,
205
+ slNotFoundMessage = jQuery('.js-not-found-msg');
206
  if (wpgmaps_localize_global_settings.wpgmza_settings_marker_pull === '1') {
207
  jQuery.get(filename, function(xml){
208
  jQuery(xml).find("marker").each(function(){
309
 
310
 
311
  var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;
312
+ if (wpmgza_infoopen === "1" && !wpgmaps_localize_global_settings["wpgmza_settings_disable_infowindows"]) {
313
  infoWindow.setContent(html);
314
  infoWindow.open(MYMAP.map, marker);
315
  }
319
  }
320
  google.maps.event.addListener(marker, temp_actiontype, function() {
321
  infoWindow.close();
322
+ if(!wpgmaps_localize_global_settings["wpgmza_settings_disable_infowindows"])
323
+ {
324
+ infoWindow.setContent(html);
325
+ infoWindow.open(MYMAP.map, marker);
326
+ }
327
  });
328
  }
329
  }
331
 
332
  });
333
  } else {
334
+
335
+ if (Object.keys(wpgmaps_localize_marker_data).length > 0) {
336
+ var markerStoreLocatorsNum = 0;
337
+
338
+ if (typeof wpgmaps_localize_marker_data !== "undefined") {
339
+
340
  jQuery.each(wpgmaps_localize_marker_data, function(i, val) {
341
+
 
342
  var wpmgza_map_id = val.map_id;
343
 
344
  if (wpmgza_map_id == map_id) {
345
+
346
  var wpmgza_address = val.address;
347
  var wpmgza_anim = val.anim;
348
  var wpmgza_infoopen = val.infoopen;
349
  var lat = val.lat;
350
  var lng = val.lng;
351
  var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
352
+
353
+
354
  var current_lat = val.lat;
355
  var current_lng = val.lng;
356
  var show_marker_radius = true;
357
 
358
  if (radius !== null) {
359
+ if (check1 > 0 ) { } else {
360
 
361
 
362
  var point = new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));
391
  radius: parseInt(radius / 0.001)
392
  };
393
  }
394
+
395
  cityCircle = new google.maps.Circle(populationOptions);
396
  check1 = check1 + 1;
397
  }
398
  var R = 0;
399
  if (distance_type === "1") {
400
+ R = 3958.7558657440545;
401
  } else {
402
+ R = 6378.16;
403
  }
404
  var dLat = toRad(searched_center.lat()-current_lat);
405
+ var dLon = toRad(searched_center.lng()-current_lng);
406
+ var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(toRad(current_lat)) * Math.cos(toRad(searched_center.lat())) * Math.sin(dLon/2) * Math.sin(dLon/2);
407
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
408
  var d = R * c;
409
+
410
+ if (d < radius) {
411
+ show_marker_radius = true;
412
+ markerStoreLocatorsNum++;
413
+ } else {
414
+ show_marker_radius = false;
415
+ }
416
  }
417
 
418
 
441
  });
442
  }
443
  var d_string = "";
444
+ if (radius !== null) {
445
  if (distance_type === "1") {
446
+ d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";
447
  } else {
448
  d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";
449
  }
451
 
452
 
453
  var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;
454
+ if (wpmgza_infoopen === "1" && !wpgmaps_localize_global_settings["wpgmza_settings_disable_infowindows"]) {
455
  infoWindow.setContent(html);
456
  infoWindow.open(MYMAP.map, marker);
457
  }
461
  }
462
  google.maps.event.addListener(marker, temp_actiontype, function() {
463
  infoWindow.close();
464
+ if(!wpgmaps_localize_global_settings["wpgmza_settings_disable_infowindows"])
465
+ {
466
+ infoWindow.setContent(html);
467
+ infoWindow.open(MYMAP.map, marker);
468
+ }
469
  });
470
  }
471
  }
472
  });
473
+
474
+ if ('' !== jQuery('#addressInput').val() && markerStoreLocatorsNum < 1) {
475
+ slNotFoundMessage.addClass('is-active');
476
+ setTimeout(function () {
477
+ slNotFoundMessage.removeClass('is-active');
478
+ }, 5000);
479
+ }
480
  }
481
+ }
482
  }
483
  }
484
 
526
  } else {
527
  var content = tmp_data['title'];
528
  }
529
+ if(!wpgmaps_localize_global_settings["wpgmza_settings_disable_infowindows"])
530
+ {
531
+ infoWindow_poly[polygonid].setContent(content);
532
+ infoWindow_poly[polygonid].open(MYMAP.map,this.position);
533
+ }
534
  });
535
  }
536
 
js/wpgmaps.min.js CHANGED
@@ -1 +1 @@
1
- function InitMap(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);"undefined"!=typeof wpgmza_override_zoom?MYMAP.init("#wpgmza_map",a,parseInt(wpgmza_override_zoom)):MYMAP.init("#wpgmza_map",a,parseInt(wpgmaps_localize[0].map_start_zoom)),UniqueCode=Math.round(1e4*Math.random()),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,null,null,null)}function add_polygon(a){var b=wpgmaps_localize_polygon_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)"undefined"!=typeof d[tmp_entry2][0]&&e.push(new google.maps.LatLng(d[tmp_entry2][0],d[tmp_entry2][1]));null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1);var f=new google.maps.LatLngBounds;for(i=0;i<e.length;i++)f.extend(e[i]);WPGM_Path_Polygon[a]=new google.maps.Polygon({path:e,clickable:!0,strokeColor:"#"+b.linecolor,fillOpacity:b.opacity,strokeOpacity:b.lineopacity,fillColor:"#"+b.fillcolor,strokeWeight:2,map:MYMAP.map}),WPGM_Path_Polygon[a].setMap(MYMAP.map),polygon_center=f.getCenter(),""!==b.title&&(infoWindow_poly[a]=new google.maps.InfoWindow,google.maps.event.addListener(WPGM_Path_Polygon[a],"click",function(c){if(infoWindow_poly[a].setPosition(c.latLng),d="",""!==b.link)var d="<a href='"+b.link+"'>"+b.title+"</a>";else var d=b.title;infoWindow_poly[a].setContent(d),infoWindow_poly[a].open(MYMAP.map,this.position)}))}function add_polyline(a){var b=wpgmaps_localize_polyline_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)if("undefined"!=typeof d[tmp_entry2][0]&&"undefined"!=typeof d[tmp_entry2][1]){var f=d[tmp_entry2][0].replace(")","");f=f.replace("(","");var g=d[tmp_entry2][1].replace(")","");g=g.replace("(",""),e.push(new google.maps.LatLng(f,g))}null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1),WPGM_Path[a]=new google.maps.Polyline({path:e,strokeColor:"#"+b.linecolor,strokeOpacity:b.opacity,strokeWeight:b.linethickness,map:MYMAP.map}),WPGM_Path[a].setMap(MYMAP.map)}function fillInAddress(){autocomplete.getPlace()}function searchLocations(a){var b=document.getElementById("addressInput").value,c=new google.maps.Geocoder;"undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?c.geocode({address:b},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")}):c.geocode({address:b,componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")})}function clearLocations(){infoWindow.close()}function searchLocationsNear(a,b){clearLocations();var c=document.getElementById("wpgmza_distance_type").value,d=document.getElementById("radiusSelect").value;"1"===c?"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=9:"50"===d?zoomie=8:"75"===d?zoomie=8:"100"===d?zoomie=7:"150"===d?zoomie=7:"200"===d?zoomie=6:"300"===d?zoomie=6:zoomie=14:"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=10:"50"===d?zoomie=9:"75"===d?zoomie=8:"100"===d?zoomie=8:"150"===d?zoomie=7:"200"===d?zoomie=7:"300"===d?zoomie=6:zoomie=14,MYMAP.init("#wpgmza_map",b,zoomie,3),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,d,b,c)}function toRad(a){return a*Math.PI/180}var WPGM_Path_Polygon=new Array,WPGM_Path=new Array,infoWindow_poly=Array();for(var entry in wpgmaps_localize)"undefined"==typeof window.jQuery&&setTimeout(function(){document.getElementById("wpgmza_map").innerHTML='Error: In order for WP Google Maps to work, jQuery must be installed. A check was done and jQuery was not present. Please see the <a href="http://www.wpgmaps.com/documentation/troubleshooting/jquery-troubleshooting/" title="WP Google Maps - jQuery Troubleshooting">jQuery troubleshooting section of our site</a> for more information.'},5e3);jQuery(function(){jQuery(document).ready(function(){/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)?setTimeout(function(){document.getElementById("wpgmza_map").innerHTML="Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem."},6e3):(jQuery("#wpgmza_map").css({height:wpgmaps_localize[0].map_height+""+wpgmaps_localize[0].map_height_type,width:wpgmaps_localize[0].map_width+""+wpgmaps_localize[0].map_width_type}),InitMap(),jQuery("body").on("tabsactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("tabsshow",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("accordionactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".wpb_tabs_nav li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ui-tabs-nav li",function(a,b){InitMap()}),jQuery("body").on("click",".tp-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".nav-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".vc_tta-panel-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ult_exp_section",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-accordion-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-nav-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-title",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-link",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tabs_controls li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".fusion-tab-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tab",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tri-tabs-nav span",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".gdl-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click","#tabnav li",function(){setTimeout(function(){InitMap()},500)}))})});var MYMAP={map:null,bounds:null};""===wpgmaps_localize_global_settings.wpgmza_settings_map_draggable||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_draggable?wpgmza_settings_map_draggable=!0:wpgmza_settings_map_draggable=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom?wpgmza_settings_map_clickzoom=!1:wpgmza_settings_map_clickzoom=!0,""===wpgmaps_localize_global_settings.wpgmza_settings_map_scroll||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_scroll?wpgmza_settings_map_scroll=!0:wpgmza_settings_map_scroll=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_zoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_zoom?wpgmza_settings_map_zoom=!0:wpgmza_settings_map_zoom=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_pan||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_pan?wpgmza_settings_map_pan=!0:wpgmza_settings_map_pan=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_type||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_type?wpgmza_settings_map_type=!0:wpgmza_settings_map_type=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_streetview||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_streetview?wpgmza_settings_map_streetview=!0:wpgmza_settings_map_streetview=!1,"undefined"==typeof wpgmaps_localize[0].other_settings.map_max_zoom||""===wpgmaps_localize[0].other_settings.map_max_zoom?wpgmza_max_zoom=0:wpgmza_max_zoom=parseInt(wpgmaps_localize[0].other_settings.map_max_zoom),"undefined"==typeof wpgmaps_localize[0].other_settings.map_min_zoom||""===wpgmaps_localize[0].other_settings.map_min_zoom?wpgmza_min_zoom=21:wpgmza_min_zoom=parseInt(wpgmaps_localize[0].other_settings.map_min_zoom),MYMAP.init=function(a,b,c){"undefined"!=typeof wpgmaps_localize[0].type?"1"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.ROADMAP:"2"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.SATELLITE:"3"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.HYBRID:"4"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.TERRAIN:maptype=google.maps.MapTypeId.ROADMAP:maptype=google.maps.MapTypeId.ROADMAP;var d={zoom:c,minZoom:wpgmza_max_zoom,maxZoom:wpgmza_min_zoom,center:b,zoomControl:wpgmza_settings_map_zoom,panControl:wpgmza_settings_map_pan,mapTypeControl:wpgmza_settings_map_type,streetViewControl:wpgmza_settings_map_streetview,draggable:wpgmza_settings_map_draggable,disableDoubleClickZoom:wpgmza_settings_map_clickzoom,scrollwheel:wpgmza_settings_map_scroll,mapTypeId:maptype};if(this.map=new google.maps.Map(jQuery(a)[0],d),this.bounds=new google.maps.LatLngBounds,"undefined"!=typeof wpgmaps_localize[0].other_settings.wpgmza_theme_data&&wpgmaps_localize[0].other_settings.wpgmza_theme_data!==!1&&""!==wpgmaps_localize[0].other_settings.wpgmza_theme_data&&(wpgmza_theme_data=jQuery.parseJSON(wpgmaps_localize[0].other_settings.wpgmza_theme_data),this.map.setOptions({styles:jQuery.parseJSON(wpgmaps_localize[0].other_settings.wpgmza_theme_data)})),null!==wpgmaps_localize_polygon_settings&&"undefined"!=typeof wpgmaps_localize_polygon_settings)for(var e in wpgmaps_localize_polygon_settings)add_polygon(e);if(null!==wpgmaps_localize_polyline_settings&&"undefined"!=typeof wpgmaps_localize_polyline_settings)for(var e in wpgmaps_localize_polyline_settings)add_polyline(e);if("1"===wpgmaps_localize[0].bicycle){var f=new google.maps.BicyclingLayer;f.setMap(MYMAP.map)}if("1"===wpgmaps_localize[0].traffic){var g=new google.maps.TrafficLayer;g.setMap(MYMAP.map)}if("undefined"!=typeof wpgmaps_localize[0].other_settings.transport_layer&&1===wpgmaps_localize[0].other_settings.transport_layer){var h=new google.maps.TransitLayer;h.setMap(MYMAP.map)}google.maps.event.addListener(MYMAP.map,"click",function(){infoWindow.close()})};var infoWindow=new google.maps.InfoWindow;"undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&""!==wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&infoWindow.setOptions({maxWidth:wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width}),google.maps.event.addDomListener(window,"resize",function(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);MYMAP.map.setCenter(a)}),MYMAP.placeMarkers=function(a,b,c,d,e){var f=0;"1"===wpgmaps_localize_global_settings.wpgmza_settings_marker_pull?jQuery.get(a,function(a){jQuery(a).find("marker").each(function(){var a=jQuery(this).find("map_id").text();if(a==b){var g=jQuery(this).find("address").text(),h=jQuery(this).find("lat").text(),i=jQuery(this).find("lng").text(),j=jQuery(this).find("anim").text(),k=jQuery(this).find("infoopen").text(),l=jQuery(this).find("lat").text(),m=jQuery(this).find("lng").text(),n=!0;if(null!==c){if(f>0);else{var o=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(o),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/621371e-9)};else var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(q),f+=1}var r=0;r="1"===e?3958.7558657440545:6378.16;var s=toRad(d.lat()-l),t=toRad(d.lng()-m),u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(toRad(l))*Math.cos(toRad(d.lat()))*Math.sin(t/2)*Math.sin(t/2),v=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),w=r*v;n=w<c}var o=new google.maps.LatLng(parseFloat(h),parseFloat(i));if(MYMAP.bounds.extend(o),n===!0){if("1"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.DROP});else var p=new google.maps.Marker({position:o,map:MYMAP.map});var x="";x=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_km_away+"</p>":"";var y="<span style='min-width:100px; display:block;'>"+g+"</span>"+x;"1"===k&&(infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(p,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)})}}})}):wpgmaps_localize_marker_data.length>0&&jQuery.each(wpgmaps_localize_marker_data,function(a,g){var h=g.map_id;if(h==b){var i=g.address,j=g.anim,k=g.infoopen,l=g.lat,m=g.lng,n=new google.maps.LatLng(parseFloat(l),parseFloat(m)),o=g.lat,p=g.lng,q=!0;if(null!==c){if(f>0);else{var n=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(n),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var r=new google.maps.Marker({position:n,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var s={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:n,radius:parseInt(c/621371e-9)};else var s={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:n,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(s),f+=1}var t=0;t="1"===e?3958.7558657440545:6378.16;var u=toRad(d.lat()-o),v=toRad(d.lng()-p),w=Math.sin(u/2)*Math.sin(u/2)+Math.cos(toRad(o))*Math.cos(toRad(d.lat()))*Math.sin(v/2)*Math.sin(v/2),x=2*Math.atan2(Math.sqrt(w),Math.sqrt(1-w)),y=t*x;q=y<c}var n=new google.maps.LatLng(parseFloat(l),parseFloat(m));if(MYMAP.bounds.extend(n),q===!0){if("1"===j)var r=new google.maps.Marker({position:n,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===j)var r=new google.maps.Marker({position:n,map:MYMAP.map,animation:google.maps.Animation.DROP});else var r=new google.maps.Marker({position:n,map:MYMAP.map});var z="";z=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(y,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(y,2)+" "+wpgmaps_lang_km_away+"</p>":"";var A="<span style='min-width:100px; display:block;'>"+i+"</span>"+z;"1"===k&&(infoWindow.setContent(A),infoWindow.open(MYMAP.map,r)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(r,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(A),infoWindow.open(MYMAP.map,r)})}}})},jQuery("body").on("keypress","#addressInput",function(a){13==a.which&&jQuery(".wpgmza_sl_search_button").trigger("click")});var autocomplete,elementExists=document.getElementById("addressInput");"object"==typeof google&&"object"==typeof google.maps&&"object"==typeof google.maps.places&&"function"==typeof google.maps.places.Autocomplete&&null!==elementExists&&("undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"]}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})):(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"],componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})));
1
+ function InitMap(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);"undefined"!=typeof wpgmza_override_zoom?MYMAP.init("#wpgmza_map",a,parseInt(wpgmza_override_zoom)):MYMAP.init("#wpgmza_map",a,parseInt(wpgmaps_localize[0].map_start_zoom)),UniqueCode=Math.round(1e4*Math.random()),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,null,null,null)}function add_polygon(a){var b=wpgmaps_localize_polygon_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)"undefined"!=typeof d[tmp_entry2][0]&&e.push(new google.maps.LatLng(d[tmp_entry2][0],d[tmp_entry2][1]));null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1);var f=new google.maps.LatLngBounds;for(i=0;i<e.length;i++)f.extend(e[i]);WPGM_Path_Polygon[a]=new google.maps.Polygon({path:e,clickable:!0,strokeColor:"#"+b.linecolor,fillOpacity:b.opacity,strokeOpacity:b.lineopacity,fillColor:"#"+b.fillcolor,strokeWeight:2,map:MYMAP.map}),WPGM_Path_Polygon[a].setMap(MYMAP.map),polygon_center=f.getCenter(),""!==b.title&&(infoWindow_poly[a]=new google.maps.InfoWindow,google.maps.event.addListener(WPGM_Path_Polygon[a],"click",function(c){if(infoWindow_poly[a].setPosition(c.latLng),d="",""!==b.link)var d="<a href='"+b.link+"'>"+b.title+"</a>";else var d=b.title;infoWindow_poly[a].setContent(d),infoWindow_poly[a].open(MYMAP.map,this.position)}))}function add_polyline(a){var b=wpgmaps_localize_polyline_settings[a],d=b.polydata,e=new Array;for(tmp_entry2 in d)if("undefined"!=typeof d[tmp_entry2][0]&&"undefined"!=typeof d[tmp_entry2][1]){var f=d[tmp_entry2][0].replace(")","");f=f.replace("(","");var g=d[tmp_entry2][1].replace(")","");g=g.replace("(",""),e.push(new google.maps.LatLng(f,g))}null!==b.lineopacity&&""!==b.lineopacity||(b.lineopacity=1),WPGM_Path[a]=new google.maps.Polyline({path:e,strokeColor:"#"+b.linecolor,strokeOpacity:b.opacity,strokeWeight:b.linethickness,map:MYMAP.map}),WPGM_Path[a].setMap(MYMAP.map)}function fillInAddress(){autocomplete.getPlace()}function searchLocations(a){var b=document.getElementById("addressInput").value,c=new google.maps.Geocoder;"undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?c.geocode({address:b},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")}):c.geocode({address:b,componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}},function(c,d){d===google.maps.GeocoderStatus.OK?searchLocationsNear(a,c[0].geometry.location):alert(b+" not found")})}function clearLocations(){infoWindow.close()}function searchLocationsNear(a,b){clearLocations();var c=document.getElementById("wpgmza_distance_type").value,d=document.getElementById("radiusSelect").value;"1"===c?"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=9:"50"===d?zoomie=8:"75"===d?zoomie=8:"100"===d?zoomie=7:"150"===d?zoomie=7:"200"===d?zoomie=6:"300"===d?zoomie=6:zoomie=14:"1"===d?zoomie=14:"5"===d?zoomie=12:"10"===d?zoomie=11:"25"===d?zoomie=10:"50"===d?zoomie=9:"75"===d?zoomie=8:"100"===d?zoomie=8:"150"===d?zoomie=7:"200"===d?zoomie=7:"300"===d?zoomie=6:zoomie=14,MYMAP.init("#wpgmza_map",b,zoomie,3),MYMAP.placeMarkers(wpgmaps_markerurl+"?u="+UniqueCode,wpgmaps_localize[0].id,d,b,c)}function toRad(a){return a*Math.PI/180}var WPGM_Path_Polygon=new Array,WPGM_Path=new Array,infoWindow_poly=Array();for(var entry in wpgmaps_localize)"undefined"==typeof window.jQuery&&setTimeout(function(){document.getElementById("wpgmza_map").innerHTML='Error: In order for WP Google Maps to work, jQuery must be installed. A check was done and jQuery was not present. Please see the <a href="http://www.wpgmaps.com/documentation/troubleshooting/jquery-troubleshooting/" title="WP Google Maps - jQuery Troubleshooting">jQuery troubleshooting section of our site</a> for more information.'},5e3);jQuery(function(){jQuery(document).ready(function(){/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)?setTimeout(function(){document.getElementById("wpgmza_map").innerHTML="Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem."},6e3):(jQuery("#wpgmza_map").css({height:wpgmaps_localize[0].map_height+""+wpgmaps_localize[0].map_height_type,width:wpgmaps_localize[0].map_width+""+wpgmaps_localize[0].map_width_type}),InitMap(),jQuery("body").on("tabsactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("tabsshow",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("accordionactivate",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".wpb_tabs_nav li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ui-tabs-nav li",function(a,b){InitMap()}),jQuery("body").on("click",".tp-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".nav-tabs li a",function(a,b){InitMap()}),jQuery("body").on("click",".vc_tta-panel-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".ult_exp_section",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-accordion-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".x-nav-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-title",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tab-link",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tabs_controls li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".fusion-tab-heading",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".et_pb_tab",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".tri-tabs-nav span",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click",".gdl-tabs li",function(){setTimeout(function(){InitMap()},500)}),jQuery("body").on("click","#tabnav li",function(){setTimeout(function(){InitMap()},500)}))})});var MYMAP={map:null,bounds:null};""===wpgmaps_localize_global_settings.wpgmza_settings_map_draggable||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_draggable?wpgmza_settings_map_draggable=!0:wpgmza_settings_map_draggable=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_clickzoom?wpgmza_settings_map_clickzoom=!1:wpgmza_settings_map_clickzoom=!0,""===wpgmaps_localize_global_settings.wpgmza_settings_map_scroll||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_scroll?wpgmza_settings_map_scroll=!0:wpgmza_settings_map_scroll=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_zoom||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_zoom?wpgmza_settings_map_zoom=!0:wpgmza_settings_map_zoom=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_pan||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_pan?wpgmza_settings_map_pan=!0:wpgmza_settings_map_pan=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_type||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_type?wpgmza_settings_map_type=!0:wpgmza_settings_map_type=!1,""===wpgmaps_localize_global_settings.wpgmza_settings_map_streetview||"undefined"==typeof wpgmaps_localize_global_settings.wpgmza_settings_map_streetview?wpgmza_settings_map_streetview=!0:wpgmza_settings_map_streetview=!1,"undefined"==typeof wpgmaps_localize[0].other_settings.map_max_zoom||""===wpgmaps_localize[0].other_settings.map_max_zoom?wpgmza_max_zoom=0:wpgmza_max_zoom=parseInt(wpgmaps_localize[0].other_settings.map_max_zoom),"undefined"==typeof wpgmaps_localize[0].other_settings.map_min_zoom||""===wpgmaps_localize[0].other_settings.map_min_zoom?wpgmza_min_zoom=21:wpgmza_min_zoom=parseInt(wpgmaps_localize[0].other_settings.map_min_zoom),MYMAP.init=function(a,b,c){"undefined"!=typeof wpgmaps_localize[0].type?"1"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.ROADMAP:"2"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.SATELLITE:"3"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.HYBRID:"4"===wpgmaps_localize[0].type?maptype=google.maps.MapTypeId.TERRAIN:maptype=google.maps.MapTypeId.ROADMAP:maptype=google.maps.MapTypeId.ROADMAP;var d={zoom:c,minZoom:wpgmza_max_zoom,maxZoom:wpgmza_min_zoom,center:b,zoomControl:wpgmza_settings_map_zoom,panControl:wpgmza_settings_map_pan,mapTypeControl:wpgmza_settings_map_type,streetViewControl:wpgmza_settings_map_streetview,draggable:wpgmza_settings_map_draggable,disableDoubleClickZoom:wpgmza_settings_map_clickzoom,scrollwheel:wpgmza_settings_map_scroll,mapTypeId:maptype};if(this.map=new google.maps.Map(jQuery(a)[0],d),this.bounds=new google.maps.LatLngBounds,"undefined"!=typeof wpgmaps_localize[0].other_settings.wpgmza_theme_data&&wpgmaps_localize[0].other_settings.wpgmza_theme_data!==!1&&""!==wpgmaps_localize[0].other_settings.wpgmza_theme_data&&(wpgmza_theme_data=jQuery.parseJSON(wpgmaps_localize[0].other_settings.wpgmza_theme_data),this.map.setOptions({styles:jQuery.parseJSON(wpgmaps_localize[0].other_settings.wpgmza_theme_data)})),null!==wpgmaps_localize_polygon_settings&&"undefined"!=typeof wpgmaps_localize_polygon_settings)for(var e in wpgmaps_localize_polygon_settings)add_polygon(e);if(null!==wpgmaps_localize_polyline_settings&&"undefined"!=typeof wpgmaps_localize_polyline_settings)for(var e in wpgmaps_localize_polyline_settings)add_polyline(e);if("1"===wpgmaps_localize[0].bicycle){var f=new google.maps.BicyclingLayer;f.setMap(MYMAP.map)}if("1"===wpgmaps_localize[0].traffic){var g=new google.maps.TrafficLayer;g.setMap(MYMAP.map)}if("undefined"!=typeof wpgmaps_localize[0].other_settings.transport_layer&&1===wpgmaps_localize[0].other_settings.transport_layer){var h=new google.maps.TransitLayer;h.setMap(MYMAP.map)}google.maps.event.addListener(MYMAP.map,"click",function(){infoWindow.close()})};var infoWindow=new google.maps.InfoWindow;"undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&""!==wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width&&infoWindow.setOptions({maxWidth:wpgmaps_localize_global_settings.wpgmza_settings_infowindow_width}),google.maps.event.addDomListener(window,"resize",function(){var a=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);MYMAP.map.setCenter(a)}),MYMAP.placeMarkers=function(a,b,c,d,e){var f=0,g=jQuery(".js-not-found-msg");if("1"===wpgmaps_localize_global_settings.wpgmza_settings_marker_pull)jQuery.get(a,function(a){jQuery(a).find("marker").each(function(){var a=jQuery(this).find("map_id").text();if(a==b){var g=jQuery(this).find("address").text(),h=jQuery(this).find("lat").text(),i=jQuery(this).find("lng").text(),j=jQuery(this).find("anim").text(),k=jQuery(this).find("infoopen").text(),l=jQuery(this).find("lat").text(),m=jQuery(this).find("lng").text(),n=!0;if(null!==c){if(f>0);else{var o=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(o),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/621371e-9)};else var q={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(q),f+=1}var r=0;r="1"===e?3958.7558657440545:6378.16;var s=toRad(d.lat()-l),t=toRad(d.lng()-m),u=Math.sin(s/2)*Math.sin(s/2)+Math.cos(toRad(l))*Math.cos(toRad(d.lat()))*Math.sin(t/2)*Math.sin(t/2),v=2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),w=r*v;n=w<c}var o=new google.maps.LatLng(parseFloat(h),parseFloat(i));if(MYMAP.bounds.extend(o),n===!0){if("1"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===j)var p=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.DROP});else var p=new google.maps.Marker({position:o,map:MYMAP.map});var x="";x=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(w,2)+" "+wpgmaps_lang_km_away+"</p>":"";var y="<span style='min-width:100px; display:block;'>"+g+"</span>"+x;"1"===k&&(infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(p,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(y),infoWindow.open(MYMAP.map,p)})}}})});else if(wpgmaps_localize_marker_data.length>0){var h=0;jQuery.each(wpgmaps_localize_marker_data,function(a,g){var i=g.map_id;if(i==b){var j=g.address,k=g.anim,l=g.infoopen,m=g.lat,n=g.lng,o=new google.maps.LatLng(parseFloat(m),parseFloat(n)),p=g.lat,q=g.lng,r=!0;if(null!==c){if(f>0);else{var o=new google.maps.LatLng(parseFloat(d.lat()),parseFloat(d.lng()));if(MYMAP.bounds.extend(o),"undefined"==typeof wpgmaps_localize[0].other_settings.store_locator_bounce||1===wpgmaps_localize[0].other_settings.store_locator_bounce)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});if("1"===e)var t={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/621371e-9)};else var t={strokeColor:"#FF0000",strokeOpacity:.25,strokeWeight:2,fillColor:"#FF0000",fillOpacity:.15,map:MYMAP.map,center:o,radius:parseInt(c/.001)};cityCircle=new google.maps.Circle(t),f+=1}var u=0;u="1"===e?3958.7558657440545:6378.16;var v=toRad(d.lat()-p),w=toRad(d.lng()-q),x=Math.sin(v/2)*Math.sin(v/2)+Math.cos(toRad(p))*Math.cos(toRad(d.lat()))*Math.sin(w/2)*Math.sin(w/2),y=2*Math.atan2(Math.sqrt(x),Math.sqrt(1-x)),z=u*y;z<c?(r=!0,h++):r=!1}var o=new google.maps.LatLng(parseFloat(m),parseFloat(n));if(MYMAP.bounds.extend(o),r===!0){if("1"===k)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});else if("2"===k)var s=new google.maps.Marker({position:o,map:MYMAP.map,animation:google.maps.Animation.DROP});else var s=new google.maps.Marker({position:o,map:MYMAP.map});var A="";A=null!==c?"1"===e?"<p style='min-width:100px; display:block;'>"+Math.round(z,2)+" "+wpgmaps_lang_m_away+"</p>":"<p style='min-width:100px; display:block;'>"+Math.round(z,2)+" "+wpgmaps_lang_km_away+"</p>":"";var B="<span style='min-width:100px; display:block;'>"+j+"</span>"+A;"1"===l&&(infoWindow.setContent(B),infoWindow.open(MYMAP.map,s)),temp_actiontype="click","undefined"!=typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&"2"==wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by&&(temp_actiontype="mouseover"),google.maps.event.addListener(s,temp_actiontype,function(){infoWindow.close(),infoWindow.setContent(B),infoWindow.open(MYMAP.map,s)})}}}),""!==jQuery("#addressInput").val()&&h<1&&(g.addClass("is-active"),setTimeout(function(){g.removeClass("is-active")},5e3))}},jQuery("body").on("keypress","#addressInput",function(a){13==a.which&&jQuery(".wpgmza_sl_search_button").trigger("click")});var autocomplete,elementExists=document.getElementById("addressInput");"object"==typeof google&&"object"==typeof google.maps&&"object"==typeof google.maps.places&&"function"==typeof google.maps.places.Autocomplete&&null!==elementExists&&("undefined"==typeof wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict||""===wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict?(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"]}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})):(autocomplete=new google.maps.places.Autocomplete(document.getElementById("addressInput"),{types:["geocode"],componentRestrictions:{country:wpgmaps_localize[0].other_settings.wpgmza_store_locator_restrict}}),google.maps.event.addListener(autocomplete,"place_changed",function(){fillInAddress()})));
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WPGMaps, NickDuncan, CodeCabin_, Jarryd Long, DylanAuty
3
  Donate link: http://www.wpgmaps.com
4
  Tags: google maps, maps, map, map markers, google map, google maps plugin, wp google maps, wp google map, map plugin, directions, google map plugin, map widget
5
  Requires at least: 3.5
6
- Tested up to: 4.7
7
  Stable tag: trunk
8
  License: GPLv2
9
 
@@ -214,6 +214,9 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
214
 
215
  == Changelog ==
216
 
 
 
 
217
  = 6.4.03 - 2017-02-17 - Low priority =
218
  * Added the ability for affiliates to make use of their affiliate IDs in the pro links
219
  * Added better SSL support
3
  Donate link: http://www.wpgmaps.com
4
  Tags: google maps, maps, map, map markers, google map, google maps plugin, wp google maps, wp google map, map plugin, directions, google map plugin, map widget
5
  Requires at least: 3.5
6
+ Tested up to: 4.8
7
  Stable tag: trunk
8
  License: GPLv2
9
 
214
 
215
  == Changelog ==
216
 
217
+ = 6.4.04 - 2017-06-08 - Low priority =
218
+ * Tested on WordPress 4.8
219
+
220
  = 6.4.03 - 2017-02-17 - Low priority =
221
  * Added the ability for affiliates to make use of their affiliate IDs in the pro links
222
  * Added better SSL support
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
- Version: 6.4.03
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
@@ -11,7 +11,10 @@ Domain Path: /languages
11
  */
12
 
13
  /*
14
- *
 
 
 
15
  * 6.4.03 - 2017-02-17 - Low priority
16
  * Added the ability for affiliates to make use of their affiliate IDs in the pro links
17
  * Added better SSL support
@@ -318,8 +321,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
318
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
319
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
320
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
321
- $wpgmza_version = "6.4.03";
322
- $wpgmza_p_version = "6.11";
323
  $wpgmza_t = "basic";
324
  define("WPGMAPS", $wpgmza_version);
325
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -2294,10 +2297,11 @@ function wpgmaps_tag_basic( $atts ) {
2294
 
2295
 
2296
  extract( shortcode_atts( array(
2297
- 'id' => '1'
 
 
2298
  ), $atts ) );
2299
 
2300
-
2301
  $ret_msg = "";
2302
  $wpgmza_current_map_id = $atts['id'];
2303
 
@@ -2356,6 +2360,13 @@ function wpgmaps_tag_basic( $atts ) {
2356
  if ($map_width_type == "%" && intval($res->map_width) > 100) { $res->map_width = 100; }
2357
  if ($map_height_type == "%" && intval($res->map_height) > 100) { $res->map_height = 100; }
2358
 
 
 
 
 
 
 
 
2359
  if (!$map_align || $map_align == "" || $map_align == "1") { $map_align = "float:left;"; }
2360
  else if ($map_align == "2") { $map_align = "margin-left:auto !important; margin-right:auto; !important; align:center;"; }
2361
  else if ($map_align == "3") { $map_align = "float:right;"; }
@@ -2368,10 +2379,9 @@ function wpgmaps_tag_basic( $atts ) {
2368
  $sl_data = wpgmaps_sl_user_output_basic($wpgmza_current_map_id);
2369
  } else { $sl_data = ""; }
2370
 
2371
-
2372
  $ret_msg .= "
2373
  $sl_data
2374
- ".apply_filters("wpgooglemaps_filter_map_div_output","<div id=\"wpgmza_map\" $map_style>",$wpgmza_current_map_id)."
2375
 
2376
  </div>
2377
  ";
@@ -2584,18 +2594,20 @@ function wpgmaps_sl_user_output_basic($map_id) {
2584
 
2585
  if (isset($map_other_settings['store_locator_query_string'])) { $sl_query_string = stripslashes($map_other_settings['store_locator_query_string']); } else { $sl_query_string = __("ZIP / Address:","wp-google-maps"); }
2586
  if (isset($map_other_settings['store_locator_default_address'])) { $sl_default_address = stripslashes($map_other_settings['store_locator_default_address']); } else { $sl_default_address = ''; }
2587
-
2588
- if ($map_width_type == "px" && $map_width < 300) { $map_width = "300"; }
 
 
2589
 
2590
  $ret_msg = "";
2591
 
2592
  $ret_msg .= "<div class=\"wpgmza_sl_main_div\">";
2593
- $ret_msg .= " <div class=\"wpgmza_sl_query_div\">";
2594
  $ret_msg .= " <div class=\"wpgmza_sl_query_innerdiv1\"><label for='addressInput'>".esc_attr($sl_query_string)."</label></div>";
2595
  $ret_msg .= " <div class=\"wpgmza_sl_query_innerdiv2\"><input type=\"text\" id=\"addressInput\" size=\"20\" value=\"".$sl_default_address."\" /></div>";
2596
  $ret_msg .= " </div>";
2597
 
2598
- $ret_msg .= " <div class=\"wpgmza_sl_radius_div\">";
2599
  $ret_msg .= " <div class=\"wpgmza_sl_radius_innerdiv1\"><label for='radiusSelect'>".__("Radius","wp-google-maps").":</label></div>";
2600
  $ret_msg .= " <div class=\"wpgmza_sl_radius_innerdiv2\">";
2601
  $ret_msg .= " <select class=\"wpgmza_sl_radius_select\" id=\"radiusSelect\">";
@@ -2603,27 +2615,27 @@ function wpgmaps_sl_user_output_basic($map_id) {
2603
 
2604
  $map_other_settings['store_locator_distance'] = isset($map_other_settings['store_locator_distance']) ? intval($map_other_settings['store_locator_distance']) : 2;
2605
  if (isset($map_other_settings['store_locator_distance']) && $map_other_settings['store_locator_distance'] === 1) {
2606
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"1\">".__("1mi","wp-google-maps")."</option>";
2607
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"5\">".__("5mi","wp-google-maps")."</option>";
2608
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"10\" selected>".__("10mi","wp-google-maps")."</option>";
2609
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"25\">".__("25mi","wp-google-maps")."</option>";
2610
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"50\">".__("50mi","wp-google-maps")."</option>";
2611
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"75\">".__("75mi","wp-google-maps")."</option>";
2612
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"100\">".__("100mi","wp-google-maps")."</option>";
2613
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"150\">".__("150mi","wp-google-maps")."</option>";
2614
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"200\">".__("200mi","wp-google-maps")."</option>";
2615
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"300\">".__("300mi","wp-google-maps")."</option>";
2616
  } else {
2617
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"1\">".__("1km","wp-google-maps")."</option>";
2618
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"5\">".__("5km","wp-google-maps")."</option>";
2619
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"10\" selected>".__("10km","wp-google-maps")."</option>";
2620
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"25\">".__("25km","wp-google-maps")."</option>";
2621
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"50\">".__("50km","wp-google-maps")."</option>";
2622
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"75\">".__("75km","wp-google-maps")."</option>";
2623
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"100\">".__("100km","wp-google-maps")."</option>";
2624
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"150\">".__("150km","wp-google-maps")."</option>";
2625
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"200\">".__("200km","wp-google-maps")."</option>";
2626
- $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"300\">".__("300km","wp-google-maps")."</option>";
2627
  }
2628
 
2629
  $ret_msg .= " </select><input type='hidden' value='".$map_other_settings['store_locator_distance']."' name='wpgmza_distance_type' id='wpgmza_distance_type' style='display:none;' />";
@@ -2639,8 +2651,10 @@ function wpgmaps_sl_user_output_basic($map_id) {
2639
  $ret_msg .= " </div>";
2640
  }
2641
 
2642
- $ret_msg .= " <input class=\"wpgmza_sl_search_button\" type=\"button\" onclick=\"searchLocations($map_id)\" value=\"".apply_filters("wpgmza_filter_store_locator_button_search_string",__("Search","wp-google-maps"))."\"/>";
2643
- $ret_msg .= " </div>";
 
 
2644
  $ret_msg .= " <div><select id=\"locationSelect\" style=\"width:100%;visibility:hidden\"></select></div>";
2645
 
2646
  return $ret_msg;
@@ -2714,6 +2728,8 @@ function wpgmaps_head() {
2714
 
2715
  $other_settings['store_locator_enabled'] = isset($_POST['wpgmza_store_locator']) ? 1 : 2;
2716
  $other_settings['store_locator_distance'] = isset($_POST['wpgmza_store_locator_distance']) ? 1 : 2;
 
 
2717
  $other_settings['store_locator_bounce'] = isset($_POST['wpgmza_store_locator_bounce']) ? 1 : 2;
2718
 
2719
  $other_settings['store_locator_query_string'] = sanitize_text_field($_POST['wpgmza_store_locator_query_string']);
@@ -2743,6 +2759,7 @@ function wpgmaps_head() {
2743
  /* overwrite theme data if a custom theme is selected */
2744
  if (isset($_POST['wpgmza_styling_json'])) { $other_settings['wpgmza_theme_data'] = sanitize_text_field($_POST['wpgmza_styling_json']); }
2745
 
 
2746
 
2747
  $other_settings_data = maybe_serialize($other_settings);
2748
 
@@ -3052,6 +3069,7 @@ function wpgmaps_head() {
3052
  if (isset($_POST['wpgmza_settings_map_draggable'])) { $wpgmza_data['wpgmza_settings_map_draggable'] = sanitize_text_field($_POST['wpgmza_settings_map_draggable']); }
3053
  if (isset($_POST['wpgmza_settings_map_clickzoom'])) { $wpgmza_data['wpgmza_settings_map_clickzoom'] = sanitize_text_field($_POST['wpgmza_settings_map_clickzoom']); }
3054
  if (isset($_POST['wpgmza_settings_map_open_marker_by'])) { $wpgmza_data['wpgmza_settings_map_open_marker_by'] = sanitize_text_field($_POST['wpgmza_settings_map_open_marker_by']); }
 
3055
  if (isset($_POST['wpgmza_api_version'])) { $wpgmza_data['wpgmza_api_version'] = sanitize_text_field($_POST['wpgmza_api_version']); }
3056
  if (isset($_POST['wpgmza_custom_css'])) { $wpgmza_data['wpgmza_custom_css'] = sanitize_text_field($_POST['wpgmza_custom_css']); }
3057
  if (isset($_POST['wpgmza_marker_xml_location'])) { update_option("wpgmza_xml_location",sanitize_text_field($_POST['wpgmza_marker_xml_location'])); }
@@ -3712,6 +3730,9 @@ function wpgmaps_settings_page_basic() {
3712
  else if ($wpgmza_settings_map_open_marker_by == '2') { $wpgmza_settings_map_open_marker_by_checked[1] = "checked='checked'"; }
3713
  else { $wpgmza_settings_map_open_marker_by_checked[0] = "checked='checked'"; }
3714
 
 
 
 
3715
 
3716
  $show_advanced_marker_tr = 'style="visibility:hidden; display:none;"';
3717
  $wpgmza_settings_marker_pull_checked[0] = "";
@@ -3900,9 +3921,17 @@ function wpgmaps_settings_page_basic() {
3900
  $ret .= " <td valign='top' width='200' style='vertical-align:top;'>".__("Open Marker InfoWindows by","wp-google-maps")." </td>";
3901
  $ret .= " <td><input name='wpgmza_settings_map_open_marker_by' type='radio' id='wpgmza_settings_map_open_marker_by' value='1' ".$wpgmza_settings_map_open_marker_by_checked[0]." />Click<br /><input name='wpgmza_settings_map_open_marker_by' type='radio' id='wpgmza_settings_map_open_marker_by' value='2' ".$wpgmza_settings_map_open_marker_by_checked[1]." />Hover </td>";
3902
  $ret .= " </tr>";
 
 
 
 
 
 
 
3903
 
3904
  $ret .= " </table>";
3905
  $ret .= " </div>";
 
3906
  $ret .= " <div id=\"tabs-3\">";
3907
 
3908
  $ret .= " <table class='form-table'>";
@@ -4271,9 +4300,11 @@ function wpgmza_basic_menu() {
4271
  $other_settings_data = maybe_unserialize($res->other_settings);
4272
  if (isset($other_settings_data['store_locator_enabled'])) { $wpgmza_store_locator_enabled = $other_settings_data['store_locator_enabled']; } else { $wpgmza_store_locator_enabled = 0; }
4273
  if (isset($other_settings_data['store_locator_distance'])) { $wpgmza_store_locator_distance = $other_settings_data['store_locator_distance']; } else { $wpgmza_store_locator_distance = 0; }
 
4274
  if (isset($other_settings_data['store_locator_bounce'])) { $wpgmza_store_locator_bounce = $other_settings_data['store_locator_bounce']; } else { $wpgmza_store_locator_bounce = 1; }
4275
  if (isset($other_settings_data['store_locator_query_string'])) { $wpgmza_store_locator_query_string = stripslashes($other_settings_data['store_locator_query_string']); } else { $wpgmza_store_locator_query_string = __("ZIP / Address:","wp-google-maps"); }
4276
  if (isset($other_settings_data['store_locator_default_address'])) { $wpgmza_store_locator_default_address = stripslashes($other_settings_data['store_locator_default_address']); } else { $wpgmza_store_locator_default_address = ""; }
 
4277
  if (isset($other_settings_data['wpgmza_store_locator_restrict'])) { $wpgmza_store_locator_restrict = $other_settings_data['wpgmza_store_locator_restrict']; } else { $wpgmza_store_locator_restrict = ""; }
4278
 
4279
  /* deprecated in 6.2.0
@@ -4405,9 +4436,9 @@ function wpgmza_basic_menu() {
4405
  $wpgmza_theme_data_custom = '';
4406
  }
4407
  }
4408
-
4409
 
4410
- google_maps_api_key_warning();
 
4411
  echo "
4412
 
4413
  <div class='wrap'>
@@ -4657,6 +4688,41 @@ function wpgmza_basic_menu() {
4657
  </div>
4658
  </td>
4659
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4660
  <tr>
4661
  <td>".__("Query string","wp-google-maps").":</td>
4662
  <td><input type=\"text\" name=\"wpgmza_store_locator_query_string\" id=\"wpgmza_store_locator_query_string\" value=\"".esc_attr($wpgmza_store_locator_query_string)."\">
@@ -4667,6 +4733,11 @@ function wpgmza_basic_menu() {
4667
  <td><input type=\"text\" name=\"wpgmza_store_locator_default_address\" id=\"wpgmza_store_locator_default_address\" value=\"".esc_attr($wpgmza_store_locator_default_address)."\">
4668
  </td>
4669
  </tr>
 
 
 
 
 
4670
  <tr>
4671
  <td width='200'>".__("Show bouncing icon","wp-google-maps").":</td>
4672
  <td>
@@ -4771,8 +4842,23 @@ function wpgmza_basic_menu() {
4771
 
4772
  </td>
4773
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4774
  <tr>
4775
-
4776
  </tr>
4777
  <tr>
4778
  <td></td>
@@ -5497,6 +5583,9 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%",$mashup
5497
  if ($admin) {
5498
 
5499
  $wpgmza_tmp_body .= "<tr id=\"wpgmza_tr_".$result->id."\" class=\"gradeU\">";
 
 
 
5500
  $wpgmza_tmp_body .= "<td height=\"40\">".$result->id."</td>";
5501
  $wpgmza_tmp_body .= "<td height=\"40\">".$icon."<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_".$result->id."\" value=\"".$result->icon."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_".$result->id."\" value=\"".$result->anim."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_category_".$result->id."\" value=\"".$result->category."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_".$result->id."\" value=\"".$result->infoopen."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_approved_".$result->id."\" value=\"".$result->approved."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_retina_".$result->id."\" value=\"".$result->retina."\" /></td>";
5502
  $wpgmza_tmp_body .= "<td>".stripslashes($result->title)."<input type=\"hidden\" id=\"wpgmza_hid_marker_title_".$result->id."\" value=\"".stripslashes($result->title)."\" /></td>";
@@ -5530,6 +5619,7 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%",$mashup
5530
  $wpgmza_tmp_head .= "<table id=\"wpgmza_table\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">";
5531
  $wpgmza_tmp_head .= "<thead>";
5532
  $wpgmza_tmp_head .= "<tr>";
 
5533
  $wpgmza_tmp_head .= " <th><strong>".__("ID","wp-google-maps")."</strong></th>";
5534
  $wpgmza_tmp_head .= " <th><strong>".__("Icon","wp-google-maps")."</strong></th>";
5535
  $wpgmza_tmp_head .= " <th><strong>".apply_filters("wpgmza_filter_title_name",__("Title","wp-google-maps"))."</strong></th>";
@@ -5559,11 +5649,20 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%",$mashup
5559
  $wpgmza_tmp_head .= "</thead>";
5560
  $wpgmza_tmp_head .= "<tbody>";
5561
  }
5562
- if ($admin) {
5563
- $wpgmza_tmp_footer .= "</tbody></table>";
5564
- } else {
5565
- $wpgmza_tmp_footer .= "</tbody></table></div>";
5566
- }
 
 
 
 
 
 
 
 
 
5567
  return $wpgmza_tmp_head.$wpgmza_tmp_body.$wpgmza_tmp_footer;
5568
  }
5569
  }
@@ -5941,6 +6040,9 @@ function wpgmaps_trash_map($map_id) {
5941
  global $wpdb;
5942
  global $wpgmza_tblname_maps;
5943
  if (isset($map_id)) {
 
 
 
5944
  $rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $wpgmza_tblname_maps SET active = %d WHERE id = %d", 1, $map_id) );
5945
  return true;
5946
  } else {
3
  Plugin Name: WP Google Maps
4
  Plugin URI: https://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
+ Version: 6.4.04
7
  Author: WP Google Maps
8
  Author URI: https://www.wpgmaps.com
9
  Text Domain: wp-google-maps
11
  */
12
 
13
  /*
14
+ *
15
+ * 6.4.04 - 2017-06-08 - Low priority
16
+ * Tested on WordPress 4.8
17
+ *
18
  * 6.4.03 - 2017-02-17 - Low priority
19
  * Added the ability for affiliates to make use of their affiliate IDs in the pro links
20
  * Added better SSL support
321
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
322
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
323
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
324
+ $wpgmza_version = "6.4.04";
325
+ $wpgmza_p_version = "6.13";
326
  $wpgmza_t = "basic";
327
  define("WPGMAPS", $wpgmza_version);
328
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
2297
 
2298
 
2299
  extract( shortcode_atts( array(
2300
+ 'id' => '1',
2301
+ 'width' => 'inherit',
2302
+ 'height' => 'inherit'
2303
  ), $atts ) );
2304
 
 
2305
  $ret_msg = "";
2306
  $wpgmza_current_map_id = $atts['id'];
2307
 
2360
  if ($map_width_type == "%" && intval($res->map_width) > 100) { $res->map_width = 100; }
2361
  if ($map_height_type == "%" && intval($res->map_height) > 100) { $res->map_height = 100; }
2362
 
2363
+ $map_attributes = '';
2364
+
2365
+ if(isset($atts['width']) && $atts['width'] != 'inherit')
2366
+ $map_attributes .= "data-shortcode-width='{$atts["width"]}' ";
2367
+ if(isset($atts['height']) && $atts['height'] != 'inherit')
2368
+ $map_attributes .= "data-shortcode-height='{$atts["height"]}' ";
2369
+
2370
  if (!$map_align || $map_align == "" || $map_align == "1") { $map_align = "float:left;"; }
2371
  else if ($map_align == "2") { $map_align = "margin-left:auto !important; margin-right:auto; !important; align:center;"; }
2372
  else if ($map_align == "3") { $map_align = "float:right;"; }
2379
  $sl_data = wpgmaps_sl_user_output_basic($wpgmza_current_map_id);
2380
  } else { $sl_data = ""; }
2381
 
 
2382
  $ret_msg .= "
2383
  $sl_data
2384
+ ".apply_filters("wpgooglemaps_filter_map_div_output","<div id=\"wpgmza_map\" $map_attributes $map_style>",$wpgmza_current_map_id)."
2385
 
2386
  </div>
2387
  ";
2594
 
2595
  if (isset($map_other_settings['store_locator_query_string'])) { $sl_query_string = stripslashes($map_other_settings['store_locator_query_string']); } else { $sl_query_string = __("ZIP / Address:","wp-google-maps"); }
2596
  if (isset($map_other_settings['store_locator_default_address'])) { $sl_default_address = stripslashes($map_other_settings['store_locator_default_address']); } else { $sl_default_address = ''; }
2597
+ if (isset($map_other_settings['store_locator_default_radius'])) { $sl_default_radius = stripslashes($map_other_settings['store_locator_default_radius']); } else { $sl_default_radius = '10'; }
2598
+ if (isset($map_other_settings['store_locator_not_found_message'])) { $sl_not_found_message = stripslashes($map_other_settings['store_locator_not_found_message']); } else { $sl_not_found_message = __( "No results found in this location. Please try again.", "wp-google-maps" ); }
2599
+
2600
+ if ($map_width_type == "px" && $map_width < 300) { $map_width = "300"; }
2601
 
2602
  $ret_msg = "";
2603
 
2604
  $ret_msg .= "<div class=\"wpgmza_sl_main_div\">";
2605
+ $ret_msg .= " <div class=\"wpgmza_sl_query_div wpgmza-clearfix\">";
2606
  $ret_msg .= " <div class=\"wpgmza_sl_query_innerdiv1\"><label for='addressInput'>".esc_attr($sl_query_string)."</label></div>";
2607
  $ret_msg .= " <div class=\"wpgmza_sl_query_innerdiv2\"><input type=\"text\" id=\"addressInput\" size=\"20\" value=\"".$sl_default_address."\" /></div>";
2608
  $ret_msg .= " </div>";
2609
 
2610
+ $ret_msg .= " <div class=\"wpgmza_sl_radius_div wpgmza-clearfix\">";
2611
  $ret_msg .= " <div class=\"wpgmza_sl_radius_innerdiv1\"><label for='radiusSelect'>".__("Radius","wp-google-maps").":</label></div>";
2612
  $ret_msg .= " <div class=\"wpgmza_sl_radius_innerdiv2\">";
2613
  $ret_msg .= " <select class=\"wpgmza_sl_radius_select\" id=\"radiusSelect\">";
2615
 
2616
  $map_other_settings['store_locator_distance'] = isset($map_other_settings['store_locator_distance']) ? intval($map_other_settings['store_locator_distance']) : 2;
2617
  if (isset($map_other_settings['store_locator_distance']) && $map_other_settings['store_locator_distance'] === 1) {
2618
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"1\"" . selected( '1', $sl_default_radius, false ) . ">".__("1mi","wp-google-maps")."</option>";
2619
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"5\"" . selected( '5', $sl_default_radius, false ) . ">".__("5mi","wp-google-maps")."</option>";
2620
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"10\"" . selected( '10', $sl_default_radius, false ) . ">".__("10mi","wp-google-maps")."</option>";
2621
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"25\"" . selected( '25', $sl_default_radius, false ) . ">".__("25mi","wp-google-maps")."</option>";
2622
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"50\"" . selected( '50', $sl_default_radius, false ) . ">".__("50mi","wp-google-maps")."</option>";
2623
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"75\"" . selected( '75', $sl_default_radius, false ) . ">".__("75mi","wp-google-maps")."</option>";
2624
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"100\"" . selected( '100', $sl_default_radius, false ) . ">".__("100mi","wp-google-maps")."</option>";
2625
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"150\"" . selected( '150', $sl_default_radius, false ) . ">".__("150mi","wp-google-maps")."</option>";
2626
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"200\"" . selected( '200', $sl_default_radius, false ) . ">".__("200mi","wp-google-maps")."</option>";
2627
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"300\"" . selected( '300', $sl_default_radius, false ) . ">".__("300mi","wp-google-maps")."</option>";
2628
  } else {
2629
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"1\"" . selected( '1', $sl_default_radius, false ) . ">".__("1km","wp-google-maps")."</option>";
2630
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"5\"" . selected( '5', $sl_default_radius, false ) . ">".__("5km","wp-google-maps")."</option>";
2631
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"10\"" . selected( '10', $sl_default_radius, false ) . ">".__("10km","wp-google-maps")."</option>";
2632
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"25\"" . selected( '25', $sl_default_radius, false ) . ">".__("25km","wp-google-maps")."</option>";
2633
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"50\"" . selected( '50', $sl_default_radius, false ) . ">".__("50km","wp-google-maps")."</option>";
2634
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"75\"" . selected( '75', $sl_default_radius, false ) . ">".__("75km","wp-google-maps")."</option>";
2635
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"100\"" . selected( '100', $sl_default_radius, false ) . ">".__("100km","wp-google-maps")."</option>";
2636
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"150\"" . selected( '150', $sl_default_radius, false ) . ">".__("150km","wp-google-maps")."</option>";
2637
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"200\"" . selected( '200', $sl_default_radius, false ) . ">".__("200km","wp-google-maps")."</option>";
2638
+ $ret_msg .= " <option class=\"wpgmza_sl_select_option\" value=\"300\"" . selected( '300', $sl_default_radius, false ) . ">".__("300km","wp-google-maps")."</option>";
2639
  }
2640
 
2641
  $ret_msg .= " </select><input type='hidden' value='".$map_other_settings['store_locator_distance']."' name='wpgmza_distance_type' id='wpgmza_distance_type' style='display:none;' />";
2651
  $ret_msg .= " </div>";
2652
  }
2653
 
2654
+
2655
+ $ret_msg .= " <input class=\"wpgmza_sl_search_button\" type=\"button\" onclick=\"searchLocations($map_id)\" value=\"".__("Search","wp-google-maps")."\"/>";
2656
+ $ret_msg .= " <div class='wpgmza-not-found-msg js-not-found-msg'><p>" . $sl_not_found_message . "</p></div>";
2657
+ $ret_msg .= " </div>";
2658
  $ret_msg .= " <div><select id=\"locationSelect\" style=\"width:100%;visibility:hidden\"></select></div>";
2659
 
2660
  return $ret_msg;
2728
 
2729
  $other_settings['store_locator_enabled'] = isset($_POST['wpgmza_store_locator']) ? 1 : 2;
2730
  $other_settings['store_locator_distance'] = isset($_POST['wpgmza_store_locator_distance']) ? 1 : 2;
2731
+ $other_settings['store_locator_default_radius'] = isset($_POST['wpgmza_store_locator_default_radius']) ? esc_attr( $_POST['wpgmza_store_locator_default_radius'] ): '10';
2732
+ if (isset($_POST['wpgmza_store_locator_not_found_message'])) { $other_settings['store_locator_not_found_message'] = sanitize_text_field( $_POST['wpgmza_store_locator_not_found_message'] ); }
2733
  $other_settings['store_locator_bounce'] = isset($_POST['wpgmza_store_locator_bounce']) ? 1 : 2;
2734
 
2735
  $other_settings['store_locator_query_string'] = sanitize_text_field($_POST['wpgmza_store_locator_query_string']);
2759
  /* overwrite theme data if a custom theme is selected */
2760
  if (isset($_POST['wpgmza_styling_json'])) { $other_settings['wpgmza_theme_data'] = sanitize_text_field($_POST['wpgmza_styling_json']); }
2761
 
2762
+ $other_settings['wpgmza_show_points_of_interest'] = (isset($_POST['wpgmza_show_points_of_interest']) ? 1 : 0);
2763
 
2764
  $other_settings_data = maybe_serialize($other_settings);
2765
 
3069
  if (isset($_POST['wpgmza_settings_map_draggable'])) { $wpgmza_data['wpgmza_settings_map_draggable'] = sanitize_text_field($_POST['wpgmza_settings_map_draggable']); }
3070
  if (isset($_POST['wpgmza_settings_map_clickzoom'])) { $wpgmza_data['wpgmza_settings_map_clickzoom'] = sanitize_text_field($_POST['wpgmza_settings_map_clickzoom']); }
3071
  if (isset($_POST['wpgmza_settings_map_open_marker_by'])) { $wpgmza_data['wpgmza_settings_map_open_marker_by'] = sanitize_text_field($_POST['wpgmza_settings_map_open_marker_by']); }
3072
+ if (isset($_POST['wpgmza_settings_disable_infowindows'])) { $wpgmza_data['wpgmza_settings_disable_infowindows'] = sanitize_text_field($_POST['wpgmza_settings_disable_infowindows']); }
3073
  if (isset($_POST['wpgmza_api_version'])) { $wpgmza_data['wpgmza_api_version'] = sanitize_text_field($_POST['wpgmza_api_version']); }
3074
  if (isset($_POST['wpgmza_custom_css'])) { $wpgmza_data['wpgmza_custom_css'] = sanitize_text_field($_POST['wpgmza_custom_css']); }
3075
  if (isset($_POST['wpgmza_marker_xml_location'])) { update_option("wpgmza_xml_location",sanitize_text_field($_POST['wpgmza_marker_xml_location'])); }
3730
  else if ($wpgmza_settings_map_open_marker_by == '2') { $wpgmza_settings_map_open_marker_by_checked[1] = "checked='checked'"; }
3731
  else { $wpgmza_settings_map_open_marker_by_checked[0] = "checked='checked'"; }
3732
 
3733
+ $wpgmza_settings_disable_infowindows = '';
3734
+ if(isset($wpgmza_settings['wpgmza_settings_disable_infowindows']) && $wpgmza_settings['wpgmza_settings_disable_infowindows'] == 1)
3735
+ $wpgmza_settings_disable_infowindows = ' checked="checked"';
3736
 
3737
  $show_advanced_marker_tr = 'style="visibility:hidden; display:none;"';
3738
  $wpgmza_settings_marker_pull_checked[0] = "";
3921
  $ret .= " <td valign='top' width='200' style='vertical-align:top;'>".__("Open Marker InfoWindows by","wp-google-maps")." </td>";
3922
  $ret .= " <td><input name='wpgmza_settings_map_open_marker_by' type='radio' id='wpgmza_settings_map_open_marker_by' value='1' ".$wpgmza_settings_map_open_marker_by_checked[0]." />Click<br /><input name='wpgmza_settings_map_open_marker_by' type='radio' id='wpgmza_settings_map_open_marker_by' value='2' ".$wpgmza_settings_map_open_marker_by_checked[1]." />Hover </td>";
3923
  $ret .= " </tr>";
3924
+
3925
+ $ret .= " <tr>";
3926
+ $ret .= " <td valign='top' width='200' style='vertical-align:top;'>".__("Disable InfoWindows","wp-google-maps")." </td>";
3927
+ $ret .= " <td>";
3928
+ $ret .= " <input name='wpgmza_settings_disable_infowindows' type='checkbox' value='1' {$wpgmza_settings_disable_infowindows}/>";
3929
+ $ret .= " </td>";
3930
+ $ret .= " </tr>";
3931
 
3932
  $ret .= " </table>";
3933
  $ret .= " </div>";
3934
+
3935
  $ret .= " <div id=\"tabs-3\">";
3936
 
3937
  $ret .= " <table class='form-table'>";
4300
  $other_settings_data = maybe_unserialize($res->other_settings);
4301
  if (isset($other_settings_data['store_locator_enabled'])) { $wpgmza_store_locator_enabled = $other_settings_data['store_locator_enabled']; } else { $wpgmza_store_locator_enabled = 0; }
4302
  if (isset($other_settings_data['store_locator_distance'])) { $wpgmza_store_locator_distance = $other_settings_data['store_locator_distance']; } else { $wpgmza_store_locator_distance = 0; }
4303
+ if (isset($other_settings_data['store_locator_default_radius'])) { $wpgmza_store_locator_default_radius = $other_settings_data['store_locator_default_radius']; } else { $wpgmza_store_locator_default_radius = "10"; }
4304
  if (isset($other_settings_data['store_locator_bounce'])) { $wpgmza_store_locator_bounce = $other_settings_data['store_locator_bounce']; } else { $wpgmza_store_locator_bounce = 1; }
4305
  if (isset($other_settings_data['store_locator_query_string'])) { $wpgmza_store_locator_query_string = stripslashes($other_settings_data['store_locator_query_string']); } else { $wpgmza_store_locator_query_string = __("ZIP / Address:","wp-google-maps"); }
4306
  if (isset($other_settings_data['store_locator_default_address'])) { $wpgmza_store_locator_default_address = stripslashes($other_settings_data['store_locator_default_address']); } else { $wpgmza_store_locator_default_address = ""; }
4307
+ if (isset($other_settings_data['store_locator_not_found_message'])) { $wpgmza_store_locator_not_found_message = stripslashes($other_settings_data['store_locator_not_found_message']); } else { $wpgmza_store_locator_not_found_message = __( "No results found in this location. Please try again.", "wp-google-maps" ); }
4308
  if (isset($other_settings_data['wpgmza_store_locator_restrict'])) { $wpgmza_store_locator_restrict = $other_settings_data['wpgmza_store_locator_restrict']; } else { $wpgmza_store_locator_restrict = ""; }
4309
 
4310
  /* deprecated in 6.2.0
4436
  $wpgmza_theme_data_custom = '';
4437
  }
4438
  }
 
4439
 
4440
+
4441
+ google_maps_api_key_warning();
4442
  echo "
4443
 
4444
  <div class='wrap'>
4688
  </div>
4689
  </td>
4690
  </tr>
4691
+ <tr>
4692
+ <td>".__("Default radius","wp-google-maps").":</td>
4693
+ <td>
4694
+ <div>
4695
+ <select class='wpgmza-store-locator-default-radius";
4696
+ echo ( 1 === $wpgmza_store_locator_distance ) ? ' active' : '';
4697
+ echo "' id='wpgmza_store_locator_default_radius_mi' name='wpgmza_store_locator_default_radius'>
4698
+ <option value=\"1\"" . selected( '1', $wpgmza_store_locator_default_radius, false ) . ">" . __( "1mi", "wp-google-maps" ) . "</option>
4699
+ <option value=\"5\"" . selected( '5', $wpgmza_store_locator_default_radius, false ) . ">" . __( "5mi", "wp-google-maps" ) . "</option>
4700
+ <option value=\"10\"" . selected( '10', $wpgmza_store_locator_default_radius, false ) . ">" . __( "10mi", "wp-google-maps" ) . "</option>
4701
+ <option value=\"25\"" . selected( '25', $wpgmza_store_locator_default_radius, false ) . ">" . __( "25mi", "wp-google-maps" ) . "</option>
4702
+ <option value=\"50\"" . selected( '50', $wpgmza_store_locator_default_radius, false ) . ">" . __( "50mi", "wp-google-maps" ) . "</option>
4703
+ <option value=\"75\"" . selected( '75', $wpgmza_store_locator_default_radius, false ) . ">" . __( "75mi", "wp-google-maps" ) . "</option>
4704
+ <option value=\"100\"" . selected( '100', $wpgmza_store_locator_default_radius, false ) . ">" . __( "100mi", "wp-google-maps" ) . "</option>
4705
+ <option value=\"150\"" . selected( '150', $wpgmza_store_locator_default_radius, false ) . ">" . __( "150mi", "wp-google-maps" ) . "</option>
4706
+ <option value=\"200\"" . selected( '200', $wpgmza_store_locator_default_radius, false ) . ">" . __( "200mi", "wp-google-maps" ) . "</option>
4707
+ <option value=\"300\"" . selected( '300', $wpgmza_store_locator_default_radius, false ) . ">" . __( "300mi", "wp-google-maps" ) . "</option>
4708
+ </select>
4709
+ <select class='wpgmza-store-locator-default-radius";
4710
+ echo ( 1 !== $wpgmza_store_locator_distance ) ? ' active' : '';
4711
+ echo "' id='wpgmza_store_locator_default_radius_km' name='wpgmza_store_locator_default_radius'>
4712
+ <option value=\"1\"" . selected( '1', $wpgmza_store_locator_default_radius, false ) . ">" . __( "1km", "wp-google-maps" ) . "</option>
4713
+ <option value=\"5\"" . selected( '5', $wpgmza_store_locator_default_radius, false ) . ">" . __( "5km", "wp-google-maps" ) . "</option>
4714
+ <option value=\"10\"" . selected( '10', $wpgmza_store_locator_default_radius, false ) . ">" . __( "10km", "wp-google-maps" ) . "</option>
4715
+ <option value=\"25\"" . selected( '25', $wpgmza_store_locator_default_radius, false ) . ">" . __( "25km", "wp-google-maps" ) . "</option>
4716
+ <option value=\"50\"" . selected( '50', $wpgmza_store_locator_default_radius, false ) . ">" . __( "50km", "wp-google-maps" ) . "</option>
4717
+ <option value=\"75\"" . selected( '75', $wpgmza_store_locator_default_radius, false ) . ">" . __( "75km", "wp-google-maps" ) . "</option>
4718
+ <option value=\"100\"" . selected( '100', $wpgmza_store_locator_default_radius, false ) . ">" . __( "100km", "wp-google-maps" ) . "</option>
4719
+ <option value=\"150\"" . selected( '150', $wpgmza_store_locator_default_radius, false ) . ">" . __( "150km", "wp-google-maps" ) . "</option>
4720
+ <option value=\"200\"" . selected( '200', $wpgmza_store_locator_default_radius, false ) . ">" . __( "200km", "wp-google-maps" ) . "</option>
4721
+ <option value=\"300\"" . selected( '300', $wpgmza_store_locator_default_radius, false ) . ">" . __( "300km", "wp-google-maps" ) . "</option>
4722
+ </select>
4723
+ </div>
4724
+ </td>
4725
+ </tr>
4726
  <tr>
4727
  <td>".__("Query string","wp-google-maps").":</td>
4728
  <td><input type=\"text\" name=\"wpgmza_store_locator_query_string\" id=\"wpgmza_store_locator_query_string\" value=\"".esc_attr($wpgmza_store_locator_query_string)."\">
4733
  <td><input type=\"text\" name=\"wpgmza_store_locator_default_address\" id=\"wpgmza_store_locator_default_address\" value=\"".esc_attr($wpgmza_store_locator_default_address)."\">
4734
  </td>
4735
  </tr>
4736
+ <tr>
4737
+ <td>" . __( "Not found message" ,"wp-google-maps" ) . ":</td>
4738
+ <td><input type=\"text\" name=\"wpgmza_store_locator_not_found_message\" id=\"wpgmza_store_locator_not_found_message\" value=\"".esc_attr($wpgmza_store_locator_not_found_message)."\">
4739
+ </td>
4740
+ </tr>
4741
  <tr>
4742
  <td width='200'>".__("Show bouncing icon","wp-google-maps").":</td>
4743
  <td>
4842
 
4843
  </td>
4844
  </tr>
4845
+ <tr>
4846
+ <td><label for=\"wpgmza_show_points_of_interest\">".__("Show Points of Interest?", "wp-google-maps")."</label></td>
4847
+ <td>
4848
+ <input type='checkbox' id='wpgmza_show_points_of_interest' name='wpgmza_show_points_of_interest' " .
4849
+ (
4850
+ !isset($other_settings_data['wpgmza_show_points_of_interest']) ||
4851
+ $other_settings_data['wpgmza_show_points_of_interest'] == 1
4852
+ ?
4853
+ "checked='checked'"
4854
+ :
4855
+ ''
4856
+ )
4857
+ . "/>
4858
+ </td>
4859
+ </tr>
4860
+
4861
  <tr>
 
4862
  </tr>
4863
  <tr>
4864
  <td></td>
5583
  if ($admin) {
5584
 
5585
  $wpgmza_tmp_body .= "<tr id=\"wpgmza_tr_".$result->id."\" class=\"gradeU\">";
5586
+
5587
+ $wpgmza_tmp_body .= '<td><input type="checkbox" name="mark"/></td>';
5588
+
5589
  $wpgmza_tmp_body .= "<td height=\"40\">".$result->id."</td>";
5590
  $wpgmza_tmp_body .= "<td height=\"40\">".$icon."<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_".$result->id."\" value=\"".$result->icon."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_".$result->id."\" value=\"".$result->anim."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_category_".$result->id."\" value=\"".$result->category."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_".$result->id."\" value=\"".$result->infoopen."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_approved_".$result->id."\" value=\"".$result->approved."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_retina_".$result->id."\" value=\"".$result->retina."\" /></td>";
5591
  $wpgmza_tmp_body .= "<td>".stripslashes($result->title)."<input type=\"hidden\" id=\"wpgmza_hid_marker_title_".$result->id."\" value=\"".stripslashes($result->title)."\" /></td>";
5619
  $wpgmza_tmp_head .= "<table id=\"wpgmza_table\" class=\"display\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">";
5620
  $wpgmza_tmp_head .= "<thead>";
5621
  $wpgmza_tmp_head .= "<tr>";
5622
+ $wpgmza_tmp_head .= " <td><strong>".__("Mark","wp-google-maps")."</strong></td>";
5623
  $wpgmza_tmp_head .= " <th><strong>".__("ID","wp-google-maps")."</strong></th>";
5624
  $wpgmza_tmp_head .= " <th><strong>".__("Icon","wp-google-maps")."</strong></th>";
5625
  $wpgmza_tmp_head .= " <th><strong>".apply_filters("wpgmza_filter_title_name",__("Title","wp-google-maps"))."</strong></th>";
5649
  $wpgmza_tmp_head .= "</thead>";
5650
  $wpgmza_tmp_head .= "<tbody>";
5651
  }
5652
+
5653
+ $wpgmza_tmp_footer .= "</tbody></table>";
5654
+
5655
+ $wpgmza_tmp_footer .= '
5656
+ <div>
5657
+ &#x21b3;
5658
+ <button class="wpgmza button select_all_markers" type="button">Select All</button>
5659
+ <button class="wpgmza button bulk_delete" type="button">Bulk Delete</button>
5660
+ </div>
5661
+ ';
5662
+
5663
+ if(!$admin)
5664
+ $wpgmza_tmp_footer .= '</div>';
5665
+
5666
  return $wpgmza_tmp_head.$wpgmza_tmp_body.$wpgmza_tmp_footer;
5667
  }
5668
  }
6040
  global $wpdb;
6041
  global $wpgmza_tblname_maps;
6042
  if (isset($map_id)) {
6043
+ $wpdb->query(
6044
+ $wpdb->prepare('DELETE FROM wp_wpgmza WHERE map_id=%d', $map_id)
6045
+ );
6046
  $rows_affected = $wpdb->query( $wpdb->prepare( "UPDATE $wpgmza_tblname_maps SET active = %d WHERE id = %d", 1, $map_id) );
6047
  return true;
6048
  } else {