WD Google Maps – Google Maps builder Plugin - Version 1.0.5

Version Description

Changed: Markers saving method

Download this release

Release Info

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

Code changes from version 1.0.3 to 1.0.5

admin/controllers/GMWDControllerMaps_gmwd.php CHANGED
@@ -164,7 +164,12 @@ class GMWDControllerMaps_gmwd extends GMWDController{
164
  if($this->shortcode_id){
165
  $this->store_shortcode();
166
  }
167
- $data_markers = json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("markers"))));
 
 
 
 
 
168
  $data_polygons = json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("polygons"))));
169
  $data_polylines = json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("polylines"))));
170
 
164
  if($this->shortcode_id){
165
  $this->store_shortcode();
166
  }
167
+ $markers_count = GMWDHelper::get("markers_count");
168
+
169
+ $data_markers = array();
170
+ for($i=0; $i<$markers_count; $i++){
171
+ $data_markers = array_merge($data_markers,json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("main_markers".$i)))));
172
+ }
173
  $data_polygons = json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("polygons"))));
174
  $data_polylines = json_decode(htmlspecialchars_decode(stripslashes(GMWDHelper::get("polylines"))));
175
 
admin/views/GMWDViewMaps_gmwd.php CHANGED
@@ -337,12 +337,20 @@ class GMWDViewMaps_gmwd extends GMWDView{
337
  <input id="task" name="task" type="hidden" value="" />
338
  <input id="id" name="id" type="hidden" value="<?php echo $row->id;?>" />
339
  <input id="id" name="shortcode_id" type="hidden" value="<?php echo $row->shortcode_id;?>" />
340
- <input id="markers" name="markers" type="hidden" value='<?php echo json_encode($row->markers);?>' />
 
 
 
 
 
 
 
341
  <input id="polygons" name="polygons" type="hidden" value='<?php echo json_encode($row->polygons);?>' />
342
  <input id="polylines" name="polylines" type="hidden" value='<?php echo json_encode($row->polylines);?>' />
343
  <input id="active_settings_tab" name="active_settings_tab" type="hidden" value="<?php echo GMWDHelper::get('active_settings_tab');?>" />
344
  <input id="active_main_tab" name="active_main_tab" type="hidden" value="<?php echo GMWDHelper::get('active_main_tab');?>" />
345
- <input id="active_poi_tab" name="active_poi_tab" type="hidden" value="<?php echo GMWDHelper::get('active_poi_tab');?>" />
 
346
  </form>
347
  </div>
348
  <script>
337
  <input id="task" name="task" type="hidden" value="" />
338
  <input id="id" name="id" type="hidden" value="<?php echo $row->id;?>" />
339
  <input id="id" name="shortcode_id" type="hidden" value="<?php echo $row->shortcode_id;?>" />
340
+ <?php
341
+ $number_of_markers = count($row->markers);
342
+ $number_of_arrays = ceil($number_of_markers/300);
343
+ $marker_arrays = $number_of_arrays >1 ? array_chunk($row->markers,$number_of_arrays) : array($row->markers);
344
+ for($i=0; $i<count($marker_arrays);$i++){
345
+ echo "<input id='main_markers".$i."' name='main_markers".$i."' type='hidden' value='". json_encode($marker_arrays[$i])."' />";
346
+ }
347
+ ?>
348
  <input id="polygons" name="polygons" type="hidden" value='<?php echo json_encode($row->polygons);?>' />
349
  <input id="polylines" name="polylines" type="hidden" value='<?php echo json_encode($row->polylines);?>' />
350
  <input id="active_settings_tab" name="active_settings_tab" type="hidden" value="<?php echo GMWDHelper::get('active_settings_tab');?>" />
351
  <input id="active_main_tab" name="active_main_tab" type="hidden" value="<?php echo GMWDHelper::get('active_main_tab');?>" />
352
+ <input id="active_poi_tab" name="active_poi_tab" type="hidden" value="<?php echo GMWDHelper::get('active_poi_tab');?>" />
353
+ <input id="markers_count" name="markers_count" type="hidden" value="<?php echo $number_of_arrays;?>" />
354
  </form>
355
  </div>
356
  <script>
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.3';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
11
  // Variables //
12
  ////////////////////////////////////////////////////////////////////////////////////////
13
  protected static $instance = null;
14
+ private static $version = '1.0.5';
15
  ////////////////////////////////////////////////////////////////////////////////////////
16
  // Constructor & Destructor //
17
  ////////////////////////////////////////////////////////////////////////////////////////
js/maps_gmwd.js CHANGED
@@ -727,7 +727,14 @@ function fillInputPois(){
727
  var marker = jQuery(this).find("[name^=markers_]").val();
728
  markers.push(JSON.parse(marker));
729
  });
730
-
 
 
 
 
 
 
 
731
 
732
  jQuery(".gmwd_polygons .wd-pois-row:not(.wd-template)").each(function(){
733
  var polygon = jQuery(this).find("[name^=polygons_]").val();
@@ -738,9 +745,15 @@ function fillInputPois(){
738
  var polyline = jQuery(this).find("[name^=polylines_]").val();
739
  polylines.push(JSON.parse(polyline));
740
  });
741
-
 
 
 
 
 
 
 
742
 
743
- jQuery("[name=markers]").val(JSON.stringify(markers));
744
  jQuery("[name=polygons]").val(JSON.stringify(polygons));
745
  jQuery("[name=polylines]").val(JSON.stringify(polylines));
746
 
727
  var marker = jQuery(this).find("[name^=markers_]").val();
728
  markers.push(JSON.parse(marker));
729
  });
730
+ var chunk = Math.ceil(Number(markers.length)/300);
731
+ var i,j,temparray;
732
+ var _markers = [];
733
+
734
+ for (i=0, j=markers.length; i<j; i += 300) {
735
+ temparray = markers.slice(i,i+300);
736
+ _markers.push(temparray);
737
+ }
738
 
739
  jQuery(".gmwd_polygons .wd-pois-row:not(.wd-template)").each(function(){
740
  var polygon = jQuery(this).find("[name^=polygons_]").val();
745
  var polyline = jQuery(this).find("[name^=polylines_]").val();
746
  polylines.push(JSON.parse(polyline));
747
  });
748
+ jQuery("[name^=main_markers]").remove();
749
+
750
+ for(var i=0; i<_markers.length; i++){
751
+ jQuery("#adminForm").append('<input id="main_markers' + i + '" name="main_markers' + i + '" type="hidden" />');
752
+ jQuery("[name=main_markers" + i + "]").val(JSON.stringify(_markers[i]));
753
+ }
754
+
755
+ jQuery("#markers_count").val(chunk);
756
 
 
757
  jQuery("[name=polygons]").val(JSON.stringify(polygons));
758
  jQuery("[name=polylines]").val(JSON.stringify(polylines));
759
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://web-dorado.com/products/wordpress-google-maps-plugin.html
4
  Tags: address, cross-browser, custom google map, custom google maps, easy map, geo, geocoder, gmaps, google, google earth, google map, google map plugin, google map widget, google maps, google maps plugin, googlemaps, gps, gpx, kml, latitude, location, longitude, map, map markers, map plugin, map styles, map widget, maps, marker, openstreetmap, path, pin, place, polygons, polylines, post map, routes, store locator, streetview, widget map, wp google map, wp google maps, wp map, wp maps, directions, widget, layers, circles, responsive
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
- Stable tag: 1.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -108,6 +108,9 @@ After downloading the ZIP file of the Google Maps WD plugin,
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 1.0.3 =
112
  * Added: Text Editor for marker description
113
 
4
  Tags: address, cross-browser, custom google map, custom google maps, easy map, geo, geocoder, gmaps, google, google earth, google map, google map plugin, google map widget, google maps, google maps plugin, googlemaps, gps, gpx, kml, latitude, location, longitude, map, map markers, map plugin, map styles, map widget, maps, marker, openstreetmap, path, pin, place, polygons, polylines, post map, routes, store locator, streetview, widget map, wp google map, wp google maps, wp map, wp maps, directions, widget, layers, circles, responsive
5
  Requires at least: 3.4
6
  Tested up to: 4.5
7
+ Stable tag: 1.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
108
 
109
  == Changelog ==
110
 
111
+ = 1.0.5 =
112
+ Changed: Markers saving method
113
+
114
  = 1.0.3 =
115
  * Added: Text Editor for marker description
116
 
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.3
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.5
8
  * Author: WebDorado
9
  * Author URI: http://web-dorado.com/
10
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html