WP Google Maps - Version 6.3.09

Version Description

  • 2016-04-15 - High priority =
  • Deprecated google maps api 3.14 and 3.15, added 3.23 and 3.24
Download this release

Release Info

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

Code changes from version 6.3.08 to 6.3.09

cache/timthumb_cacheLastCleanTime.touch ADDED
File without changes
cache/timthumb_int_1feb94dfe4564036dfa309e87c1c70aa.timthumb.txt ADDED
Binary file
cache/timthumb_int_9b31d30bd2ddcfe0c062091cc5c498d7.timthumb.txt ADDED
Binary file
cache/wpgmaps.tmp ADDED
@@ -0,0 +1 @@
1
+ Permission Check
css/wp-google-maps-admin.css ADDED
@@ -0,0 +1,29 @@
1
+ .wpgmza-extension {
2
+
3
+ float: left;
4
+ margin: 0 15px 15px 0;
5
+ background: #fff;
6
+ border: 1px solid #ccc;
7
+ width: 320px;
8
+ padding: 14px;
9
+ height: 370px;
10
+ position: relative;
11
+
12
+ }
13
+ .wpgmza-extension h3 {
14
+ margin: 0 0 8px;
15
+ font-size: 13px;
16
+
17
+ }
18
+ .wpgmza-extension .wp-post-image {
19
+ width: 100%;
20
+ height: auto;
21
+ }
22
+ .wpgmza-extension .button-secondary {
23
+ position: absolute;
24
+ bottom: 14px;
25
+ left: 14px;
26
+ }
27
+ .wpgmza-plugin {
28
+ height: 250px;
29
+ }
images/codecabin.png ADDED
Binary file
js/wp-google-maps.js ADDED
@@ -0,0 +1,769 @@
1
+ var MYMAP = new Array();
2
+ var WPGM_Path_Polygon = new Array();
3
+ var WPGM_Path = new Array();
4
+
5
+ if (markers && markers.length > 0 && markers !== "[]"){
6
+ var db_marker_array = JSON.stringify(markers);
7
+ } else {
8
+ db_marker_array = '';
9
+ }
10
+
11
+ if ('undefined' === typeof window.jQuery) {
12
+ setTimeout(function(){
13
+ for(var entry in wpgmaps_localize) {
14
+ document.getElementById('wpgmza_map_'+entry).innerHTML = wpgmza_jquery_error_string_1;
15
+ }
16
+ }, 3000);
17
+ } else {
18
+
19
+ }
20
+
21
+ jQuery(function() {
22
+
23
+
24
+ jQuery(document).ready(function(){
25
+ if (/1\.(0|1|2|3|4|5|6|7)\.(0|1|2|3|4|5|6|7|8|9)/.test(jQuery.fn.jquery)) {
26
+ setTimeout(function(){
27
+ for(var entry in wpgmaps_localize) {
28
+ document.getElementById('wpgmza_map_'+entry).innerHTML = wpgmza_jquery_error_string_2;
29
+ }
30
+ }, 3000);
31
+ } else {
32
+
33
+ for(var entry in wpgmaps_localize) {
34
+ InitMap(wpgmaps_localize[entry]['id'],false);
35
+ }
36
+
37
+ }
38
+
39
+ });
40
+
41
+ });
42
+
43
+
44
+ for(var entry in wpgmaps_localize) {
45
+
46
+ MYMAP[entry] = {
47
+ map: null,
48
+ bounds: null
49
+ }
50
+
51
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_draggable'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_draggable']) { wpgmza_settings_map_draggable = true; } else { wpgmza_settings_map_draggable = false; }
52
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_clickzoom'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_clickzoom']) { wpgmza_settings_map_clickzoom = false; } else { wpgmza_settings_map_clickzoom = true; }
53
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_scroll'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_scroll']) { wpgmza_settings_map_scroll = true; } else { wpgmza_settings_map_scroll = false; }
54
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_zoom'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_zoom']) { wpgmza_settings_map_zoom = true; } else { wpgmza_settings_map_zoom = false; }
55
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_pan'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_pan']) { wpgmza_settings_map_pan = true; } else { wpgmza_settings_map_pan = false; }
56
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_type'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_type']) { wpgmza_settings_map_type = true; } else { wpgmza_settings_map_type = false; }
57
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_streetview'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_streetview']) { wpgmza_settings_map_streetview = true; } else { wpgmza_settings_map_streetview = false; }
58
+
59
+
60
+ if ('undefined' === typeof wpgmaps_localize[entry]['other_settings']['map_max_zoom'] || wpgmaps_localize[entry]['other_settings']['map_max_zoom'] === "") { wpgmza_max_zoom = 0; } else { wpgmza_max_zoom = parseInt(wpgmaps_localize[entry]['other_settings']['map_max_zoom']); }
61
+
62
+ MYMAP[entry].init = function(selector, latLng, zoom, maptype,mapid) {
63
+ zoom = parseInt(zoom);
64
+ if (maptype === "1") {
65
+ var myOptions = {
66
+ zoom:zoom,
67
+ minZoom: wpgmza_max_zoom,
68
+ maxZoom: 21,
69
+ center: latLng,
70
+ draggable: wpgmza_settings_map_draggable,
71
+ disableDoubleClickZoom: wpgmza_settings_map_clickzoom,
72
+ scrollwheel: wpgmza_settings_map_scroll,
73
+ zoomControl: wpgmza_settings_map_zoom,
74
+ panControl: wpgmza_settings_map_pan,
75
+ mapTypeControl: wpgmza_settings_map_type,
76
+ streetViewControl: wpgmza_settings_map_streetview,
77
+ mapTypeId: google.maps.MapTypeId.ROADMAP
78
+ };
79
+ }
80
+ else if (maptype === "2") {
81
+ var myOptions = {
82
+ zoom:zoom,
83
+ minZoom: wpgmza_max_zoom,
84
+ maxZoom: 21,
85
+ center: latLng,
86
+ draggable: wpgmza_settings_map_draggable,
87
+ disableDoubleClickZoom: wpgmza_settings_map_clickzoom,
88
+ scrollwheel: wpgmza_settings_map_scroll,
89
+ zoomControl: wpgmza_settings_map_zoom,
90
+ panControl: wpgmza_settings_map_pan,
91
+ mapTypeControl: wpgmza_settings_map_type,
92
+ streetViewControl: wpgmza_settings_map_streetview,
93
+ mapTypeId: google.maps.MapTypeId.SATELLITE
94
+ };
95
+
96
+ }
97
+ else if (maptype === "3") {
98
+ var myOptions = {
99
+ zoom:zoom,
100
+ minZoom: wpgmza_max_zoom,
101
+ maxZoom: 21,
102
+ center: latLng,
103
+ draggable: wpgmza_settings_map_draggable,
104
+ disableDoubleClickZoom: wpgmza_settings_map_clickzoom,
105
+ scrollwheel: wpgmza_settings_map_scroll,
106
+ zoomControl: wpgmza_settings_map_zoom,
107
+ panControl: wpgmza_settings_map_pan,
108
+ mapTypeControl: wpgmza_settings_map_type,
109
+ streetViewControl: wpgmza_settings_map_streetview,
110
+ mapTypeId: google.maps.MapTypeId.HYBRID
111
+ };
112
+
113
+
114
+ }
115
+ else if (maptype === "4") {
116
+ var myOptions = {
117
+ zoom:zoom,
118
+ minZoom: wpgmza_max_zoom,
119
+ maxZoom: 21,
120
+ center: latLng,
121
+ draggable: wpgmza_settings_map_draggable,
122
+ disableDoubleClickZoom: wpgmza_settings_map_clickzoom,
123
+ scrollwheel: wpgmza_settings_map_scroll,
124
+ zoomControl: wpgmza_settings_map_zoom,
125
+ panControl: wpgmza_settings_map_pan,
126
+ mapTypeControl: wpgmza_settings_map_type,
127
+ streetViewControl: wpgmza_settings_map_streetview,
128
+ mapTypeId: google.maps.MapTypeId.TERRAIN
129
+ };
130
+
131
+ }
132
+ else {
133
+ var myOptions = {
134
+ zoom:zoom,
135
+ minZoom: wpgmza_max_zoom,
136
+ maxZoom: 21,
137
+ center: latLng,
138
+ draggable: wpgmza_settings_map_draggable,
139
+ disableDoubleClickZoom: wpgmza_settings_map_clickzoom,
140
+ scrollwheel: wpgmza_settings_map_scroll,
141
+ zoomControl: wpgmza_settings_map_zoom,
142
+ panControl: wpgmza_settings_map_pan,
143
+ mapTypeControl: wpgmza_settings_map_type,
144
+ streetViewControl: wpgmza_settings_map_streetview,
145
+ mapTypeId: google.maps.MapTypeId.ROADMAP
146
+ };
147
+
148
+
149
+ }
150
+
151
+ this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
152
+ this.bounds = new google.maps.LatLngBounds();
153
+ jQuery( "#wpgmza_map_"+mapid).trigger( 'wpgooglemaps_loaded' );
154
+
155
+ if ("undefined" !== typeof wpgmaps_localize[mapid]['other_settings']['wpgmza_theme_data'] && wpgmaps_localize[mapid]['other_settings']['wpgmza_theme_data'] !== false) {
156
+ this.map.setOptions({styles: jQuery.parseJSON(wpgmaps_localize[mapid]['other_settings']['wpgmza_theme_data'])});
157
+ }
158
+
159
+
160
+ /* insert polygon and polyline functionality */
161
+ if (wpgmaps_localize_polygon_settings !== null) {
162
+ if (typeof wpgmaps_localize_polygon_settings[mapid] !== "undefined") {
163
+ for(var poly_entry in wpgmaps_localize_polygon_settings[mapid]) {
164
+ add_polygon(mapid,poly_entry);
165
+ }
166
+ }
167
+ }
168
+ if (wpgmaps_localize_polyline_settings !== null) {
169
+ if (typeof wpgmaps_localize_polyline_settings[mapid] !== "undefined") {
170
+ for(var poly_entry in wpgmaps_localize_polyline_settings[mapid]) {
171
+ add_polyline(mapid,poly_entry);
172
+ }
173
+ }
174
+ }
175
+
176
+
177
+ if (wpgmaps_localize[entry]['bicycle'] === "1") {
178
+ var bikeLayer = new google.maps.BicyclingLayer();
179
+ bikeLayer.setMap(this.map);
180
+ }
181
+ if (wpgmaps_localize[entry]['traffic'] === "1") {
182
+ var trafficLayer = new google.maps.TrafficLayer();
183
+ trafficLayer.setMap(this.map);
184
+ }
185
+ if (wpgmaps_localize[entry]['transport'] === "1") {
186
+ var transitLayer = new google.maps.TransitLayer();
187
+ transitLayer.setMap(this.map);
188
+ }
189
+
190
+
191
+
192
+ google.maps.event.addListener(MYMAP[entry].map, 'click', function() {
193
+ infoWindow.close();
194
+ });
195
+
196
+
197
+
198
+ }
199
+
200
+ var infoWindow = new google.maps.InfoWindow();
201
+
202
+ infoWindow.setOptions({maxWidth:wpgmaps_localize_global_settings['wpgmza_settings_infowindow_width']});
203
+
204
+ google.maps.event.addDomListener(window, 'resize', function() {
205
+ var myLatLng = new google.maps.LatLng(wpgmza_lat,wpgmza_lng);
206
+ MYMAP[entry].map.setCenter(myLatLng);
207
+ });
208
+ MYMAP[entry].placeMarkers = function(filename,map_id,radius,searched_center,distance_type) {
209
+ var check1 = 0;
210
+ if (marker_pull === '1') {
211
+
212
+ jQuery.get(filename, function(xml){
213
+ jQuery(xml).find("marker").each(function(){
214
+ var wpmgza_map_id = jQuery(this).find('map_id').text();
215
+
216
+ if (wpmgza_map_id == map_id) {
217
+ var wpmgza_address = jQuery(this).find('address').text();
218
+ var lat = jQuery(this).find('lat').text();
219
+ var lng = jQuery(this).find('lng').text();
220
+ var wpmgza_anim = jQuery(this).find('anim').text();
221
+ var wpmgza_infoopen = jQuery(this).find('infoopen').text();
222
+ var current_lat = jQuery(this).find('lat').text();
223
+ var current_lng = jQuery(this).find('lng').text();
224
+ var show_marker_radius = true;
225
+
226
+ if (radius !== null) {
227
+ if (check1 > 0 ) { } else {
228
+
229
+
230
+ var point = new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));
231
+ MYMAP[entry].bounds.extend(point);
232
+
233
+ if (wpgmaps_localize[map_id]['other_settings']['store_locator_bounce'] === 1) {
234
+ var marker = new google.maps.Marker({
235
+ position: point,
236
+ map: MYMAP[entry].map,
237
+ animation: google.maps.Animation.BOUNCE
238
+ });
239
+ } else { /* do nothing */ }
240
+
241
+ if (distance_type === "1") {
242
+ var populationOptions = {
243
+ strokeColor: '#FF0000',
244
+ strokeOpacity: 0.25,
245
+ strokeWeight: 2,
246
+ fillColor: '#FF0000',
247
+ fillOpacity: 0.15,
248
+ map: MYMAP[entry].map,
249
+ center: point,
250
+ radius: parseInt(radius / 0.000621371)
251
+ };
252
+ } else {
253
+ var populationOptions = {
254
+ strokeColor: '#FF0000',
255
+ strokeOpacity: 0.25,
256
+ strokeWeight: 2,
257
+ fillColor: '#FF0000',
258
+ fillOpacity: 0.15,
259
+ map: MYMAP[entry].map,
260
+ center: point,
261
+ radius: parseInt(radius / 0.001)
262
+ };
263
+ }
264
+
265
+ cityCircle = new google.maps.Circle(populationOptions);
266
+ check1 = check1 + 1;
267
+ }
268
+ var R = 0;
269
+ if (distance_type === "1") {
270
+ R = 3958.7558657440545;
271
+ } else {
272
+ R = 6378.16;
273
+ }
274
+ var dLat = toRad(searched_center.lat()-current_lat);
275
+ var dLon = toRad(searched_center.lng()-current_lng);
276
+ 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);
277
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
278
+ var d = R * c;
279
+
280
+ if (d < radius) { show_marker_radius = true; } else { show_marker_radius = false; }
281
+ }
282
+
283
+
284
+
285
+ var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
286
+ MYMAP[entry].bounds.extend(point);
287
+ if (show_marker_radius === true) {
288
+ if (wpmgza_anim === "1") {
289
+ var marker = new google.maps.Marker({
290
+ position: point,
291
+ map: MYMAP[entry].map,
292
+ animation: google.maps.Animation.BOUNCE
293
+ });
294
+ }
295
+ else if (wpmgza_anim === "2") {
296
+ var marker = new google.maps.Marker({
297
+ position: point,
298
+ map: MYMAP[entry].map,
299
+ animation: google.maps.Animation.DROP
300
+ });
301
+ }
302
+ else {
303
+ var marker = new google.maps.Marker({
304
+ position: point,
305
+ map: MYMAP[entry].map
306
+ });
307
+ }
308
+ var d_string = "";
309
+ if (radius !== null) {
310
+ if (distance_type === "1") {
311
+ d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";
312
+ } else {
313
+ d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";
314
+ }
315
+ } else { d_string = ''; }
316
+
317
+
318
+ var html='<p style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</p>'+d_string;
319
+ if (wpmgza_infoopen === "1") {
320
+ infoWindow.setContent(html);
321
+ infoWindow.open(MYMAP[entry].map, marker);
322
+ }
323
+
324
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] || wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] === '1') {
325
+ google.maps.event.addListener(marker, 'click', function() {
326
+ infoWindow.close();
327
+ infoWindow.setContent(html);
328
+ infoWindow.open(MYMAP[entry].map, marker);
329
+
330
+ });
331
+ } else {
332
+ google.maps.event.addListener(marker, 'mouseover', function() {
333
+ infoWindow.close();
334
+ infoWindow.setContent(html);
335
+ infoWindow.open(MYMAP[entry].map, marker);
336
+
337
+ });
338
+ }
339
+
340
+ }
341
+ }
342
+ });
343
+
344
+ });
345
+ } else {
346
+
347
+ if (db_marker_array.length > 0) {
348
+ var dec_marker_array = jQuery.parseJSON(db_marker_array);
349
+ jQuery.each(dec_marker_array, function(i, val) {
350
+
351
+
352
+ var wpmgza_map_id = val.map_id;
353
+
354
+ if (wpmgza_map_id == map_id) {
355
+
356
+ var wpmgza_address = val.address;
357
+ var wpmgza_anim = val.anim;
358
+ var wpmgza_infoopen = val.infoopen;
359
+ var lat = val.lat;
360
+ var lng = val.lng;
361
+ var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
362
+
363
+
364
+ var current_lat = val.lat;
365
+ var current_lng = val.lng;
366
+ var show_marker_radius = true;
367
+
368
+ if (radius !== null) {
369
+ if (check1 > 0 ) { } else {
370
+
371
+
372
+ var point = new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));
373
+ MYMAP[entry].bounds.extend(point);
374
+ if (wpgmaps_localize[map_id]['other_settings']['store_locator_bounce'] === 1) {
375
+ var marker = new google.maps.Marker({
376
+ position: point,
377
+ map: MYMAP[entry].map,
378
+ animation: google.maps.Animation.BOUNCE
379
+ });
380
+ } else { /* do nothing */ }
381
+
382
+
383
+
384
+ if (distance_type === "1") {
385
+ var populationOptions = {
386
+ strokeColor: '#FF0000',
387
+ strokeOpacity: 0.25,
388
+ strokeWeight: 2,
389
+ fillColor: '#FF0000',
390
+ fillOpacity: 0.15,
391
+ map: MYMAP[entry].map,
392
+ center: point,
393
+ radius: parseInt(radius / 0.000621371)
394
+ };
395
+ } else {
396
+ var populationOptions = {
397
+ strokeColor: '#FF0000',
398
+ strokeOpacity: 0.25,
399
+ strokeWeight: 2,
400
+ fillColor: '#FF0000',
401
+ fillOpacity: 0.15,
402
+ map: MYMAP[entry].map,
403
+ center: point,
404
+ radius: parseInt(radius / 0.001)
405
+ };
406
+ }
407
+
408
+ cityCircle = new google.maps.Circle(populationOptions);
409
+ check1 = check1 + 1;
410
+ }
411
+ var R = 0;
412
+ if (distance_type === "1") {
413
+ R = 3958.7558657440545;
414
+ } else {
415
+ R = 6378.16;
416
+ }
417
+ var dLat = toRad(searched_center.lat()-current_lat);
418
+ var dLon = toRad(searched_center.lng()-current_lng);
419
+ 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);
420
+ var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
421
+ var d = R * c;
422
+
423
+ if (d < radius) { show_marker_radius = true; } else { show_marker_radius = false; }
424
+ }
425
+
426
+
427
+
428
+ var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
429
+ MYMAP[entry].bounds.extend(point);
430
+ if (show_marker_radius === true) {
431
+ if (wpmgza_anim === "1") {
432
+ var marker = new google.maps.Marker({
433
+ position: point,
434
+ map: MYMAP[entry].map,
435
+ animation: google.maps.Animation.BOUNCE
436
+ });
437
+ }
438
+ else if (wpmgza_anim === "2") {
439
+ var marker = new google.maps.Marker({
440
+ position: point,
441
+ map: MYMAP[entry].map,
442
+ animation: google.maps.Animation.DROP
443
+ });
444
+ }
445
+ else {
446
+ var marker = new google.maps.Marker({
447
+ position: point,
448
+ map: MYMAP[entry].map
449
+ });
450
+ }
451
+ var d_string = "";
452
+ if (radius !== null) {
453
+ if (distance_type === "1") {
454
+ d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";
455
+ } else {
456
+ d_string = "<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";
457
+ }
458
+ } else { d_string = ''; }
459
+
460
+
461
+ var html='<p style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</p>'+d_string;
462
+ if (wpmgza_infoopen === "1") {
463
+ infoWindow.setContent(html);
464
+ infoWindow.open(MYMAP[entry].map, marker);
465
+ }
466
+
467
+ if (wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] === "" || 'undefined' === typeof wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] || wpgmaps_localize_global_settings['wpgmza_settings_map_open_marker_by'] === '1') {
468
+ google.maps.event.addListener(marker, 'click', function() {
469
+ infoWindow.close();
470
+ infoWindow.setContent(html);
471
+ infoWindow.open(MYMAP[entry].map, marker);
472
+
473
+ });
474
+ } else {
475
+ google.maps.event.addListener(marker, 'mouseover', function() {
476
+ infoWindow.close();
477
+ infoWindow.setContent(html);
478
+ infoWindow.open(MYMAP[entry].map, marker);
479
+
480
+ });
481
+ }
482
+
483
+
484
+ }
485
+ }
486
+
487
+
488
+
489
+
490
+
491
+ });
492
+ }
493
+
494
+
495
+
496
+
497
+ }
498
+ }
499
+ }
500
+ jQuery("body").on("keypress","#addressInput", function(event) {
501
+ if ( event.which == 13 ) {
502
+ jQuery('.wpgmza_sl_search_button').trigger('click');
503
+ }
504
+ });
505
+ var autocomplete;
506
+ function fillInAddress() {
507
+ // Get the place details from the autocomplete object.
508
+ var place = autocomplete.getPlace();
509
+ }
510
+ var elementExists = document.getElementById("addressInput");
511
+ if (typeof google === 'object' && typeof google.maps === 'object' && typeof google.maps.places === 'object' && typeof google.maps.places.Autocomplete === 'function') {
512
+ if (elementExists !== null) {
513
+ /* initialize the autocomplete form */
514
+ autocomplete = new google.maps.places.Autocomplete(
515
+ /** @type {HTMLInputElement} */(document.getElementById('addressInput')),
516
+ { types: ['geocode'] });
517
+ // When the user selects an address from the dropdown,
518
+ // populate the address fields in the form.
519
+ google.maps.event.addListener(autocomplete, 'place_changed', function() {
520
+ fillInAddress();
521
+ });
522
+ }
523
+ }
524
+
525
+ function add_polygon(mapid,polygonid) {
526
+ var tmp_data = wpgmaps_localize_polygon_settings[mapid][polygonid];
527
+ var current_poly_id = polygonid;
528
+ var tmp_polydata = tmp_data['polydata'];
529
+ var WPGM_PathData = new Array();
530
+ for (tmp_entry2 in tmp_polydata) {
531
+ if (typeof tmp_polydata[tmp_entry2][0] !== "undefined") {
532
+
533
+ WPGM_PathData.push(new google.maps.LatLng(tmp_polydata[tmp_entry2][0], tmp_polydata[tmp_entry2][1]));
534
+ }
535
+ }
536
+ if (tmp_data['lineopacity'] === null || tmp_data['lineopacity'] === "") {
537
+ tmp_data['lineopacity'] = 1;
538
+ }
539
+
540
+ var bounds = new google.maps.LatLngBounds();
541
+ for (i = 0; i < WPGM_PathData.length; i++) {
542
+ bounds.extend(WPGM_PathData[i]);
543
+ }
544
+
545
+ WPGM_Path_Polygon[polygonid] = new google.maps.Polygon({
546
+ path: WPGM_PathData,
547
+ clickable: true, /* must add option for this */
548
+ strokeColor: "#"+tmp_data['linecolor'],
549
+ fillOpacity: tmp_data['opacity'],
550
+ strokeOpacity: tmp_data['lineopacity'],
551
+ fillColor: "#"+tmp_data['fillcolor'],
552
+ strokeWeight: 2,
553
+ map: MYMAP[mapid].map
554
+ });
555
+ WPGM_Path_Polygon[polygonid].setMap(MYMAP[mapid].map);
556
+
557
+ polygon_center = bounds.getCenter();
558
+
559
+ if (tmp_data['title'] !== "") {
560
+ infoWindow_poly[polygonid] = new google.maps.InfoWindow();
561
+ google.maps.event.addListener(WPGM_Path_Polygon[polygonid], 'click', function(event) {
562
+ infoWindow_poly[polygonid].setPosition(event.latLng);
563
+ content = "";
564
+ if (tmp_data['link'] !== "") {
565
+ var content = "<a href='"+tmp_data['link']+"'>"+tmp_data['title']+"</a>";
566
+ } else {
567
+ var content = tmp_data['title'];
568
+ }
569
+ infoWindow_poly[polygonid].setContent(content);
570
+ infoWindow_poly[polygonid].open(MYMAP[mapid].map,this.position);
571
+ });
572
+ }
573
+
574
+
575
+ google.maps.event.addListener(WPGM_Path_Polygon[polygonid], "mouseover", function(event) {
576
+ this.setOptions({fillColor: "#"+tmp_data['ohfillcolor']});
577
+ this.setOptions({fillOpacity: tmp_data['ohopacity']});
578
+ this.setOptions({strokeColor: "#"+tmp_data['ohlinecolor']});
579
+ this.setOptions({strokeWeight: 2});
580
+ this.setOptions({strokeOpacity: 0.9});
581
+ });
582
+ google.maps.event.addListener(WPGM_Path_Polygon[polygonid], "click", function(event) {
583
+
584
+ this.setOptions({fillColor: "#"+tmp_data['ohfillcolor']});
585
+ this.setOptions({fillOpacity: tmp_data['ohopacity']});
586
+ this.setOptions({strokeColor: "#"+tmp_data['ohlinecolor']});
587
+ this.setOptions({strokeWeight: 2});
588
+ this.setOptions({strokeOpacity: 0.9});
589
+ });
590
+ google.maps.event.addListener(WPGM_Path_Polygon[polygonid], "mouseout", function(event) {
591
+ this.setOptions({fillColor: "#"+tmp_data['fillcolor']});
592
+ this.setOptions({fillOpacity: tmp_data['opacity']});
593
+ this.setOptions({strokeColor: "#"+tmp_data['linecolor']});
594
+ this.setOptions({strokeWeight: 2});
595
+ this.setOptions({strokeOpacity: tmp_data['lineopacity']});
596
+ });
597
+
598
+
599
+
600
+
601
+
602
+ }
603
+ function add_polyline(mapid,polyline) {
604
+
605
+
606
+ var tmp_data = wpgmaps_localize_polyline_settings[mapid][polyline];
607
+
608
+ var current_poly_id = polyline;
609
+ var tmp_polydata = tmp_data['polydata'];
610
+ var WPGM_Polyline_PathData = new Array();
611
+ for (tmp_entry2 in tmp_polydata) {
612
+ if (typeof tmp_polydata[tmp_entry2][0] !== "undefined" && typeof tmp_polydata[tmp_entry2][1] !== "undefined") {
613
+ var lat = tmp_polydata[tmp_entry2][0].replace(')', '');
614
+ lat = lat.replace('(','');
615
+ var lng = tmp_polydata[tmp_entry2][1].replace(')', '');
616
+ lng = lng.replace('(','');
617
+ WPGM_Polyline_PathData.push(new google.maps.LatLng(lat, lng));
618
+ }
619
+
620
+
621
+ }
622
+ if (tmp_data['lineopacity'] === null || tmp_data['lineopacity'] === "") {
623
+ tmp_data['lineopacity'] = 1;
624
+ }
625
+
626
+ WPGM_Path[polyline] = new google.maps.Polyline({
627
+ path: WPGM_Polyline_PathData,
628
+ strokeColor: "#"+tmp_data['linecolor'],
629
+ strokeOpacity: tmp_data['opacity'],
630
+ strokeWeight: tmp_data['linethickness'],
631
+ map: MYMAP[mapid].map
632
+ });
633
+ WPGM_Path[polyline].setMap(MYMAP[mapid].map);
634
+
635
+
636
+ }
637
+
638
+
639
+
640
+ function searchLocations(map_id) {
641
+ var address = document.getElementById("addressInput").value;
642
+ var geocoder = new google.maps.Geocoder();
643
+
644
+ checker = address.split(",");
645
+ var wpgm_lat = "";
646
+ var wpgm_lng = "";
647
+ wpgm_lat = checker[0];
648
+ wpgm_lng = checker[1];
649
+ checker1 = parseFloat(checker[0]);
650
+ checker2 = parseFloat(checker[1]);
651
+
652
+
653
+ if (typeof wpgmaps_localize[map_id]['other_settings']['wpgmza_store_locator_restrict'] !== "undefined" && wpgmaps_localize[map_id]['other_settings']['wpgmza_store_locator_restrict'] != "") {
654
+ if ((wpgm_lat.match(/[a-zA-Z]/g) === null && wpgm_lng.match(/[a-zA-Z]/g) === null) && checker.length === 2 && (checker1 != NaN && (checker1 <= 90 || checker1 >= -90)) && (checker2 != NaN && (checker2 <= 90 || checker2 >= -90))) {
655
+ var point = new google.maps.LatLng(parseFloat(wpgm_lat),parseFloat(wpgm_lng));
656
+ searchLocationsNear(map_id,point);
657
+ }
658
+ else {
659
+ /* is an address, must geocode */
660
+ geocoder.geocode({address: address,componentRestrictions: {country: wpgmaps_localize[map_id]['other_settings']['wpgmza_store_locator_restrict']}}, function(results, status) {
661
+ if (status == google.maps.GeocoderStatus.OK) {
662
+ searchLocationsNear(map_id,results[0].geometry.location);
663
+ } else {
664
+ alert(address + ' not found');
665
+ }
666
+ });
667
+
668
+ }
669
+ } else {
670
+
671
+ if ((typeof wpgm_lng !== "undefined" && wpgm_lat.match(/[a-zA-Z]/g) === null && wpgm_lng.match(/[a-zA-Z]/g) === null) && checker.length === 2 && (checker1 != NaN && (checker1 <= 90 || checker1 >= -90)) && (checker2 != NaN && (checker2 <= 90 || checker2 >= -90))) {
672
+ var point = new google.maps.LatLng(parseFloat(wpgm_lat),parseFloat(wpgm_lng));
673
+ searchLocationsNear(map_id,point);
674
+ }
675
+ else {
676
+ /* is an address, must geocode */
677
+ geocoder.geocode({address: address}, function(results, status) {
678
+ if (status == google.maps.GeocoderStatus.OK) {
679
+ searchLocationsNear(map_id,results[0].geometry.location);
680
+ } else {
681
+ alert(address + ' not found');
682
+ }
683
+ });
684
+
685
+ }
686
+
687
+ }
688
+
689
+ }
690
+
691
+ function clearLocations() {
692
+ infoWindow.close();
693
+ }
694
+
695
+
696
+
697
+
698
+ function searchLocationsNear(mapid,center_searched) {
699
+ clearLocations();
700
+ var distance_type = document.getElementById("wpgmza_distance_type").value;
701
+ var radius = document.getElementById('radiusSelect').value;
702
+ if (distance_type === "1") {
703
+ if (radius === "1") { zoomie = 14; }
704
+ else if (radius === "5") { zoomie = 12; }
705
+ else if (radius === "10") { zoomie = 11; }
706
+ else if (radius === "25") { zoomie = 9; }
707
+ else if (radius === "50") { zoomie = 8; }
708
+ else if (radius === "75") { zoomie = 8; }
709
+ else if (radius === "100") { zoomie = 7; }
710
+ else if (radius === "150") { zoomie = 7; }
711
+ else if (radius === "200") { zoomie = 6; }
712
+ else if (radius === "300") { zoomie = 6; }
713
+ else { zoomie = 14; }
714
+ } else {
715
+ if (radius === "1") { zoomie = 14; }
716
+ else if (radius === "5") { zoomie = 12; }
717
+ else if (radius === "10") { zoomie = 11; }
718
+ else if (radius === "25") { zoomie = 10; }
719
+ else if (radius === "50") { zoomie = 9; }
720
+ else if (radius === "75") { zoomie = 8; }
721
+ else if (radius === "100") { zoomie = 8; }
722
+ else if (radius === "150") { zoomie = 7; }
723
+ else if (radius === "200") { zoomie = 7; }
724
+ else if (radius === "300") { zoomie = 6; }
725
+ else { zoomie = 14; }
726
+ }
727
+ MYMAP[mapid].init("#wpgmza_map_"+mapid, center_searched, zoomie, 3,mapid);
728
+ MYMAP[mapid].placeMarkers(wpgmaps_markerurl+mapid+'markers.xml?u='+UniqueCode,mapid,radius,center_searched,distance_type);
729
+ }
730
+
731
+ function toRad(Value) {
732
+ /** Converts numeric degrees to radians */
733
+ return Value * Math.PI / 180;
734
+ }
735
+
736
+
737
+
738
+ function InitMap(map_id,reinit) {
739
+
740
+ jQuery("#wpgmza_map_"+map_id).css({
741
+ height:wpgmaps_localize[map_id]['map_height']+''+wpgmaps_localize[map_id]['map_height_type'],
742
+ width:wpgmaps_localize[map_id]['map_width']+''+wpgmaps_localize[map_id]['map_width_type']
743
+
744
+ });
745
+ var myLatLng = new google.maps.LatLng(wpgmza_lat,wpgmza_lng);
746
+ MYMAP[map_id].init('#wpgmza_map_'+map_id, myLatLng, wpgmza_start_zoom, wpgmaps_localize['type'],map_id);
747
+ UniqueCode=Math.round(Math.random()*10000);
748
+ MYMAP[map_id].placeMarkers(wpgmaps_markerurl+map_id+'markers.xml?u='+UniqueCode,map_id,null,null,null);
749
+
750
+ jQuery('body').on('tabsactivate', function(event, ui) {
751
+ MYMAP[map_id].init('#wpgmza_map_'+map_id, myLatLng, wpgmza_start_zoom, wpgmaps_localize['type'],map_id);
752
+ UniqueCode=Math.round(Math.random()*10000);
753
+ MYMAP[map_id].placeMarkers(wpgmaps_markerurl+map_id+'markers.xml?u='+UniqueCode,map_id,null,null,null);
754
+ });
755
+
756
+ jQuery('body').on('click','.x-accordion-heading', function(){
757
+ setTimeout(function(){
758
+ MYMAP[map_id].init('#wpgmza_map_'+map_id, myLatLng, wpgmza_start_zoom, wpgmaps_localize['type'],map_id);
759
+ UniqueCode=Math.round(Math.random()*10000);
760
+ MYMAP[map_id].placeMarkers(wpgmaps_markerurl+map_id+'markers.xml?u='+UniqueCode,map_id,null,null,null);
761
+ }, 100);
762
+ });
763
+
764
+
765
+
766
+
767
+
768
+
769
+ };
readme.txt CHANGED
@@ -46,7 +46,7 @@ The [WP Google Maps Pro Version](http://www.wpgmaps.com/purchase-professional-ve
46
* Serve your map marker data via your database or an XML file
47
* Compatible with caching plugins
48
* Compatible with Cloudfare
49
- * Latest Google Maps API (V3.14, V3.15 & V3.exp)
50
51
= Professional Edition =
52
* Create multiple Google maps!
@@ -188,6 +188,7 @@ Try [Nifty Maps](http://www.niftymaps.co) - Comprehensive Map Builder for all we
188
12. WP Google Maps Lite version: Store Locator Settings
189
13. WP Google Maps Lite version: Store Locator Map
190
14. WP Google Maps Lite version: Map Widget
191
192
193
== Upgrade Notice ==
@@ -206,6 +207,9 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
206
207
== Changelog ==
208
209
= 6.3.08 - 2016-04-14 - Medium Priority =
210
* Provides a workaround for users experiencing issues with their maps loading after updating to WordPress 4.5
211
46
* Serve your map marker data via your database or an XML file
47
* Compatible with caching plugins
48
* Compatible with Cloudfare
49
+ * Latest Google Maps API (V3.23, V3.24 & V3.exp)
50
51
= Professional Edition =
52
* Create multiple Google maps!
188
12. WP Google Maps Lite version: Store Locator Settings
189
13. WP Google Maps Lite version: Store Locator Map
190
14. WP Google Maps Lite version: Map Widget
191
+ 15. Select a theme for your map, or choose a theme from our theme library
192
193
194
== Upgrade Notice ==
207
208
== Changelog ==
209
210
+ = 6.3.09 - 2016-04-15 - High priority =
211
+ * Deprecated google maps api 3.14 and 3.15, added 3.23 and 3.24
212
+
213
= 6.3.08 - 2016-04-14 - Medium Priority =
214
* Provides a workaround for users experiencing issues with their maps loading after updating to WordPress 4.5
215
screenshot-15.jpg ADDED
Binary file
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: WP Google Maps
4
Plugin URI: http://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.3.08
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
Text Domain: wp-google-maps
@@ -11,6 +11,10 @@ Domain Path: /languages
11
*/
12
13
/*
14
* 6.3.08 - 2016-04-14 - Medium Priority
15
* Provides a workaround for users experiencing issues with their maps loading after updating to WordPress 4.5
16
*
@@ -223,8 +227,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
223
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
224
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
225
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
226
- $wpgmza_version = "6.3.08";
227
- $wpgmza_p_version = "6.3.05";
228
$wpgmza_t = "basic";
229
define("WPGMAPS", $wpgmza_version);
230
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -395,6 +399,7 @@ function wpgmaps_init() {
395
}
396
397
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
398
if ($wpgmza_settings['wpgmza_settings_marker_pull'] == "") {
399
400
$wpgmza_first_time = get_option("WPGMZA_FIRST_TIME");
@@ -460,18 +465,19 @@ function wpgmaps_init() {
460
/* check if version is outdated or plugin is being automatically updated */
461
$current_version = get_option("wpgmaps_current_version");
462
if (!isset($current_version) || $current_version != $wpgmza_version) {
463
wpgmaps_handle_db();
464
wpgmaps_handle_directory();
465
wpgmaps_update_all_xml_file();
466
update_option("wpgmaps_current_version",$wpgmza_version);
467
468
}
469
- /*
470
- if (floatval($wpgmza_pro_version) < 5.52) {
471
- if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
472
- echo "<div class='updated'><h2>WP Google Maps Notice</h2><p><strong>We have stopped using Timthumb</strong> to generate thumbnails for your markers due to security concerns.</p><p>Please update your pro version of WP Google Maps to at least 5.52 in order for your marker images to function correctly.</p></div>";
473
- }
474
- }*/
475
476
}
477
@@ -638,7 +644,7 @@ function wpgmaps_admin_edit_marker_javascript() {
638
if (isset($api_version) && $api_version != "") {
639
$api_version_string = "v=$api_version&";
640
} else {
641
- $api_version_string = "v=3.14&";
642
}
643
?>
644
<?php if( get_option( 'wpgmza_google_maps_api_key' ) ){ ?>
@@ -1572,7 +1578,7 @@ function wpgmaps_user_javascript_basic() {
1572
if (isset($api_version) && $api_version != "") {
1573
$api_version_string = "v=$api_version&";
1574
} else {
1575
- $api_version_string = "v=3.14&";
1576
}
1577
} else {
1578
$api_version_string = "v=3.exp&";
@@ -3947,8 +3953,8 @@ function wpgmaps_settings_page_basic() {
3947
$wpgmza_api_version_selected[1] = "";
3948
$wpgmza_api_version_selected[2] = "";
3949
3950
- if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.14") { $wpgmza_api_version_selected[0] = "selected"; }
3951
- else if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.15") { $wpgmza_api_version_selected[1] = "selected"; }
3952
else if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.exp") { $wpgmza_api_version_selected[2] = "selected"; }
3953
else { $wpgmza_api_version_selected[0] = "selected"; }
3954
@@ -4074,8 +4080,8 @@ function wpgmaps_settings_page_basic() {
4074
$ret .= " <td width='200' valign='top'>".__("Use Google Maps API","wp-google-maps").":</td>";
4075
$ret .= " <td>";
4076
$ret .= " <select id='wpgmza_api_version' name='wpgmza_api_version' >";
4077
- $ret .= " <option value=\"3.14\" ".$wpgmza_api_version_selected[0].">3.14</option>";
4078
- $ret .= " <option value=\"3.15\" ".$wpgmza_api_version_selected[1].">3.15</option>";
4079
$ret .= " <option value=\"3.exp\" ".$wpgmza_api_version_selected[2].">3.exp</option>";
4080
4081
$ret .= " </select> ";
3
Plugin Name: WP Google Maps
4
Plugin URI: http://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.3.09
7
Author: WP Google Maps
8
Author URI: http://www.wpgmaps.com
9
Text Domain: wp-google-maps
11
*/
12
13
/*
14
+ * 6.3.09 - 2016-04-15 - High priority
15
+ * Deprecated google maps api 3.14 and 3.15, added 3.23 and 3.24
16
+ *
17
+ *
18
* 6.3.08 - 2016-04-14 - Medium Priority
19
* Provides a workaround for users experiencing issues with their maps loading after updating to WordPress 4.5
20
*
227
$wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
228
$wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
229
$wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
230
+ $wpgmza_version = "6.3.09";
231
+ $wpgmza_p_version = "6.3.09";
232
$wpgmza_t = "basic";
233
define("WPGMAPS", $wpgmza_version);
234
define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
399
}
400
401
$wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
402
+
403
if ($wpgmza_settings['wpgmza_settings_marker_pull'] == "") {
404
405
$wpgmza_first_time = get_option("WPGMZA_FIRST_TIME");
465
/* check if version is outdated or plugin is being automatically updated */
466
$current_version = get_option("wpgmaps_current_version");
467
if (!isset($current_version) || $current_version != $wpgmza_version) {
468
+
469
+ $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
470
+ if (isset($wpgmza_settings['wpgmza_api_version']) && ($wpgmza_settings['wpgmza_api_version'] == "3.14" || $wpgmza_settings['wpgmza_api_version'] == "3.15")) {
471
+ $wpgmza_settings['wpgmza_api_version'] = "3.23";
472
+ }
473
+ update_option("WPGMZA_OTHER_SETTINGS",$wpgmza_settings);
474
+
475
wpgmaps_handle_db();
476
wpgmaps_handle_directory();
477
wpgmaps_update_all_xml_file();
478
update_option("wpgmaps_current_version",$wpgmza_version);
479
480
}
481
482
}
483
644
if (isset($api_version) && $api_version != "") {
645
$api_version_string = "v=$api_version&";
646
} else {
647
+ $api_version_string = "v=3.exp&";
648
}
649
?>
650
<?php if( get_option( 'wpgmza_google_maps_api_key' ) ){ ?>
1578
if (isset($api_version) && $api_version != "") {
1579
$api_version_string = "v=$api_version&";
1580
} else {
1581
+ $api_version_string = "v=3.exp&";
1582
}
1583
} else {
1584
$api_version_string = "v=3.exp&";
3953
$wpgmza_api_version_selected[1] = "";
3954
$wpgmza_api_version_selected[2] = "";
3955
3956
+ if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.23") { $wpgmza_api_version_selected[0] = "selected"; }
3957
+ else if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.24") { $wpgmza_api_version_selected[1] = "selected"; }
3958
else if (isset($wpgmza_api_version) && $wpgmza_api_version == "3.exp") { $wpgmza_api_version_selected[2] = "selected"; }
3959
else { $wpgmza_api_version_selected[0] = "selected"; }
3960
4080
$ret .= " <td width='200' valign='top'>".__("Use Google Maps API","wp-google-maps").":</td>";
4081
$ret .= " <td>";
4082
$ret .= " <select id='wpgmza_api_version' name='wpgmza_api_version' >";
4083
+ $ret .= " <option value=\"3.23\" ".$wpgmza_api_version_selected[0].">3.23</option>";
4084
+ $ret .= " <option value=\"3.24\" ".$wpgmza_api_version_selected[1].">3.24</option>";
4085
$ret .= " <option value=\"3.exp\" ".$wpgmza_api_version_selected[2].">3.exp</option>";
4086
4087
$ret .= " </select> ";