Google Maps CP - Version 1.0.37

Version Description

  • Modifies the interaction with the Google APIs to prevent the limits on Google requests, affect our plugin.
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Google Maps CP
Version 1.0.37
Comparing to
See all releases

Code changes from version 1.0.35 to 1.0.37

Files changed (4) hide show
  1. codepeople-post-map.php +1 -1
  2. include/functions.php +7 -0
  3. js/cpm.js +35 -23
  4. readme.txt +9 -1
codepeople-post-map.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Google Maps CP
4
  Text Domain: codepeople-post-map
5
- Version: 1.0.35
6
  Author: CodePeople
7
  Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
8
  Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
2
  /*
3
  Plugin Name: Google Maps CP
4
  Text Domain: codepeople-post-map
5
+ Version: 1.0.37
6
  Author: CodePeople
7
  Author URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
8
  Plugin URI: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
include/functions.php CHANGED
@@ -313,6 +313,10 @@ class CPM {
313
  <?php _e('For any issues with the map, go to our <a href="http://wordpress.dwbooster.com/contact-us" target="_blank">contact page</a> and leave us a message.', 'codepeople-post-map'); ?><br/><br />
314
  <?php _e('If you want test the premium version of CP Google Maps go to the following links:<br/> <a href="https://demos.dwbooster.com/cp-google-maps/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/> <a href="https://demos.dwbooster.com/cp-google-maps/" target="_blank">Public page: Click to access the CP Google Maps</a>', 'codepeople-post-map' ); ?>
315
  </p>
 
 
 
 
316
  <div style="padding:10px; border: 1px solid #DADADA;margin-bottom:20px;text-align:center;">
317
  <h2><?php _e('Video Tutorial', 'codepeople-post-map'); ?></h2>
318
  <style>.videoWrapper {position: relative;padding-bottom: 56.25%;height: 0;} .videoWrapper iframe {position: absolute;top: 0;left: 0;width: 100%;height: 100%;}</style>
@@ -320,6 +324,9 @@ class CPM {
320
  <iframe width="560" height="349" src="https://www.youtube.com/embed/VL067cYfYyM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
321
  </div>
322
  </div>
 
 
 
323
  <table class="form-table">
324
  <?php
325
  if( !$single )
313
  <?php _e('For any issues with the map, go to our <a href="http://wordpress.dwbooster.com/contact-us" target="_blank">contact page</a> and leave us a message.', 'codepeople-post-map'); ?><br/><br />
314
  <?php _e('If you want test the premium version of CP Google Maps go to the following links:<br/> <a href="https://demos.dwbooster.com/cp-google-maps/wp-login.php" target="_blank">Administration area: Click to access the administration area demo</a><br/> <a href="https://demos.dwbooster.com/cp-google-maps/" target="_blank">Public page: Click to access the CP Google Maps</a>', 'codepeople-post-map' ); ?>
315
  </p>
316
+ <?php
317
+ if(!$single)
318
+ {
319
+ ?>
320
  <div style="padding:10px; border: 1px solid #DADADA;margin-bottom:20px;text-align:center;">
321
  <h2><?php _e('Video Tutorial', 'codepeople-post-map'); ?></h2>
322
  <style>.videoWrapper {position: relative;padding-bottom: 56.25%;height: 0;} .videoWrapper iframe {position: absolute;top: 0;left: 0;width: 100%;height: 100%;}</style>
324
  <iframe width="560" height="349" src="https://www.youtube.com/embed/VL067cYfYyM" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
325
  </div>
326
  </div>
327
+ <?php
328
+ }
329
+ ?>
330
  <table class="form-table">
331
  <?php
332
  if( !$single )
js/cpm.js CHANGED
@@ -214,35 +214,47 @@ function CodePeoplePostMapPublic()
214
 
215
  // public methods
216
  set_map: function(){
217
- if(this.data.markers.length){
 
 
 
 
218
 
219
- var m = this.data.markers,
220
- h = m.length;
221
 
222
- this.counter = h; // Counter is used to know the momment where all latitudes or longitudes were calculated
223
-
224
- for(var i=0; i < h; i++){
225
- if(typeof m[i] == 'undefined')
226
- {
227
- m[i] = {'invalid':true};
228
- this.counter--;
229
- continue;
230
- }else if( (this._empty(m[i].lat) || this._empty(m[i].lng)) && !this._empty(m[i].address)){
231
- this._get_latlng(i);
232
- }else if(this._empty(m[i].lat) && this._empty(m[i].lng)){
233
- // The address is not present so the point may be removed from the list
234
- m[i]['invalid'] = true;
235
- this.counter--;
236
- }else{
237
- m[i]['latlng'] = new google.maps.LatLng(this._correct(m[i].lat), this._correct(m[i].lng));
238
- this.counter--;
 
 
 
 
 
 
 
 
239
  }
 
240
 
241
- }
242
 
243
  // All points have been checked now is possible to load the map
244
- if(this.counter == 0){
245
- this._load_map();
246
  }
247
  }
248
  },
214
 
215
  // public methods
216
  set_map: function(){
217
+ var me = this;
218
+ if(me.data.markers.length){
219
+ var m = me.data.markers,
220
+ h = m.length,
221
+ z = 0;
222
 
223
+ me.counter = h; // Counter is used to know the momment where all latitudes or longitudes were calculated
 
224
 
225
+ function _get_latlng()
226
+ {
227
+ var tmp = 0;
228
+ for(var i=z; i < h; i++){
229
+ z++;
230
+ if(typeof m[i] == 'undefined')
231
+ {
232
+ m[i] = {'invalid':true};
233
+ me.counter--;
234
+ continue;
235
+ }else if((me._empty(m[i].lat) || me._empty(m[i].lng)) && !me._empty(m[i].address)){
236
+ me._get_latlng(i);
237
+ tmp++;
238
+ if(tmp == 20)
239
+ {
240
+ setTimeout(_get_latlng, 1500);
241
+ }
242
+ }else if(me._empty(m[i].lat) && me._empty(m[i].lng)){
243
+ // The address is not present so the point may be removed from the list
244
+ m[i]['invalid'] = true;
245
+ me.counter--;
246
+ }else{
247
+ m[i]['latlng'] = new google.maps.LatLng(me._correct(m[i].lat), me._correct(m[i].lng));
248
+ me.counter--;
249
+ }
250
  }
251
+ };
252
 
253
+ _get_latlng();
254
 
255
  // All points have been checked now is possible to load the map
256
+ if(me.counter == 0){
257
+ me._load_map();
258
  }
259
  }
260
  },
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: codepeople
3
  Donate link: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
4
  Tags:google maps,maps,marker,gmap,places,shortcode,map,categories,post map,point,location,address,images,geocoder,google,shape,list,grouping,cluster,infowindow,route,pin,streetview,post,posts,pages,widget,image,exif tag,plugin,sidebar,stylize,admin
5
  Requires at least: 3.0.5
6
- Tested up to: 5.5
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -636,6 +636,14 @@ Now the most important part create the shape's area. To create the shape's area
636
 
637
  == Changelog ==
638
 
 
 
 
 
 
 
 
 
639
  = 1.0.35 =
640
 
641
  * Includes a video tutorial in the plugin's interface to improve the users' experience.
3
  Donate link: http://wordpress.dwbooster.com/content-tools/codepeople-post-map
4
  Tags:google maps,maps,marker,gmap,places,shortcode,map,categories,post map,point,location,address,images,geocoder,google,shape,list,grouping,cluster,infowindow,route,pin,streetview,post,posts,pages,widget,image,exif tag,plugin,sidebar,stylize,admin
5
  Requires at least: 3.0.5
6
+ Tested up to: 5.7
7
  Stable tag: trunk
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
636
 
637
  == Changelog ==
638
 
639
+ = 1.0.37 =
640
+
641
+ * Modifies the interaction with the Google APIs to prevent the limits on Google requests, affect our plugin.
642
+
643
+ = 1.0.36 =
644
+
645
+ * Modifies the plugin's settings.
646
+
647
  = 1.0.35 =
648
 
649
  * Includes a video tutorial in the plugin's interface to improve the users' experience.