Flexible Map - Version 1.13.0

Version Description

bump version of Google Maps API to 3.30

=

Download this release

Release Info

Developer webaware
Plugin Icon 128x128 Flexible Map
Version 1.13.0
Comparing to
See all releases

Code changes from version 1.12.1 to 1.13.0

changelog.md CHANGED
@@ -2,6 +2,10 @@
2
 
3
  ## Changelog
4
 
 
 
 
 
5
  ### 1.12.1, 2016-11-18
6
 
7
  * changed: bump version of Google Maps API to 3.26
2
 
3
  ## Changelog
4
 
5
+ ### 1.13.0, 2018-01-15
6
+
7
+ * changed: bump version of Google Maps API to 3.30
8
+
9
  ### 1.12.1, 2016-11-18
10
 
11
  * changed: bump version of Google Maps API to 3.26
flexible-map.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Flexible Map
4
  Plugin URI: https://flexible-map.webaware.net.au/
5
  Description: Embed Google Maps shortcodes in pages and posts, either by centre coordinates or street address, or by URL to a Google Earth KML file. <a href="https://flexible-map.webaware.net.au/manual/getting-started/">Get started</a> with a simple shortcode. See the <a href="https://flexible-map.webaware.net.au/manual/attribute-reference/">complete attribute reference</a> for more details.
6
- Version: 1.12.1
7
  Author: WebAware
8
  Author URI: https://shop.webaware.com.au/
9
  Text Domain: wp-flexible-map
@@ -11,7 +11,7 @@ Domain Path: /languages/
11
  */
12
 
13
  /*
14
- copyright (c) 2011-2016 WebAware Pty Ltd (email : support@webaware.com.au)
15
 
16
  This program is free software; you can redistribute it and/or
17
  modify it under the terms of the GNU General Public License
@@ -37,7 +37,7 @@ define('FLXMAP_PLUGIN_FILE', __FILE__);
37
  define('FLXMAP_PLUGIN_ROOT', dirname(__FILE__) . '/');
38
  define('FLXMAP_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__));
39
  define('FLXMAP_PLUGIN_OPTIONS', 'flexible_map');
40
- define('FLXMAP_PLUGIN_VERSION', '1.12.1');
41
 
42
  // shortcode tags
43
  define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
3
  Plugin Name: Flexible Map
4
  Plugin URI: https://flexible-map.webaware.net.au/
5
  Description: Embed Google Maps shortcodes in pages and posts, either by centre coordinates or street address, or by URL to a Google Earth KML file. <a href="https://flexible-map.webaware.net.au/manual/getting-started/">Get started</a> with a simple shortcode. See the <a href="https://flexible-map.webaware.net.au/manual/attribute-reference/">complete attribute reference</a> for more details.
6
+ Version: 1.13.0
7
  Author: WebAware
8
  Author URI: https://shop.webaware.com.au/
9
  Text Domain: wp-flexible-map
11
  */
12
 
13
  /*
14
+ copyright (c) 2011-2018 WebAware Pty Ltd (email : support@webaware.com.au)
15
 
16
  This program is free software; you can redistribute it and/or
17
  modify it under the terms of the GNU General Public License
37
  define('FLXMAP_PLUGIN_ROOT', dirname(__FILE__) . '/');
38
  define('FLXMAP_PLUGIN_NAME', basename(dirname(__FILE__)) . '/' . basename(__FILE__));
39
  define('FLXMAP_PLUGIN_OPTIONS', 'flexible_map');
40
+ define('FLXMAP_PLUGIN_VERSION', '1.13.0');
41
 
42
  // shortcode tags
43
  define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
includes/class.FlxMapPlugin.php CHANGED
@@ -85,7 +85,7 @@ class FlxMapPlugin {
85
  public function enqueueScripts() {
86
  $options = get_option(FLXMAP_PLUGIN_OPTIONS, array());
87
 
88
- $args = array('v' => '3.26');
89
  if (!empty($options['apiKey'])) {
90
  $args['key'] = $options['apiKey'];
91
  }
85
  public function enqueueScripts() {
86
  $options = get_option(FLXMAP_PLUGIN_OPTIONS, array());
87
 
88
+ $args = array('v' => '3.30');
89
  if (!empty($options['apiKey'])) {
90
  $args['key'] = $options['apiKey'];
91
  }
js/flexible-map.js CHANGED
@@ -1,9 +1,9 @@
1
- /*!
2
  JavaScript for the WordPress plugin wp-flexible-map
3
  https://flexible-map.webaware.net.au/
4
  */
5
 
6
- function FlexibleMap() {
7
  "use strict";
8
 
9
  // instance-private members with accessors
@@ -316,7 +316,7 @@ FlexibleMap.prototype = (function() {
316
 
317
  return function(text) {
318
  // search for JavaScript and HTML special characters, convert to Unicode hex
319
- return text.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g, toUnicodeHex);
320
  };
321
 
322
  })();
@@ -358,7 +358,7 @@ FlexibleMap.prototype = (function() {
358
 
359
  if (buster) {
360
  buster = Math.floor(buster);
361
- url += (url.indexOf("?") > -1 ? "&" : "?") + "nocache=" + buster;
362
  }
363
  }
364
 
@@ -419,8 +419,7 @@ FlexibleMap.prototype = (function() {
419
  }
420
  else {
421
  // not found, so try simplified locale
422
- localeWanted = localeWanted.substr(0, 2);
423
- if (localeWanted in this.i18n) {
424
  this.localeActive = localeWanted;
425
  }
426
  else {
@@ -662,7 +661,7 @@ FlexibleMap.prototype = (function() {
662
  }
663
 
664
  geocoder.geocode({address: address, region: this.region}, function(results, status) {
665
- if (status == google.maps.GeocoderStatus.OK) {
666
  var location = results[0].geometry.location,
667
  centre = [ location.lat(), location.lng() ];
668
  self.showMarker(divID, centre, centre);
@@ -761,8 +760,9 @@ FlexibleMap.prototype = (function() {
761
  input, p, from;
762
 
763
  // remove all from panel
764
- while (!!(p = panel.lastChild))
765
  panel.removeChild(p);
 
766
 
767
  // populate form and add to panel
768
  p = document.createElement("p");
1
+ /*
2
  JavaScript for the WordPress plugin wp-flexible-map
3
  https://flexible-map.webaware.net.au/
4
  */
5
 
6
+ window.FlexibleMap = function() {
7
  "use strict";
8
 
9
  // instance-private members with accessors
316
 
317
  return function(text) {
318
  // search for JavaScript and HTML special characters, convert to Unicode hex
319
+ return text.replace(/[\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g, toUnicodeHex); // eslint-disable-line no-control-regex
320
  };
321
 
322
  })();
358
 
359
  if (buster) {
360
  buster = Math.floor(buster);
361
+ url += (url.indexOf("?") > -1 ? "&" : "?") + "nocache=" + buster; // eslint-disable-line no-param-reassign
362
  }
363
  }
364
 
419
  }
420
  else {
421
  // not found, so try simplified locale
422
+ if (localeWanted.substr(0, 2) in this.i18n) {
 
423
  this.localeActive = localeWanted;
424
  }
425
  else {
661
  }
662
 
663
  geocoder.geocode({address: address, region: this.region}, function(results, status) {
664
+ if (status === google.maps.GeocoderStatus.OK) {
665
  var location = results[0].geometry.location,
666
  centre = [ location.lat(), location.lng() ];
667
  self.showMarker(divID, centre, centre);
760
  input, p, from;
761
 
762
  // remove all from panel
763
+ for (p = panel.lastChild; p; p = panel.lastChild) {
764
  panel.removeChild(p);
765
+ }
766
 
767
  // populate form and add to panel
768
  p = document.createElement("p");
js/flexible-map.min.js CHANGED
@@ -1,5 +1,4 @@
1
- /*!
2
- JavaScript for the WordPress plugin wp-flexible-map
3
- https://flexible-map.webaware.net.au/
4
- */
5
- function FlexibleMap(){"use strict";var a,b,c,d,e,f,g=!1;this.getMap=function(){return a},this.getCenter=function(){return b},this.setCenter=function(c){b=c,a.setCenter(b)},this.setMarkerLocation=function(a){c=a},this.getMarkerLocation=function(){return c},this.setMarkerPoint=function(a){d=a},this.getMarkerPoint=function(){return d},this.setMarkerInfowin=function(a){e=a},this.getMarkerInfowin=function(){return e},this.getKmlLayer=function(){return f},this.redrawOnce=function(){g||(g=!0,this.redraw())},this.showMap=function(c,d){b=new google.maps.LatLng(d[0],d[1]);var e,f={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,"default":google.maps.ZoomControlStyle.DEFAULT},g=f.small;return this.zoomControlStyle in f&&(g=f[this.zoomControlStyle]),e={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:this.zoomControl,zoomControlOptions:{style:g},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:b,zoom:this.zoom},this.mapTypeIds&&(e.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}),a=new google.maps.Map(document.getElementById(c),e),this.mapTypeId in this.mapTypes&&a.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map),a},this.loadKmlMap=function(c){return f=new google.maps.KmlLayer({map:a,url:c}),google.maps.event.addListenerOnce(f,"defaultviewport_changed",function(){b=f.getDefaultViewport().getCenter()}),f},!this.localised&&"flxmap"in window&&this.localise(),this.mapTypeId=google.maps.MapTypeId.ROADMAP,this.mapTypeControl=!0,this.scaleControl=!1,this.panControl=!1,this.zoomControl=!0,this.zoomControlStyle="small",this.streetViewControl=!1,this.scrollwheel=!1,this.draggable=!0,this.dblclickZoom=!0,this.zoom=16,this.markerTitle="",this.markerDescription="",this.markerHTML="",this.markerLink="",this.markerLinkTarget="",this.markerLinkText=!1,this.markerIcon="",this.markerShowInfo=!0,this.markerDirections=!1,this.markerDirectionsShow=!1,this.markerDirectionsDefault="",this.markerAddress="",this.targetFix=!0,this.dirService=!1,this.dirRenderer=!1,this.dirDraggable=!1,this.dirSuppressMarkers=!1,this.dirShowSteps=!0,this.dirShowSearch=!0,this.dirTravelMode="driving",this.dirUnitSystem=void 0,this.region="",this.locale="en",this.localeActive=!1,this.kmlcache="none"}FlexibleMap.prototype=function(){"use strict";function a(a,b){var c,d,e,f=/^(\d+)\s*(minute|hour|day)s?$/.exec(b);if(f){switch(c=(new Date).getTime(),e=+f[1],f[2]){case"minute":5>e&&(e=5),d=c/(6e4*e);break;case"hour":d=c/(36e5*e);break;case"day":d=c/(864e5*e);break;default:d=!1}d&&(d=Math.floor(d),a+=(a.indexOf("?")>-1?"&":"?")+"nocache="+d)}return a}var b,c,d;document.addEventListener?(b=function(a,b,c){a.addEventListener(b,c,!1)},c=function(a){a.stopPropagation(),a.preventDefault()}):document.attachEvent&&(b=function(a,b,c){a.attachEvent("on"+b,function(){c.call(a,window.event)})},c=function(a){a.cancelBubble=!0,a.returnValue=0}),d="undefined"!=typeof MutationObserver?function(a,b){function c(a){var b=window.getComputedStyle(a);return"none"===b.display||"hidden"===b.visibility}var d,e=document.getElementById(b),f=e.parentNode;c(f)&&(d=new MutationObserver(function(b,d){c(f)||(a.redrawOnce(),d.disconnect())}),d.observe(f,{attributes:!0,attributeFilter:["style"]}))}:function(){};var e=function(){function a(a){var b=a.charCodeAt(0),c=b.toString(16);return 256>b?"\\x"+("00"+c).slice(-2):"\\u"+("0000"+c).slice(-4)}return function(b){return b.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,a)}}();return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:!1,localise:function(){var a,b;if("i18n"in flxmap&&(FlexibleMap.prototype.i18n=flxmap.i18n),"mapTypes"in flxmap){b=flxmap.mapTypes;for(a in b)b[a]._styled_map=new google.maps.StyledMapType(b[a].styles,b[a].options);FlexibleMap.prototype.mapTypes=b}FlexibleMap.prototype.localised=!0},setlocale:function(a){return this.locale=a,a in this.i18n?this.localeActive=a:(a=a.substr(0,2),this.localeActive=a in this.i18n?a:!1),this.localeActive},gettext:function(a){var b=this.localeActive;return b&&a in this.i18n[b]?this.i18n[b][a]:a},showKML:function(f,g,h){"undefined"!=typeof h&&(this.zoom=h);var i=this,j=document.getElementById(f),k=j.getAttribute("data-flxmap"),l=this.showMap(f,[0,0]),m=this.loadKmlMap(a(g,this.kmlcache));d(this,f),"undefined"!=typeof h&&google.maps.event.addListenerOnce(l,"zoom_changed",function(){l.setZoom(h),i.zoom=h}),(this.markerDirections||this.markerDirectionsShow)&&this.startDirService(l),google.maps.event.addListener(m,"click",function(a){var b=a.featureData;if(!b._flxmapOnce){if(b._flxmapOnce=!0,i.targetFix&&b.description){var c=/ target="_blank"/gi;b.description=b.description.replace(c,""),b.infoWindowHtml=b.infoWindowHtml.replace(c,"")}if(i.markerDirections){var d=a.latLng,f=d.lat()+","+d.lng()+",'"+e(b.name)+"',true",g='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+k+".showDirections("+f+'); return false;">'+i.gettext("Directions")+"</a>";b.infoWindowHtml=b.infoWindowHtml.replace(/<\/div><\/div>$/i,g+"</div></div>")}}}),window.opera&&this.markerDirections&&b(j,"click",function(a){a.target.getAttribute("data-flxmap-fix-opera")&&c(a)})},showMarker:function(a,e,f){var g=this.showMap(a,e),h=new google.maps.LatLng(f[0],f[1]),i=new google.maps.Marker({map:g,position:h,icon:this.markerIcon});if(this.setMarkerPoint(i),this.setMarkerLocation(h),d(this,a),this.markerTitle||(this.markerTitle=this.markerAddress),this.markerTitle||this.markerHTML||this.markerDescription||this.markerLink||this.markerDirections){var j,k,l,m,n,o,p=this,q=document.createElement("DIV");if(q.className="flxmap-infowin",n=document.createElement("DIV"),n.className="flxmap-marker-title",this.markerTitle&&(n.appendChild(document.createTextNode(this.markerTitle)),i.setTitle(this.markerTitle)),q.appendChild(n),this.markerHTML&&(n=document.createElement("DIV"),n.innerHTML=this.markerHTML,q.appendChild(n)),this.markerDescription||this.markerLink){if(n=document.createElement("DIV"),n.className="flxmap-marker-link",this.markerDescription){for(l=this.markerDescription.split("\n"),j=0,k=l.length;k>j;j++)j>0&&n.appendChild(document.createElement("BR")),n.appendChild(document.createTextNode(l[j]));this.markerLink&&n.appendChild(document.createElement("BR"))}this.markerLink&&(o=document.createElement("A"),o.href=this.markerLink,this.markerLinkTarget&&(o.target=this.markerLinkTarget),o.appendChild(document.createTextNode(this.markerLinkText||this.gettext("Click for details"))),n.appendChild(o)),q.appendChild(n)}this.markerDirections&&(n=document.createElement("DIV"),n.className="flxmap-directions-link",o=document.createElement("A"),o.href="#",o.dataLatitude=f[0],o.dataLongitude=f[1],b(o,"click",function(a){c(a),p.showDirections(this.dataLatitude,this.dataLongitude,!0)}),o.appendChild(document.createTextNode(this.gettext("Directions"))),n.appendChild(o),q.appendChild(n)),m=new google.maps.InfoWindow({content:q}),this.setMarkerInfowin(m),this.markerShowInfo&&google.maps.event.addListenerOnce(g,"tilesloaded",function(){m.open(g,i)}),google.maps.event.addListener(i,"click",function(){m.open(g,i)});var r=function(){p.updateGoogleLink()};google.maps.event.addListener(g,"idle",r),google.maps.event.addListener(g,"center_changed",r),google.maps.event.addListenerOnce(g,"tilesloaded",r)}(this.markerDirections||this.markerDirectionsShow)&&(this.startDirService(g),this.markerDirectionsShow&&this.showDirections(f[0],f[1],!1))},showAddress:function(a,b){var c=this,d=new google.maps.Geocoder;this.markerAddress=b,""===this.markerTitle&&(this.markerTitle=b),d.geocode({address:b,region:this.region},function(b,d){if(d==google.maps.GeocoderStatus.OK){var e=b[0].geometry.location,f=[e.lat(),e.lng()];c.showMarker(a,f,f)}else window.alert("Map address returns error: "+d)})},updateGoogleLink:function(){if("querySelectorAll"in document)try{for(var a=this.getMap().getDiv(),b=this.getMarkerLocation(),c=a.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),d=0,e=c.length,f=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+b.lat()+","+b.lng());e>d;d++)c[d].href+="&mrt=loc&iwloc=A&q="+f}catch(g){}},redraw:function(){var a=this.getMap(),b=this.getKmlLayer();if(google.maps.event.trigger(a,"resize"),b)a.fitBounds(b.getDefaultViewport());else{a.setCenter(this.getCenter()),a.setZoom(this.zoom);var c=this.getMarkerInfowin();c&&c.open(a,this.getMarkerPoint())}},startDirService:function(a){this.dirService||(this.dirService=new google.maps.DirectionsService),this.dirRenderer||(this.dirRenderer=new google.maps.DirectionsRenderer({map:a,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null}))},showDirections:function(a,d,e){function f(){for(var a,d,f,h=document.getElementById(i.markerDirectionsDiv),j=document.createElement("form");d=h.lastChild;)h.removeChild(d);d=document.createElement("p"),d.appendChild(document.createTextNode(i.gettext("From")+": ")),f=document.createElement("input"),f.type="text",f.name="from",f.value=i.markerDirectionsDefault,d.appendChild(f),a=document.createElement("input"),a.type="submit",a.value=i.gettext("Get directions"),d.appendChild(a),j.appendChild(d),h.appendChild(j),"undefined"==typeof j.elements.from&&(j.elements.from=f),e&&f.focus(),b(j,"submit",function(a){c(a);var b=this.elements.from.value;/\S/.test(b)&&g(b)})}function g(b){var c=""===i.markerAddress?new google.maps.LatLng(a,d):i.markerAddress,e={origin:b,destination:c};switch(i.region&&(e.region=i.region),i.dirTravelMode){case"bicycling":e.travelMode=google.maps.TravelMode.BICYCLING;break;case"driving":e.travelMode=google.maps.TravelMode.DRIVING;break;case"transit":e.travelMode=google.maps.TravelMode.TRANSIT;break;case"walking":e.travelMode=google.maps.TravelMode.WALKING}switch(i.dirUnitSystem){case"imperial":e.unitSystem=google.maps.UnitSystem.IMPERIAL;break;case"metric":e.unitSystem=google.maps.UnitSystem.METRIC}i.dirService.route(e,h)}function h(a,b){var c=google.maps.DirectionsStatus;switch(b){case c.OK:i.dirRenderer.setDirections(a);break;case c.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case c.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case c.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case c.INVALID_REQUEST:window.alert("Invalid directions request.");break;case c.NOT_FOUND:window.alert("Origin or destination was not found.");break;default:window.alert("A directions request could not be processed due to a server error. The request may succeed if you try again.")}}var i=this;this.markerDirectionsDiv&&this.dirShowSearch&&f(),this.markerDirectionsDefault&&g(this.markerDirectionsDefault)}}}();
1
+ // Flexible Map
2
+ // https://flexible-map.webaware.net.au/
3
+
4
+ window.FlexibleMap=function(){"use strict";var e,t,i,r,o,n,a=!1;this.getMap=function(){return e},this.getCenter=function(){return t},this.setCenter=function(i){t=i,e.setCenter(t)},this.setMarkerLocation=function(e){i=e},this.getMarkerLocation=function(){return i},this.setMarkerPoint=function(e){r=e},this.getMarkerPoint=function(){return r},this.setMarkerInfowin=function(e){o=e},this.getMarkerInfowin=function(){return o},this.getKmlLayer=function(){return n},this.redrawOnce=function(){a||(a=!0,this.redraw())},this.showMap=function(i,r){t=new google.maps.LatLng(r[0],r[1]);var o,n={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,default:google.maps.ZoomControlStyle.DEFAULT},a=n.small;return this.zoomControlStyle in n&&(a=n[this.zoomControlStyle]),o={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:this.zoomControl,zoomControlOptions:{style:a},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:t,zoom:this.zoom},this.mapTypeIds&&(o.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}),e=new google.maps.Map(document.getElementById(i),o),this.mapTypeId in this.mapTypes&&e.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map),e},this.loadKmlMap=function(i){return n=new google.maps.KmlLayer({map:e,url:i}),google.maps.event.addListenerOnce(n,"defaultviewport_changed",function(){t=n.getDefaultViewport().getCenter()}),n},!this.localised&&"flxmap"in window&&this.localise(),this.mapTypeId=google.maps.MapTypeId.ROADMAP,this.mapTypeControl=!0,this.scaleControl=!1,this.panControl=!1,this.zoomControl=!0,this.zoomControlStyle="small",this.streetViewControl=!1,this.scrollwheel=!1,this.draggable=!0,this.dblclickZoom=!0,this.zoom=16,this.markerTitle="",this.markerDescription="",this.markerHTML="",this.markerLink="",this.markerLinkTarget="",this.markerLinkText=!1,this.markerIcon="",this.markerShowInfo=!0,this.markerDirections=!1,this.markerDirectionsShow=!1,this.markerDirectionsDefault="",this.markerAddress="",this.targetFix=!0,this.dirService=!1,this.dirRenderer=!1,this.dirDraggable=!1,this.dirSuppressMarkers=!1,this.dirShowSteps=!0,this.dirShowSearch=!0,this.dirTravelMode="driving",this.dirUnitSystem=void 0,this.region="",this.locale="en",this.localeActive=!1,this.kmlcache="none"},FlexibleMap.prototype=function(){"use strict";var e,t,i;document.addEventListener?(e=function(e,t,i){e.addEventListener(t,i,!1)},t=function(e){e.stopPropagation(),e.preventDefault()}):document.attachEvent&&(e=function(e,t,i){e.attachEvent("on"+t,function(){i.call(e,window.event)})},t=function(e){e.cancelBubble=!0,e.returnValue=0}),i="undefined"!=typeof MutationObserver?function(e,t){var i=document.getElementById(t).parentNode;function r(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}r(i)&&new MutationObserver(function(t,o){r(i)||(e.redrawOnce(),o.disconnect())}).observe(i,{attributes:!0,attributeFilter:["style"]})}:function(){};var r=function(){function e(e){var t=e.charCodeAt(0),i=t.toString(16);return t<256?"\\x"+("00"+i).slice(-2):"\\u"+("0000"+i).slice(-4)}return function(t){return t.replace(/[\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,e)}}();return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:!1,localise:function(){var e,t;if("i18n"in flxmap&&(FlexibleMap.prototype.i18n=flxmap.i18n),"mapTypes"in flxmap){t=flxmap.mapTypes;for(e in t)t[e]._styled_map=new google.maps.StyledMapType(t[e].styles,t[e].options);FlexibleMap.prototype.mapTypes=t}FlexibleMap.prototype.localised=!0},setlocale:function(e){return this.locale=e,e in this.i18n?this.localeActive=e:e.substr(0,2)in this.i18n?this.localeActive=e:this.localeActive=!1,this.localeActive},gettext:function(e){var t=this.localeActive;return t&&e in this.i18n[t]?this.i18n[t][e]:e},showKML:function(o,n,a){void 0!==a&&(this.zoom=a);var s=this,l=document.getElementById(o),c=l.getAttribute("data-flxmap"),d=this.showMap(o,[0,0]),m=this.loadKmlMap(function(e,t){var i,r,o,n=/^(\d+)\s*(minute|hour|day)s?$/.exec(t);if(n){switch(i=(new Date).getTime(),o=+n[1],n[2]){case"minute":o<5&&(o=5),r=i/(6e4*o);break;case"hour":r=i/(36e5*o);break;case"day":r=i/(864e5*o);break;default:r=!1}r&&(r=Math.floor(r),e+=(e.indexOf("?")>-1?"&":"?")+"nocache="+r)}return e}(n,this.kmlcache));i(this,o),void 0!==a&&google.maps.event.addListenerOnce(d,"zoom_changed",function(){d.setZoom(a),s.zoom=a}),(this.markerDirections||this.markerDirectionsShow)&&this.startDirService(d),google.maps.event.addListener(m,"click",function(e){var t=e.featureData;if(!t._flxmapOnce){if(t._flxmapOnce=!0,s.targetFix&&t.description){var i=/ target="_blank"/gi;t.description=t.description.replace(i,""),t.infoWindowHtml=t.infoWindowHtml.replace(i,"")}if(s.markerDirections){var o=e.latLng,n=o.lat()+","+o.lng()+",'"+r(t.name)+"',true",a='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+c+".showDirections("+n+'); return false;">'+s.gettext("Directions")+"</a>";t.infoWindowHtml=t.infoWindowHtml.replace(/<\/div><\/div>$/i,a+"</div></div>")}}}),window.opera&&this.markerDirections&&e(l,"click",function(e){e.target.getAttribute("data-flxmap-fix-opera")&&t(e)})},showMarker:function(r,o,n){var a=this.showMap(r,o),s=new google.maps.LatLng(n[0],n[1]),l=new google.maps.Marker({map:a,position:s,icon:this.markerIcon});if(this.setMarkerPoint(l),this.setMarkerLocation(s),i(this,r),this.markerTitle||(this.markerTitle=this.markerAddress),this.markerTitle||this.markerHTML||this.markerDescription||this.markerLink||this.markerDirections){var c,d,m,h,p,u,g=this,f=document.createElement("DIV");if(f.className="flxmap-infowin",(p=document.createElement("DIV")).className="flxmap-marker-title",this.markerTitle&&(p.appendChild(document.createTextNode(this.markerTitle)),l.setTitle(this.markerTitle)),f.appendChild(p),this.markerHTML&&((p=document.createElement("DIV")).innerHTML=this.markerHTML,f.appendChild(p)),this.markerDescription||this.markerLink){if((p=document.createElement("DIV")).className="flxmap-marker-link",this.markerDescription){for(c=0,d=(m=this.markerDescription.split("\n")).length;c<d;c++)c>0&&p.appendChild(document.createElement("BR")),p.appendChild(document.createTextNode(m[c]));this.markerLink&&p.appendChild(document.createElement("BR"))}this.markerLink&&((u=document.createElement("A")).href=this.markerLink,this.markerLinkTarget&&(u.target=this.markerLinkTarget),u.appendChild(document.createTextNode(this.markerLinkText||this.gettext("Click for details"))),p.appendChild(u)),f.appendChild(p)}this.markerDirections&&((p=document.createElement("DIV")).className="flxmap-directions-link",(u=document.createElement("A")).href="#",u.dataLatitude=n[0],u.dataLongitude=n[1],e(u,"click",function(e){t(e),g.showDirections(this.dataLatitude,this.dataLongitude,!0)}),u.appendChild(document.createTextNode(this.gettext("Directions"))),p.appendChild(u),f.appendChild(p)),h=new google.maps.InfoWindow({content:f}),this.setMarkerInfowin(h),this.markerShowInfo&&google.maps.event.addListenerOnce(a,"tilesloaded",function(){h.open(a,l)}),google.maps.event.addListener(l,"click",function(){h.open(a,l)});var k=function(){g.updateGoogleLink()};google.maps.event.addListener(a,"idle",k),google.maps.event.addListener(a,"center_changed",k),google.maps.event.addListenerOnce(a,"tilesloaded",k)}(this.markerDirections||this.markerDirectionsShow)&&(this.startDirService(a),this.markerDirectionsShow&&this.showDirections(n[0],n[1],!1))},showAddress:function(e,t){var i=this,r=new google.maps.Geocoder;this.markerAddress=t,""===this.markerTitle&&(this.markerTitle=t),r.geocode({address:t,region:this.region},function(t,r){if(r===google.maps.GeocoderStatus.OK){var o=t[0].geometry.location,n=[o.lat(),o.lng()];i.showMarker(e,n,n)}else window.alert("Map address returns error: "+r)})},updateGoogleLink:function(){if("querySelectorAll"in document)try{for(var e=this.getMap().getDiv(),t=this.getMarkerLocation(),i=e.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),r=0,o=i.length,n=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+t.lat()+","+t.lng());r<o;r++)i[r].href+="&mrt=loc&iwloc=A&q="+n}catch(e){}},redraw:function(){var e=this.getMap(),t=this.getKmlLayer();if(google.maps.event.trigger(e,"resize"),t)e.fitBounds(t.getDefaultViewport());else{e.setCenter(this.getCenter()),e.setZoom(this.zoom);var i=this.getMarkerInfowin();i&&i.open(e,this.getMarkerPoint())}},startDirService:function(e){this.dirService||(this.dirService=new google.maps.DirectionsService),this.dirRenderer||(this.dirRenderer=new google.maps.DirectionsRenderer({map:e,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null}))},showDirections:function(i,r,o){var n=this;function a(e){var t={origin:e,destination:""===n.markerAddress?new google.maps.LatLng(i,r):n.markerAddress};switch(n.region&&(t.region=n.region),n.dirTravelMode){case"bicycling":t.travelMode=google.maps.TravelMode.BICYCLING;break;case"driving":t.travelMode=google.maps.TravelMode.DRIVING;break;case"transit":t.travelMode=google.maps.TravelMode.TRANSIT;break;case"walking":t.travelMode=google.maps.TravelMode.WALKING}switch(n.dirUnitSystem){case"imperial":t.unitSystem=google.maps.UnitSystem.IMPERIAL;break;case"metric":t.unitSystem=google.maps.UnitSystem.METRIC}n.dirService.route(t,s)}function s(e,t){var i=google.maps.DirectionsStatus;switch(t){case i.OK:n.dirRenderer.setDirections(e);break;case i.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case i.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case i.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case i.INVALID_REQUEST:window.alert("Invalid directions request.");break;case i.NOT_FOUND:window.alert("Origin or destination was not found.");break;default:window.alert("A directions request could not be processed due to a server error. The request may succeed if you try again.")}}this.markerDirectionsDiv&&this.dirShowSearch&&function(){var i,r,s,l=document.getElementById(n.markerDirectionsDiv),c=document.createElement("form");for(r=l.lastChild;r;r=l.lastChild)l.removeChild(r);(r=document.createElement("p")).appendChild(document.createTextNode(n.gettext("From")+": ")),(s=document.createElement("input")).type="text",s.name="from",s.value=n.markerDirectionsDefault,r.appendChild(s),(i=document.createElement("input")).type="submit",i.value=n.gettext("Get directions"),r.appendChild(i),c.appendChild(r),l.appendChild(c),void 0===c.elements.from&&(c.elements.from=s),o&&s.focus(),e(c,"submit",function(e){t(e);var i=this.elements.from.value;/\S/.test(i)&&a(i)})}(),this.markerDirectionsDefault&&a(this.markerDirectionsDefault)}}}();
 
readme.txt CHANGED
@@ -4,10 +4,11 @@ Plugin Name: Flexible Map
4
  Plugin URI: https://flexible-map.webaware.net.au/
5
  Author URI: https://shop.webaware.com.au/
6
  Donate link: https://shop.webaware.com.au/donations/?donation_for=Flexible+Map
7
- Tags: google, map, maps, google maps, shortcode, google maps shortcode, kml
8
  Requires at least: 4.0
9
- Tested up to: 4.7
10
- Stable tag: 1.12.1
 
11
  License: GPLv2 or later
12
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
13
 
@@ -46,8 +47,9 @@ Thanks for sponsoring new features on WP Flexible Maps!
46
 
47
  Many thanks to the generous efforts of our translators:
48
 
49
- * Czech (cs) -- [caslavak](https://profiles.wordpress.org/caslavak/)
50
  * Dutch (nl) -- [Ivan Beemster](http://www.lijndiensten.com/) and the [Dutch translation team](https://translate.wordpress.org/locale/nl/default/wp-plugins/wp-flexible-map)
 
51
  * French (fr) -- [mister klucha](https://profiles.wordpress.org/mister-klucha/) and the [French translation team](https://translate.wordpress.org/locale/fr/default/wp-plugins/wp-flexible-map)
52
  * German (de) -- [Carib Design](http://www.caribdesign.com/) and the [German translation team](https://translate.wordpress.org/locale/de/default/wp-plugins/wp-flexible-map)
53
  * Greek (el) -- [Pantelis Orfanos](https://profiles.wordpress.org/ironwiller/)
@@ -106,7 +108,7 @@ Either the center or the address paramater is required. If you provide both, the
106
  * **kmlcache**: ask Google Maps to use a new map instead of cached map, specified in minutes (90 minutes), hours (2 hours), days (1 day), or "none"; minimum 5 minutes, default "none"
107
 
108
  *Sample*:
109
- `[flexiblemap src="http://webaware.com.au/maps/example-toronto.kml" width="100%" height="400px"]`
110
 
111
  = Attributes for all maps =
112
 
@@ -193,8 +195,8 @@ Google Maps API caches the KML file, so it can take a while for your new changes
193
 
194
  If your map is auto-generated or changes frequently, add the `kmlcache` attribute to ask Google to fetch a new copy periodically. You can specify the interval in minutes (e.g. "90 minutes"), hours (e.g. "2 hours"), or days (e.g. "1 day"). The minimum interval is 5 minutes.
195
 
196
- `[flexiblemap src="http://webaware.com.au/maps/example-toronto.kml?v=2"]
197
- [flexiblemap src="http://webaware.com.au/maps/example-toronto.kml" kmlcache="8 hours"]`
198
 
199
  = What parts of KML are supported? =
200
 
@@ -310,24 +312,20 @@ Either turn off CloudFlare Rocketscript :) or install the [Flxmap No Rocketscrip
310
 
311
  1. `[flexiblemap center="-32.918657,151.797894" title="Nobby's Head" zoom="14" width="100%" height="400px" directions="true" maptype="satellite"]`
312
  2. `[flexiblemap address="116 Beaumont Street Hamilton NSW Australia" title="Raj's Corner" description="SWMBO's favourite Indian diner" width="100%" height="400px" directions="true"]`
313
- 3. `[flexiblemap src="http://webaware.com.au/maps/example-toronto.kml" width="100%" height="400px" maptype="satellite"]`
314
  4. `[flexiblemap center="-34.916721,138.828878" width="100%" height="400px" title="Adelaide Hills" directions="true" showdirections="true" directionsfrom="Adelaide" region="au"]`
315
  5. Setting screen with API key field
316
 
317
  == Upgrade Notice ==
318
 
319
- = 1.12.1 =
320
 
321
- bump version of Google Maps API to 3.26
322
 
323
  == Changelog ==
324
 
325
  The full changelog can be found [on GitHub](https://github.com/webaware/flexible-map/blob/master/changelog.md). Recent entries:
326
 
327
- ### 1.12.1, 2016-11-18
328
 
329
- * changed: bump version of Google Maps API to 3.26
330
-
331
- ### 1.12.0, 2016-06-27
332
-
333
- * added: support for [Google Maps API key](https://developers.google.com/maps/documentation/javascript/), required [since 2016-06-22 for new websites](https://googlegeodevelopers.blogspot.com.au/2016/06/building-for-scale-updates-to-google.html).
4
  Plugin URI: https://flexible-map.webaware.net.au/
5
  Author URI: https://shop.webaware.com.au/
6
  Donate link: https://shop.webaware.com.au/donations/?donation_for=Flexible+Map
7
+ Tags: google, map, maps, google maps, kml
8
  Requires at least: 4.0
9
+ Tested up to: 4.9
10
+ Stable tag: 1.13.0
11
+ Requires PHP: 5.3
12
  License: GPLv2 or later
13
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
14
 
47
 
48
  Many thanks to the generous efforts of our translators:
49
 
50
+ * Czech (cs) -- [caslavak](https://profiles.wordpress.org/caslavak/) and the [Czech translation team](https://translate.wordpress.org/locale/cs/default/wp-plugins/wp-flexible-map)
51
  * Dutch (nl) -- [Ivan Beemster](http://www.lijndiensten.com/) and the [Dutch translation team](https://translate.wordpress.org/locale/nl/default/wp-plugins/wp-flexible-map)
52
+ * English (en_CA) -- [the English (Canadian) translation team](https://translate.wordpress.org/locale/en-ca/default/wp-plugins/wp-flexible-map)
53
  * French (fr) -- [mister klucha](https://profiles.wordpress.org/mister-klucha/) and the [French translation team](https://translate.wordpress.org/locale/fr/default/wp-plugins/wp-flexible-map)
54
  * German (de) -- [Carib Design](http://www.caribdesign.com/) and the [German translation team](https://translate.wordpress.org/locale/de/default/wp-plugins/wp-flexible-map)
55
  * Greek (el) -- [Pantelis Orfanos](https://profiles.wordpress.org/ironwiller/)
108
  * **kmlcache**: ask Google Maps to use a new map instead of cached map, specified in minutes (90 minutes), hours (2 hours), days (1 day), or "none"; minimum 5 minutes, default "none"
109
 
110
  *Sample*:
111
+ `[flexiblemap src="https://webaware.com.au/maps/example-toronto.kml" width="100%" height="400px"]`
112
 
113
  = Attributes for all maps =
114
 
195
 
196
  If your map is auto-generated or changes frequently, add the `kmlcache` attribute to ask Google to fetch a new copy periodically. You can specify the interval in minutes (e.g. "90 minutes"), hours (e.g. "2 hours"), or days (e.g. "1 day"). The minimum interval is 5 minutes.
197
 
198
+ `[flexiblemap src="https://webaware.com.au/maps/example-toronto.kml?v=2"]
199
+ [flexiblemap src="https://webaware.com.au/maps/example-toronto.kml" kmlcache="8 hours"]`
200
 
201
  = What parts of KML are supported? =
202
 
312
 
313
  1. `[flexiblemap center="-32.918657,151.797894" title="Nobby's Head" zoom="14" width="100%" height="400px" directions="true" maptype="satellite"]`
314
  2. `[flexiblemap address="116 Beaumont Street Hamilton NSW Australia" title="Raj's Corner" description="SWMBO's favourite Indian diner" width="100%" height="400px" directions="true"]`
315
+ 3. `[flexiblemap src="https://webaware.com.au/maps/example-toronto.kml" width="100%" height="400px" maptype="satellite"]`
316
  4. `[flexiblemap center="-34.916721,138.828878" width="100%" height="400px" title="Adelaide Hills" directions="true" showdirections="true" directionsfrom="Adelaide" region="au"]`
317
  5. Setting screen with API key field
318
 
319
  == Upgrade Notice ==
320
 
321
+ = 1.13.0 =
322
 
323
+ bump version of Google Maps API to 3.30
324
 
325
  == Changelog ==
326
 
327
  The full changelog can be found [on GitHub](https://github.com/webaware/flexible-map/blob/master/changelog.md). Recent entries:
328
 
329
+ ### 1.13.0, 2018-01-15
330
 
331
+ * changed: bump version of Google Maps API to 3.30