WD Google Maps – Google Maps builder Plugin - Version 1.0.18

Version Description

  • Added: Option to enable Search box for google maps
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 WD Google Maps – Google Maps builder Plugin
Version 1.0.18
Comparing to
See all releases

Code changes from version 1.0.17 to 1.0.18

admin/views/GMWDViewMaps_gmwd.php CHANGED
@@ -1290,7 +1290,28 @@ class GMWDViewMaps_gmwd extends GMWDView{
1290
  <div class="gmwd_pro_option"><small><?php _e("Only in the Paid version.","gmwd");?></small></div>
1291
  </td>
1292
  </tr>
1293
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1294
 
1295
  </table>
1296
  <?php
1290
  <div class="gmwd_pro_option"><small><?php _e("Only in the Paid version.","gmwd");?></small></div>
1291
  </td>
1292
  </tr>
1293
+ <tr>
1294
+ <td><label title="<?php _e("Disable/enable searchbox on map.","gmwd");?>"><?php _e("Enable Searchbox","gmwd"); ?>:</label></td>
1295
+ <td>
1296
+ <input type="radio" class="inputbox" id="enable_searchbox0" name="enable_searchbox" <?php echo (($row->enable_searchbox) ? '' : 'checked="checked"'); ?> value="0" >
1297
+ <label for="enable_searchbox0"><?php _e("No","gmwd"); ?></label>
1298
+ <input type="radio" class="inputbox" id="enable_searchbox1" name="enable_searchbox" <?php echo (($row->enable_searchbox) ? 'checked="checked"' : ''); ?> value="1" >
1299
+ <label for="enable_searchbox1"><?php _e("Yes","gmwd"); ?></label>
1300
+ </td>
1301
+ </tr>
1302
+ <tr>
1303
+ <td><label for="searchbox_position" title="<?php _e("Select the position of the searchbox.","gmwd");?>"><?php _e("Serachbox Position","gmwd"); ?>:</label></td>
1304
+ <td>
1305
+ <select name="searchbox_position" id="searchbox_position">
1306
+ <?php
1307
+ foreach($lists["map_positions"] as $key => $value){
1308
+ $selected = $row->searchbox_position == $key ? "selected" : "";
1309
+ echo '<option value="'.$key.'" '.$selected.'>'.$value.'</option>';
1310
+ }
1311
+ ?>
1312
+ </select>
1313
+ </td>
1314
+ </tr>
1315
 
1316
  </table>
1317
  <?php
frontend/views/GMWDViewFrontendMap.php CHANGED
@@ -102,7 +102,10 @@ class GMWDViewFrontendMap extends GMWDViewFrontend{
102
  gmwdmapData["advancedInfoWindowPosition" + '<?php echo $shortcode_id;?>'] = Number("<?php echo $row->advanced_info_window_position ? $row->advanced_info_window_position : 10 ;?>");
103
  gmwdmapData["geolocateUser" + '<?php echo $shortcode_id;?>'] = Number("<?php echo $row->geolocate_user;?>");
104
  gmwdmapData["items" + '<?php echo $shortcode_id;?>'] = "<?php echo $theme->carousel_items_count;?>";
105
-
 
 
 
106
  gmwdmapData["allMarkers" + '<?php echo $shortcode_id;?>'] = [];
107
  gmwdmapData["allPolygons" + '<?php echo $shortcode_id;?>'] = [];
108
  gmwdmapData["allPolygonMarkers" + '<?php echo $shortcode_id;?>'] = [];
102
  gmwdmapData["advancedInfoWindowPosition" + '<?php echo $shortcode_id;?>'] = Number("<?php echo $row->advanced_info_window_position ? $row->advanced_info_window_position : 10 ;?>");
103
  gmwdmapData["geolocateUser" + '<?php echo $shortcode_id;?>'] = Number("<?php echo $row->geolocate_user;?>");
104
  gmwdmapData["items" + '<?php echo $shortcode_id;?>'] = "<?php echo $theme->carousel_items_count;?>";
105
+
106
+ gmwdmapData["enableSerchBox" + '<?php echo $shortcode_id;?>'] = "<?php echo $row->enable_searchbox;?>";
107
+ gmwdmapData["serchBoxPosition" + '<?php echo $shortcode_id;?>'] = Number("<?php echo $row->searchbox_position ? $row->searchbox_position : 3 ;?>");
108
+
109
  gmwdmapData["allMarkers" + '<?php echo $shortcode_id;?>'] = [];
110
  gmwdmapData["allPolygons" + '<?php echo $shortcode_id;?>'] = [];
111
  gmwdmapData["allPolygonMarkers" + '<?php echo $shortcode_id;?>'] = [];
gmwd_admin_class.php CHANGED
@@ -11,7 +11,7 @@ class GMWDAdmin{
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
- private static $version = '1.0.17';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.18';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
js/frontend_main.js CHANGED
@@ -16,7 +16,10 @@ var ajaxData = {};
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
 
18
  function gmwdReadyFunction(key){
19
-
 
 
 
20
  // geolocate user
21
  if(gmwdmapData["geolocateUser" + key] == 1){
22
  geoLocateUser(key);
@@ -217,7 +220,36 @@ function getMyLocation(input){
217
 
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
 
 
221
  ////////////////////////////////////////////////////////////////////////////////////////
222
  // Getters & Setters //
223
  ////////////////////////////////////////////////////////////////////////////////////////
16
  ////////////////////////////////////////////////////////////////////////////////////////
17
 
18
  function gmwdReadyFunction(key){
19
+ // serach box
20
+ if(gmwdmapData["enableSerchBox" + key] == 1){
21
+ initSerachBox(key);
22
+ }
23
  // geolocate user
24
  if(gmwdmapData["geolocateUser" + key] == 1){
25
  geoLocateUser(key);
220
 
221
  }
222
 
223
+ function initSerachBox(key){
224
+ var input = document.createElement("input");
225
+ input.id = "gmwd_serach_box" + key;
226
+ input.type = "text";
227
+ input.style.cssText = "width:400px;";
228
+ input.setAttribute("onkeypress", "if(event.keyCode == 13) return false;") ;
229
+ input.setAttribute("class", "gmwd_serach_box") ;
230
+
231
+ searchBox = new google.maps.places.SearchBox(input);
232
+ gmwdmapData["main_map" + key].controls[gmwdmapData["serchBoxPosition" + key]].push(input);
233
+
234
+ gmwdmapData["main_map" + key].addListener('bounds_changed', function() {
235
+ searchBox.setBounds( gmwdmapData["main_map" + key].getBounds());
236
+ });
237
+
238
+ searchBox.addListener('places_changed', function() {
239
+ var places = searchBox.getPlaces();
240
+ var bounds = new google.maps.LatLngBounds();
241
+ places.forEach(function(place) {
242
+ if (place.geometry.viewport) {
243
+ // Only geocodes have viewport.
244
+ bounds.union(place.geometry.viewport);
245
+ } else {
246
+ bounds.extend(place.geometry.location);
247
+ }
248
+ });
249
+ gmwdmapData["main_map" + key].fitBounds(bounds);
250
+ });
251
 
252
+ }
253
  ////////////////////////////////////////////////////////////////////////////////////////
254
  // Getters & Setters //
255
  ////////////////////////////////////////////////////////////////////////////////////////
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
- Stable tag: 1.0.17
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,6 +113,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
113
 
114
  == Changelog ==
115
 
 
 
 
116
  = 1.0.17 =
117
  * Fixed: Conflicts with some plugins
118
 
4
  Tags: directions, google map, google map plugin, google maps, google maps plugin, map, map markers, map plugin, map widget, maps, wp google map, wp google maps
5
  Requires at least: 3.4
6
  Tested up to: 4.6
7
+ Stable tag: 1.0.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
 
114
  == Changelog ==
115
 
116
+ = 1.0.18 =
117
+ * Added: Option to enable Search box for google maps
118
+
119
  = 1.0.17 =
120
  * Fixed: Conflicts with some plugins
121
 
sql/sql.php CHANGED
@@ -70,6 +70,8 @@ function gmwd_create_tables(){
70
  `circle_line_width` INT(16) NOT NULL,
71
  `shortcode_id` INT(16) NOT NULL,
72
  `theme_id` INT(16) NOT NULL,
 
 
73
  `published` TINYINT(1) NOT NULL DEFAULT '1',
74
 
75
  PRIMARY KEY (`id`)
70
  `circle_line_width` INT(16) NOT NULL,
71
  `shortcode_id` INT(16) NOT NULL,
72
  `theme_id` INT(16) NOT NULL,
73
+ `enable_searchbox` TINYINT(1) NOT NULL,
74
+ `searchbox_position` INT(16) NOT NULL,
75
  `published` TINYINT(1) NOT NULL DEFAULT '1',
76
 
77
  PRIMARY KEY (`id`)
update/gmwd_update.php CHANGED
@@ -10,6 +10,12 @@ function gmwd_update($version){
10
  if(!$header_titles){
11
  $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `store_locator_header_title` VARCHAR(256) NOT NULL ");
12
  }
 
 
 
 
 
 
13
  }
14
 
15
 
10
  if(!$header_titles){
11
  $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `store_locator_header_title` VARCHAR(256) NOT NULL ");
12
  }
13
+
14
+ $enable_searchbox = $wpdb->get_row("SHOW COLUMNS FROM ".$wpdb->prefix . "gmwd_maps LIKE 'enable_searchbox'");
15
+ if(!$enable_searchbox){
16
+ $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `enable_searchbox` TINYINT(1) NOT NULL ");
17
+ $wpdb->query("ALTER TABLE ".$wpdb->prefix . "gmwd_maps ADD `searchbox_position` INT(16) NOT NULL ");
18
+ }
19
  }
20
 
21
 
wd-google-maps.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
- * Version: 1.0.17
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
4
  * Plugin Name: Google Maps WD
5
  * Plugin URI: https://web-dorado.com/products/wordpress-google-maps-plugin.html
6
  * Description: Google Maps WD is an intuitive tool for creating Google maps with advanced markers, custom layers and overlays for your website.
7
+ * Version: 1.0.18
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html