WP Google Maps - Version 6.3.19

Version Description

  • 2016-09-22 =
  • Fixed a bug that caused some maps to not load markers on page load
Download this release

Release Info

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

Code changes from version 6.3.18 to 6.3.19

Files changed (4) hide show
  1. js/wpgmaps.js +1 -0
  2. js/wpgmaps.min.js +1 -86
  3. readme.txt +3 -0
  4. wpGoogleMaps.php +74 -39
js/wpgmaps.js CHANGED
@@ -1,5 +1,6 @@
1
  var WPGM_Path_Polygon = new Array();
2
  var WPGM_Path = new Array();
 
3
 
4
  for (var entry in wpgmaps_localize) {
5
  if ('undefined' === typeof window.jQuery) {
1
  var WPGM_Path_Polygon = new Array();
2
  var WPGM_Path = new Array();
3
+ var infoWindow_poly = Array();
4
 
5
  for (var entry in wpgmaps_localize) {
6
  if ('undefined' === typeof window.jQuery) {
js/wpgmaps.min.js CHANGED
@@ -1,86 +1 @@
1
- var WPGM_Path_Polygon=new Array();var WPGM_Path=new Array();for(var entry in wpgmaps_localize){if('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.';},5000);}}
2
- function InitMap(){var myLatLng=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);if(typeof wpgmza_override_zoom!=="undefined"){MYMAP.init('#wpgmza_map',myLatLng,parseInt(wpgmza_override_zoom));}
3
- else{MYMAP.init('#wpgmza_map',myLatLng,parseInt(wpgmaps_localize[0].map_start_zoom));}
4
- UniqueCode=Math.round(Math.random()*10000);MYMAP.placeMarkers(wpgmaps_markerurl+'?u='+UniqueCode,wpgmaps_localize[0].id,null,null,null);}
5
- jQuery(function(){jQuery(document).ready(function(){if(/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.';},6000);}else{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(event,ui){InitMap();});jQuery('body').on('click','.tp-tabs li a',function(event,ui){InitMap();});jQuery('body').on('click','.nav-tabs li a',function(event,ui){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}
6
- 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;}
7
- 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;}
8
- 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;}
9
- 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;}
10
- 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;}
11
- 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;}
12
- 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;}
13
- if('undefined'===typeof wpgmaps_localize[0]['other_settings']['map_max_zoom']||wpgmaps_localize[0]['other_settings']['map_max_zoom']===""){wpgmza_max_zoom=0;}else{wpgmza_max_zoom=parseInt(wpgmaps_localize[0]['other_settings']['map_max_zoom']);}
14
- if('undefined'===typeof wpgmaps_localize[0]['other_settings']['map_min_zoom']||wpgmaps_localize[0]['other_settings']['map_min_zoom']===""){wpgmza_min_zoom=21;}else{wpgmza_min_zoom=parseInt(wpgmaps_localize[0]['other_settings']['map_min_zoom']);}
15
- MYMAP.init=function(selector,latLng,zoom){if(typeof wpgmaps_localize[0].type!=="undefined"){if(wpgmaps_localize[0].type==="1"){maptype=google.maps.MapTypeId.ROADMAP;}
16
- else if(wpgmaps_localize[0].type==="2"){maptype=google.maps.MapTypeId.SATELLITE;}
17
- else if(wpgmaps_localize[0].type==="3"){maptype=google.maps.MapTypeId.HYBRID;}
18
- else if(wpgmaps_localize[0].type==="4"){maptype=google.maps.MapTypeId.TERRAIN;}
19
- else{maptype=google.maps.MapTypeId.ROADMAP;}}else{maptype=google.maps.MapTypeId.ROADMAP;}
20
- var myOptions={zoom:zoom,minZoom:wpgmza_max_zoom,maxZoom:wpgmza_min_zoom,center:latLng,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}
21
- this.map=new google.maps.Map(jQuery(selector)[0],myOptions);this.bounds=new google.maps.LatLngBounds();if("undefined"!==typeof wpgmaps_localize[0]['other_settings']['wpgmza_theme_data']&&wpgmaps_localize[0]['other_settings']['wpgmza_theme_data']!==false&&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'])});}
22
- if(wpgmaps_localize_polygon_settings!==null){if(typeof wpgmaps_localize_polygon_settings!=="undefined"){for(var poly_entry in wpgmaps_localize_polygon_settings){add_polygon(poly_entry);}}}
23
- if(wpgmaps_localize_polyline_settings!==null){if(typeof wpgmaps_localize_polyline_settings!=="undefined"){for(var poly_entry in wpgmaps_localize_polyline_settings){add_polyline(poly_entry);}}}
24
- if(wpgmaps_localize[0]['bicycle']==="1"){var bikeLayer=new google.maps.BicyclingLayer();bikeLayer.setMap(MYMAP.map);}
25
- if(wpgmaps_localize[0]['traffic']==="1"){var trafficLayer=new google.maps.TrafficLayer();trafficLayer.setMap(MYMAP.map);}
26
- if("undefined"!==typeof wpgmaps_localize[0]['other_settings']['transport_layer']&&wpgmaps_localize[0]['other_settings']['transport_layer']===1){var transitLayer=new google.maps.TransitLayer();transitLayer.setMap(MYMAP.map);}
27
- google.maps.event.addListener(MYMAP.map,'click',function(){infoWindow.close();});}
28
- var infoWindow=new google.maps.InfoWindow();if(typeof wpgmaps_localize_global_settings['wpgmza_settings_infowindow_width']!=="undefined"&&wpgmaps_localize_global_settings['wpgmza_settings_infowindow_width']!==""){infoWindow.setOptions({maxWidth:wpgmaps_localize_global_settings['wpgmza_settings_infowindow_width']});}
29
- google.maps.event.addDomListener(window,'resize',function(){var myLatLng=new google.maps.LatLng(wpgmaps_localize[0].map_start_lat,wpgmaps_localize[0].map_start_lng);MYMAP.map.setCenter(myLatLng);});MYMAP.placeMarkers=function(filename,map_id,radius,searched_center,distance_type){var check1=0;if(wpgmaps_localize_global_settings.wpgmza_settings_marker_pull==='1'){jQuery.get(filename,function(xml){jQuery(xml).find("marker").each(function(){var wpmgza_map_id=jQuery(this).find('map_id').text();if(wpmgza_map_id==map_id){var wpmgza_address=jQuery(this).find('address').text();var lat=jQuery(this).find('lat').text();var lng=jQuery(this).find('lng').text();var wpmgza_anim=jQuery(this).find('anim').text();var wpmgza_infoopen=jQuery(this).find('infoopen').text();var current_lat=jQuery(this).find('lat').text();var current_lng=jQuery(this).find('lng').text();var show_marker_radius=true;if(radius!==null){if(check1>0){}else{var point=new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));MYMAP.bounds.extend(point);if(typeof wpgmaps_localize[0]['other_settings']['store_locator_bounce']==="undefined"||wpgmaps_localize[0]['other_settings']['store_locator_bounce']===1){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});}else{}
30
- if(distance_type==="1"){var populationOptions={strokeColor:'#FF0000',strokeOpacity:0.25,strokeWeight:2,fillColor:'#FF0000',fillOpacity:0.15,map:MYMAP.map,center:point,radius:parseInt(radius / 0.000621371)};}else{var populationOptions={strokeColor:'#FF0000',strokeOpacity:0.25,strokeWeight:2,fillColor:'#FF0000',fillOpacity:0.15,map:MYMAP.map,center:point,radius:parseInt(radius / 0.001)};}
31
- cityCircle=new google.maps.Circle(populationOptions);check1=check1+1;}
32
- var R=0;if(distance_type==="1"){R=3958.7558657440545;}else{R=6378.16;}
33
- var dLat=toRad(searched_center.lat()-current_lat);var dLon=toRad(searched_center.lng()-current_lng);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);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;if(d<radius){show_marker_radius=true;}else{show_marker_radius=false;}}
34
- var point=new google.maps.LatLng(parseFloat(lat),parseFloat(lng));MYMAP.bounds.extend(point);if(show_marker_radius===true){if(wpmgza_anim==="1"){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});}
35
- else if(wpmgza_anim==="2"){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.DROP});}
36
- else{var marker=new google.maps.Marker({position:point,map:MYMAP.map});}
37
- var d_string="";if(radius!==null){if(distance_type==="1"){d_string="<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";}else{d_string="<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";}}else{d_string='';}
38
- var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;if(wpmgza_infoopen==="1"){infoWindow.setContent(html);infoWindow.open(MYMAP.map,marker);}
39
- temp_actiontype='click';if(typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by!=="undefined"&&wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by=='2'){temp_actiontype='mouseover';}
40
- google.maps.event.addListener(marker,temp_actiontype,function(){infoWindow.close();infoWindow.setContent(html);infoWindow.open(MYMAP.map,marker);});}}});});}else{if(wpgmaps_localize_marker_data.length>0){jQuery.each(wpgmaps_localize_marker_data,function(i,val){var wpmgza_map_id=val.map_id;if(wpmgza_map_id==map_id){var wpmgza_address=val.address;var wpmgza_anim=val.anim;var wpmgza_infoopen=val.infoopen;var lat=val.lat;var lng=val.lng;var point=new google.maps.LatLng(parseFloat(lat),parseFloat(lng));var current_lat=val.lat;var current_lng=val.lng;var show_marker_radius=true;if(radius!==null){if(check1>0){}else{var point=new google.maps.LatLng(parseFloat(searched_center.lat()),parseFloat(searched_center.lng()));MYMAP.bounds.extend(point);if(typeof wpgmaps_localize[0]['other_settings']['store_locator_bounce']==="undefined"||wpgmaps_localize[0]['other_settings']['store_locator_bounce']===1){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});}else{}
41
- if(distance_type==="1"){var populationOptions={strokeColor:'#FF0000',strokeOpacity:0.25,strokeWeight:2,fillColor:'#FF0000',fillOpacity:0.15,map:MYMAP.map,center:point,radius:parseInt(radius / 0.000621371)};}else{var populationOptions={strokeColor:'#FF0000',strokeOpacity:0.25,strokeWeight:2,fillColor:'#FF0000',fillOpacity:0.15,map:MYMAP.map,center:point,radius:parseInt(radius / 0.001)};}
42
- cityCircle=new google.maps.Circle(populationOptions);check1=check1+1;}
43
- var R=0;if(distance_type==="1"){R=3958.7558657440545;}else{R=6378.16;}
44
- var dLat=toRad(searched_center.lat()-current_lat);var dLon=toRad(searched_center.lng()-current_lng);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);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;if(d<radius){show_marker_radius=true;}else{show_marker_radius=false;}}
45
- var point=new google.maps.LatLng(parseFloat(lat),parseFloat(lng));MYMAP.bounds.extend(point);if(show_marker_radius===true){if(wpmgza_anim==="1"){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.BOUNCE});}
46
- else if(wpmgza_anim==="2"){var marker=new google.maps.Marker({position:point,map:MYMAP.map,animation:google.maps.Animation.DROP});}
47
- else{var marker=new google.maps.Marker({position:point,map:MYMAP.map});}
48
- var d_string="";if(radius!==null){if(distance_type==="1"){d_string="<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_m_away+"</p>";}else{d_string="<p style='min-width:100px; display:block;'>"+Math.round(d,2)+" "+wpgmaps_lang_km_away+"</p>";}}else{d_string='';}
49
- var html='<span style=\'min-width:100px; display:block;\'>'+wpmgza_address+'</span>'+d_string;if(wpmgza_infoopen==="1"){infoWindow.setContent(html);infoWindow.open(MYMAP.map,marker);}
50
- temp_actiontype='click';if(typeof wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by!=="undefined"&&wpgmaps_localize_global_settings.wpgmza_settings_map_open_marker_by=='2'){temp_actiontype='mouseover';}
51
- google.maps.event.addListener(marker,temp_actiontype,function(){infoWindow.close();infoWindow.setContent(html);infoWindow.open(MYMAP.map,marker);});}}});}}}
52
- function add_polygon(polygonid){var tmp_data=wpgmaps_localize_polygon_settings[polygonid];var current_poly_id=polygonid;var tmp_polydata=tmp_data['polydata'];var WPGM_PathData=new Array();for(tmp_entry2 in tmp_polydata){if(typeof tmp_polydata[tmp_entry2][0]!=="undefined"){WPGM_PathData.push(new google.maps.LatLng(tmp_polydata[tmp_entry2][0],tmp_polydata[tmp_entry2][1]));}}
53
- if(tmp_data['lineopacity']===null||tmp_data['lineopacity']===""){tmp_data['lineopacity']=1;}
54
- var bounds=new google.maps.LatLngBounds();for(i=0;i<WPGM_PathData.length;i++){bounds.extend(WPGM_PathData[i]);}
55
- WPGM_Path_Polygon[polygonid]=new google.maps.Polygon({path:WPGM_PathData,clickable:true,strokeColor:"#"+tmp_data['linecolor'],fillOpacity:tmp_data['opacity'],strokeOpacity:tmp_data['lineopacity'],fillColor:"#"+tmp_data['fillcolor'],strokeWeight:2,map:MYMAP.map});WPGM_Path_Polygon[polygonid].setMap(MYMAP.map);polygon_center=bounds.getCenter();if(tmp_data['title']!==""){infoWindow_poly[polygonid]=new google.maps.InfoWindow();google.maps.event.addListener(WPGM_Path_Polygon[polygonid],'click',function(event){infoWindow_poly[polygonid].setPosition(event.latLng);content="";if(tmp_data['link']!==""){var content="<a href='"+tmp_data['link']+"'>"+tmp_data['title']+"</a>";}else{var content=tmp_data['title'];}
56
- infoWindow_poly[polygonid].setContent(content);infoWindow_poly[polygonid].open(MYMAP.map,this.position);});}}
57
- function add_polyline(polyline){var tmp_data=wpgmaps_localize_polyline_settings[polyline];var current_poly_id=polyline;var tmp_polydata=tmp_data['polydata'];var WPGM_Polyline_PathData=new Array();for(tmp_entry2 in tmp_polydata){if(typeof tmp_polydata[tmp_entry2][0]!=="undefined"&&typeof tmp_polydata[tmp_entry2][1]!=="undefined"){var lat=tmp_polydata[tmp_entry2][0].replace(')','');lat=lat.replace('(','');var lng=tmp_polydata[tmp_entry2][1].replace(')','');lng=lng.replace('(','');WPGM_Polyline_PathData.push(new google.maps.LatLng(lat,lng));}}
58
- if(tmp_data['lineopacity']===null||tmp_data['lineopacity']===""){tmp_data['lineopacity']=1;}
59
- WPGM_Path[polyline]=new google.maps.Polyline({path:WPGM_Polyline_PathData,strokeColor:"#"+tmp_data['linecolor'],strokeOpacity:tmp_data['opacity'],strokeWeight:tmp_data['linethickness'],map:MYMAP.map});WPGM_Path[polyline].setMap(MYMAP.map);}
60
- jQuery("body").on("keypress","#addressInput",function(event){if(event.which==13){jQuery('.wpgmza_sl_search_button').trigger('click');}});var autocomplete;function fillInAddress(){var place=autocomplete.getPlace();}
61
- var elementExists=document.getElementById("addressInput");if(typeof google==='object'&&typeof google.maps==='object'&&typeof google.maps.places==='object'&&typeof google.maps.places.Autocomplete==='function'){if(elementExists!==null){if(typeof wpgmaps_localize[0]['other_settings']['wpgmza_store_locator_restrict']==="undefined"||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();});}else{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();});}}}
62
- function searchLocations(map_id){var address=document.getElementById("addressInput").value;var geocoder=new google.maps.Geocoder();if(typeof wpgmaps_localize[0]['other_settings']['wpgmza_store_locator_restrict']==="undefined"||wpgmaps_localize[0]['other_settings']['wpgmza_store_locator_restrict']===""){geocoder.geocode({address:address},function(results,status){if(status===google.maps.GeocoderStatus.OK){searchLocationsNear(map_id,results[0].geometry.location);}else{alert(address+' not found');}});}else{geocoder.geocode({address:address,componentRestrictions:{country:wpgmaps_localize[0]['other_settings']['wpgmza_store_locator_restrict']}},function(results,status){if(status===google.maps.GeocoderStatus.OK){searchLocationsNear(map_id,results[0].geometry.location);}else{alert(address+' not found');}});}}
63
- function clearLocations(){infoWindow.close();}
64
- function searchLocationsNear(mapid,center_searched){clearLocations();var distance_type=document.getElementById("wpgmza_distance_type").value;var radius=document.getElementById('radiusSelect').value;if(distance_type==="1"){if(radius==="1"){zoomie=14;}
65
- else if(radius==="5"){zoomie=12;}
66
- else if(radius==="10"){zoomie=11;}
67
- else if(radius==="25"){zoomie=9;}
68
- else if(radius==="50"){zoomie=8;}
69
- else if(radius==="75"){zoomie=8;}
70
- else if(radius==="100"){zoomie=7;}
71
- else if(radius==="150"){zoomie=7;}
72
- else if(radius==="200"){zoomie=6;}
73
- else if(radius==="300"){zoomie=6;}
74
- else{zoomie=14;}}else{if(radius==="1"){zoomie=14;}
75
- else if(radius==="5"){zoomie=12;}
76
- else if(radius==="10"){zoomie=11;}
77
- else if(radius==="25"){zoomie=10;}
78
- else if(radius==="50"){zoomie=9;}
79
- else if(radius==="75"){zoomie=8;}
80
- else if(radius==="100"){zoomie=8;}
81
- else if(radius==="150"){zoomie=7;}
82
- else if(radius==="200"){zoomie=7;}
83
- else if(radius==="300"){zoomie=6;}
84
- else{zoomie=14;}}
85
- MYMAP.init("#wpgmza_map",center_searched,zoomie,3);MYMAP.placeMarkers(wpgmaps_markerurl+'?u='+UniqueCode,wpgmaps_localize[0].id,radius,center_searched,distance_type);}
86
- function toRad(Value){return Value*Math.PI / 180;}
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()})));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -213,6 +213,9 @@ Please upgrade your version of WP Google Maps to version 6.0.27 as it includes m
213
 
214
  == Changelog ==
215
 
 
 
 
216
  = 6.3.18 - 2016-09-15 =
217
  * Chinese support - when your language is set to Chinese (ZN_cn), the map will now load from maps.google.cn
218
  * Hebrew language code fixed when accessing the Google Maps API in Hebrew
213
 
214
  == Changelog ==
215
 
216
+ = 6.3.19 - 2016-09-22 =
217
+ * Fixed a bug that caused some maps to not load markers on page load
218
+
219
  = 6.3.18 - 2016-09-15 =
220
  * Chinese support - when your language is set to Chinese (ZN_cn), the map will now load from maps.google.cn
221
  * Hebrew language code fixed when accessing the Google Maps API in Hebrew
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.18
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  Text Domain: wp-google-maps
@@ -11,6 +11,9 @@ Domain Path: /languages
11
  */
12
 
13
  /*
 
 
 
14
  * 6.3.18 - 2016-09-15
15
  * Chinese support - when your language is set to Chinese (ZN_cn), the map will now load from maps.google.cn
16
  * Hebrew language code fixed when accessing the Google Maps API in Hebrew
@@ -284,8 +287,8 @@ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
284
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
285
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
286
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
287
- $wpgmza_version = "6.3.18";
288
- $wpgmza_p_version = "6.02";
289
  $wpgmza_t = "basic";
290
  define("WPGMAPS", $wpgmza_version);
291
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
@@ -1822,22 +1825,8 @@ function wpgmaps_user_javascript_basic() {
1822
  /* Chinese integration */
1823
  if ($wpgmza_locale == "zh_CN") { $wpgmza_suffix = ".cn"; } else { $wpgmza_suffix = ".com"; }
1824
 
1825
- if(isset($wpgmza_settings['wpgmza_settings_remove_api']) && $wpgmza_settings['wpgmza_settings_remove_api'] == "yes"){ } else {
1826
- if( get_option( 'wpgmza_google_maps_api_key' ) ){ ?>
1827
- <script type="text/javascript">
1828
- var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1829
- var wpgmza_api_key = '<?php echo trim(get_option( 'wpgmza_google_maps_api_key' )); ?>';
1830
- document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google<?php echo $wpgmza_suffix; ?>/maps/api/js?<?php echo $api_version_string; ?>key="+wpgmza_api_key+"&language=<?php echo $wpgmza_locale; ?>' type='text/javascript'%3E%3C/script%3E"));
1831
- </script>
1832
- <?php } else { ?>
1833
- <script type="text/javascript">
1834
- var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
1835
- document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google<?php echo $wpgmza_suffix; ?>/maps/api/js?<?php echo $api_version_string; ?>&language=<?php echo $wpgmza_locale; ?>&libraries=places' type='text/javascript'%3E%3C/script%3E"));
1836
- </script>
1837
- <?php }
1838
- }
1839
 
1840
- wp_enqueue_script('wpgmaps_core', plugins_url('/js/wpgmaps.min.js',__FILE__), array(), $wpgmza_version.'b' , false);
1841
  do_action("wpgooglemaps_basic_hook_user_js_after_core");
1842
 
1843
 
@@ -5978,27 +5967,29 @@ add_action('wp_footer', 'wpgmza_deregister_scripts',999);
5978
  add_action('wp_print_scripts', 'wpgmza_deregister_scripts',999);
5979
  function wpgmza_deregister_scripts() {
5980
 
5981
- global $short_code_active;
5982
- if ($short_code_active) {
5983
- $map_handle = '';
5984
- global $wp_scripts;
5985
- if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
5986
- foreach ( $wp_scripts->registered as $script) {
5987
- if (strpos($script->src, 'maps.google.com/maps/api/js') !== false || strpos($script->src, 'maps.googleapis.com/maps/api') !== false || strpos($script->src, 'maps.googleapis') !== false || strpos($script->src, 'maps.google') !== false) {
5988
- if (!isset($script->handle) || $script->handle == '') {
5989
- $script->handle = 'remove-this-map-call';
5990
- }
5991
- unset($script->src);
5992
- $map_handle = $script->handle;
5993
- if ($map_handle != '') {
5994
- $wp_scripts->remove( $map_handle );
5995
- $map_handle = '';
5996
- break;
5997
- }
5998
- }
5999
- }
6000
- }
6001
- }
 
 
6002
  }
6003
 
6004
  add_action('wp_ajax_track_usage', 'wpgmaps_usage_tracking_callback');
@@ -6173,4 +6164,48 @@ function wpgmza_deregister_styles() {
6173
  }
6174
  }
6175
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6176
  }
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.19
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  Text Domain: wp-google-maps
11
  */
12
 
13
  /*
14
+ * 6.3.19 - 2016-09-22
15
+ * Fixed a bug that caused some maps to not load markers on page load
16
+ *
17
  * 6.3.18 - 2016-09-15
18
  * Chinese support - when your language is set to Chinese (ZN_cn), the map will now load from maps.google.cn
19
  * Hebrew language code fixed when accessing the Google Maps API in Hebrew
287
  $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
288
  $wpgmza_tblname_categories = $wpdb->prefix. "wpgmza_categories";
289
  $wpgmza_tblname_category_maps = $wpdb->prefix. "wpgmza_category_maps";
290
+ $wpgmza_version = "6.3.19";
291
+ $wpgmza_p_version = "6.07";
292
  $wpgmza_t = "basic";
293
  define("WPGMAPS", $wpgmza_version);
294
  define("WPGMAPS_DIR",plugin_dir_url(__FILE__));
1825
  /* Chinese integration */
1826
  if ($wpgmza_locale == "zh_CN") { $wpgmza_suffix = ".cn"; } else { $wpgmza_suffix = ".com"; }
1827
 
1828
+ wp_enqueue_script('wpgmaps_core', plugins_url('/js/wpgmaps.min.js',__FILE__), array( 'wpgmza_api_call' ), $wpgmza_version.'b' , false);
 
 
 
 
 
 
 
 
 
 
 
 
 
1829
 
 
1830
  do_action("wpgooglemaps_basic_hook_user_js_after_core");
1831
 
1832
 
5967
  add_action('wp_print_scripts', 'wpgmza_deregister_scripts',999);
5968
  function wpgmza_deregister_scripts() {
5969
 
5970
+ global $short_code_active;
5971
+ if ($short_code_active) {
5972
+ $map_handle = '';
5973
+ global $wp_scripts;
5974
+ if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
5975
+ foreach ( $wp_scripts->registered as $script) {
5976
+ if ( $script->handle !== 'wpgmza_api_call' ){
5977
+ if ( strpos($script->src, 'maps.google.com/maps/api/js') !== false || strpos($script->src, 'maps.googleapis.com/maps/api') !== false || strpos($script->src, 'maps.googleapis') !== false || strpos($script->src, 'maps.google') !== false) {
5978
+ if (!isset($script->handle) || $script->handle == '') {
5979
+ $script->handle = 'remove-this-map-call';
5980
+ }
5981
+ unset($script->src);
5982
+ $map_handle = $script->handle;
5983
+ if ($map_handle != '') {
5984
+ $wp_scripts->remove( $map_handle );
5985
+ $map_handle = '';
5986
+ break;
5987
+ }
5988
+ }
5989
+ }
5990
+ }
5991
+ }
5992
+ }
5993
  }
5994
 
5995
  add_action('wp_ajax_track_usage', 'wpgmaps_usage_tracking_callback');
6164
  }
6165
  }
6166
  }
6167
+ }
6168
+
6169
+ if( !function_exists( 'wpgmaps_pro_activate' ) ){
6170
+ add_action( 'wp_enqueue_scripts', 'wpgmza_load_google_maps_api' );
6171
+ }
6172
+
6173
+ function wpgmza_load_google_maps_api(){
6174
+
6175
+ global $short_code_active;
6176
+
6177
+ if( $short_code_active ){
6178
+
6179
+ $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
6180
+
6181
+ if(isset($wpgmza_settings['wpgmza_settings_remove_api']) && $wpgmza_settings['wpgmza_settings_remove_api'] == "yes"){ } else {
6182
+
6183
+ $wpgmza_locale = get_locale();
6184
+
6185
+ $wpgmza_suffix = ".com";
6186
+ /* Hebrew correction */
6187
+ if ($wpgmza_locale == "he_IL") { $wpgmza_locale = "iw"; }
6188
+
6189
+ /* Chinese integration */
6190
+ if ($wpgmza_locale == "zh_CN") { $wpgmza_suffix = ".cn"; } else { $wpgmza_suffix = ".com"; }
6191
+
6192
+ $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
6193
+ if (isset($wpgmza_settings['wpgmza_api_version']) && $wpgmza_settings['wpgmza_api_version'] != "") {
6194
+ $api_version_string = "v=".$wpgmza_settings['wpgmza_api_version']."&";
6195
+ } else {
6196
+ $api_version_string = "v=3.exp&";
6197
+ }
6198
+
6199
+ $wpgmza_api_key = get_option( 'wpgmza_google_maps_api_key' );
6200
+
6201
+ if( $wpgmza_api_key ){
6202
+ wp_enqueue_script('wpgmza_api_call', 'http://maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'key='.$wpgmza_api_key.'&language='.$wpgmza_locale, array(), null );
6203
+ } else {
6204
+ wp_enqueue_script('wpgmza_api_call', '//maps.google'.$wpgmza_suffix.'/maps/api/js?'.$api_version_string.'language='.$wpgmza_locale, array(), null );
6205
+ }
6206
+
6207
+ }
6208
+
6209
+ }
6210
+
6211
  }