Version Description
[2014-12-29] = * fixed: zoom control styling / hiding was broken in v1.9.0
Download this release
Release Info
Developer | webaware |
Plugin | Flexible Map |
Version | 1.9.1 |
Comparing to | |
See all releases |
Code changes from version 1.9.0 to 1.9.1
- flexible-map.php +2 -2
- js/flexible-map.js +8 -8
- js/flexible-map.min.js +1 -1
- readme.txt +5 -2
flexible-map.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Flexible Map
|
4 |
Plugin URI: http://flexible-map.webaware.net.au/
|
5 |
Description: Embed Google Maps in pages and posts, either by centre coodinates or street address, or by URL to a Google Earth KML file.
|
6 |
-
Version: 1.9.
|
7 |
Author: WebAware
|
8 |
Author URI: http://webaware.com.au/
|
9 |
Text Domain: flexible-map
|
@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
|
|
36 |
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_VERSION', '1.9.
|
40 |
|
41 |
// shortcode tags
|
42 |
define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
|
3 |
Plugin Name: Flexible Map
|
4 |
Plugin URI: http://flexible-map.webaware.net.au/
|
5 |
Description: Embed Google Maps in pages and posts, either by centre coodinates or street address, or by URL to a Google Earth KML file.
|
6 |
+
Version: 1.9.1
|
7 |
Author: WebAware
|
8 |
Author URI: http://webaware.com.au/
|
9 |
Text Domain: flexible-map
|
36 |
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_VERSION', '1.9.1');
|
40 |
|
41 |
// shortcode tags
|
42 |
define('FLXMAP_PLUGIN_TAG_MAP', 'flexiblemap');
|
js/flexible-map.js
CHANGED
@@ -116,12 +116,17 @@ function FlexibleMap() {
|
|
116 |
centre = new google.maps.LatLng(latLng[0], latLng[1]);
|
117 |
|
118 |
var mapOptions,
|
119 |
-
zoomControlStyle,
|
120 |
zoomControlStyles = {
|
121 |
"small" : google.maps.ZoomControlStyle.SMALL,
|
122 |
"large" : google.maps.ZoomControlStyle.LARGE,
|
123 |
"default" : google.maps.ZoomControlStyle.DEFAULT
|
124 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
// basic options
|
127 |
mapOptions = {
|
@@ -130,7 +135,7 @@ function FlexibleMap() {
|
|
130 |
scaleControl: this.scaleControl,
|
131 |
panControl: this.panControl,
|
132 |
streetViewControl: this.streetViewControl,
|
133 |
-
zoomControl:
|
134 |
zoomControlOptions: { style: zoomControlStyle },
|
135 |
draggable: this.draggable,
|
136 |
disableDoubleClickZoom: !this.dblclickZoom,
|
@@ -139,11 +144,6 @@ function FlexibleMap() {
|
|
139 |
zoom: this.zoom
|
140 |
};
|
141 |
|
142 |
-
// style the zoom control
|
143 |
-
if (this.zoomControlStyle in zoomControlStyles) {
|
144 |
-
mapOptions.zoomControlStyle = zoomControlStyles[this.zoomControlStyle];
|
145 |
-
}
|
146 |
-
|
147 |
// select which map types for map type control, if specified as comma-separated list of map type IDs
|
148 |
if (this.mapTypeIds) {
|
149 |
mapOptions.mapTypeControlOptions = {
|
116 |
centre = new google.maps.LatLng(latLng[0], latLng[1]);
|
117 |
|
118 |
var mapOptions,
|
|
|
119 |
zoomControlStyles = {
|
120 |
"small" : google.maps.ZoomControlStyle.SMALL,
|
121 |
"large" : google.maps.ZoomControlStyle.LARGE,
|
122 |
"default" : google.maps.ZoomControlStyle.DEFAULT
|
123 |
+
},
|
124 |
+
zoomControlStyle = zoomControlStyles.small;
|
125 |
+
|
126 |
+
// style the zoom control
|
127 |
+
if (this.zoomControlStyle in zoomControlStyles) {
|
128 |
+
zoomControlStyle = zoomControlStyles[this.zoomControlStyle];
|
129 |
+
}
|
130 |
|
131 |
// basic options
|
132 |
mapOptions = {
|
135 |
scaleControl: this.scaleControl,
|
136 |
panControl: this.panControl,
|
137 |
streetViewControl: this.streetViewControl,
|
138 |
+
zoomControl: this.zoomControl,
|
139 |
zoomControlOptions: { style: zoomControlStyle },
|
140 |
draggable: this.draggable,
|
141 |
disableDoubleClickZoom: !this.dblclickZoom,
|
144 |
zoom: this.zoom
|
145 |
};
|
146 |
|
|
|
|
|
|
|
|
|
|
|
147 |
// select which map types for map type control, if specified as comma-separated list of map type IDs
|
148 |
if (this.mapTypeIds) {
|
149 |
mapOptions.mapTypeControlOptions = {
|
js/flexible-map.min.js
CHANGED
@@ -2,4 +2,4 @@
|
|
2 |
JavaScript for the WordPress plugin wp-flexible-map
|
3 |
copyright (c) 2011-2014 WebAware Pty Ltd, released under LGPL v2.1
|
4 |
*/
|
5 |
-
;function FlexibleMap(){var f,d,b,g,a,e,c=false;this.getMap=function(){return f};this.getCenter=function(){return d};this.setCenter=function(h){d=h;f.setCenter(d)};this.setMarkerLocation=function(h){b=h};this.getMarkerLocation=function(){return b};this.setMarkerPoint=function(h){g=h};this.getMarkerPoint=function(){return g};this.setMarkerInfowin=function(h){a=h};this.getMarkerInfowin=function(){return a};this.getKmlLayer=function(){return e};this.redrawOnce=function(){if(!c){c=true;this.redraw()}};this.showMap=function(h,k){d=new google.maps.LatLng(k[0],k[1]);var i,l,j={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,"default":google.maps.ZoomControlStyle.DEFAULT};i={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:j.small,zoomControlOptions:{style:l},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:d,zoom:this.zoom};if(this.zoomControlStyle in j){i.zoomControlStyle=j[this.zoomControlStyle]}if(this.mapTypeIds){i.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}}f=new google.maps.Map(document.getElementById(h),i);if(this.mapTypeId in this.mapTypes){f.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map)}return f};this.loadKmlMap=function(h){e=new google.maps.KmlLayer({map:f,url:h});google.maps.event.addListenerOnce(e,"defaultviewport_changed",function(){d=e.getDefaultViewport().getCenter()});return e};if(!this.localised&&"flxmap" in window){this.localise()}this.mapTypeId=google.maps.MapTypeId.ROADMAP;this.mapTypeControl=true;this.scaleControl=false;this.panControl=false;this.zoomControl=true;this.zoomControlStyle="small";this.streetViewControl=false;this.scrollwheel=false;this.draggable=true;this.dblclickZoom=true;this.zoom=16;this.markerTitle="";this.markerDescription="";this.markerHTML="";this.markerLink="";this.markerIcon="";this.markerShowInfo=true;this.markerDirections=false;this.markerDirectionsShow=false;this.markerDirectionsDefault="";this.markerAddress="";this.targetFix=true;this.dirService=false;this.dirRenderer=false;this.dirDraggable=false;this.dirSuppressMarkers=false;this.dirShowSteps=true;this.dirShowSearch=true;this.region="";this.locale="en";this.localeActive=false;this.kmlcache="none"}FlexibleMap.prototype=(function(){var d,b,e;if(document.addEventListener){d=function(g,f,h){g.addEventListener(f,h,false)};b=function(f){f.stopPropagation();f.preventDefault()}}else{if(document.attachEvent){d=function(f,g,h){f.attachEvent("on"+g,function(){h.call(f,window.event)})};b=function(f){f.cancelBubble=true;f.returnValue=0}}}if(typeof MutationObserver!=="undefined"){e=function(k,f){var i=document.getElementById(f),g=i.parentNode,h;function j(l){var m=window.getComputedStyle(l);return m.display==="none"}if(j(g)){h=new MutationObserver(function(l,m){if(!j(g)){k.redrawOnce();m.disconnect()}});h.observe(g,{attributes:true,attributeFilter:["style"]})}}}else{e=function(){}}var a=(function(){function f(h){var i=h.charCodeAt(0),g=i.toString(16);if(i<256){return"\\x"+("00"+g).slice(-2)}return"\\u"+("0000"+g).slice(-4)}return function(g){return g.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,f)}})();function c(g,j){var f,h,k,i=/^(\d+)\s*(minute|hour|day)s?$/.exec(j);if(i){f=(new Date()).getTime();k=+i[1];switch(i[2]){case"minute":if(k<5){k=5}h=f/(60000*k);break;case"hour":h=f/(3600000*k);break;case"day":h=f/(86400000*k);break;default:h=false;break}if(h){h=Math.floor(h);g+=(g.indexOf("?")>-1?"&":"?")+"nocache="+h}}return g}return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:false,localise:function(){var g,f;if("i18n" in flxmap){FlexibleMap.prototype.i18n=flxmap.i18n}if("mapTypes" in flxmap){f=flxmap.mapTypes;for(g in f){f[g]._styled_map=new google.maps.StyledMapType(f[g].styles,f[g].options)}FlexibleMap.prototype.mapTypes=f}FlexibleMap.prototype.localised=true},setlocale:function(f){this.locale=f;if(f in this.i18n){this.localeActive=f}else{f=f.substr(0,2);if(f in this.i18n){this.localeActive=f}else{this.localeActive=false}}return this.localeActive},gettext:function(g){var f=this.localeActive;if(f&&g in this.i18n[f]){return this.i18n[f][g]}return g},showKML:function(f,i,j){if(typeof j!="undefined"){this.zoom=j}var h=this,g=document.getElementById(f),m=g.getAttribute("data-flxmap"),l=this.showMap(f,[0,0]),k=this.loadKmlMap(c(i,this.kmlcache));e(this,f);if(typeof j!="undefined"){google.maps.event.addListenerOnce(l,"zoom_changed",function(){l.setZoom(j);h.zoom=j})}if(this.markerDirections||this.markerDirectionsShow){this.startDirService(l)}google.maps.event.addListener(k,"click",function(s){var q=s.featureData;if(!q._flxmapOnce){q._flxmapOnce=true;if(h.targetFix){var p=/ target="_blank"/ig;q.description=q.description.replace(p,"");q.infoWindowHtml=q.infoWindowHtml.replace(p,"")}if(h.markerDirections){var o=s.latLng,r=o.lat()+","+o.lng()+",'"+a(q.name)+"',true",n='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+m+".showDirections("+r+'); return false;">'+h.gettext("Directions")+"</a>";q.infoWindowHtml=q.infoWindowHtml.replace(/<\/div><\/div>$/i,n+"</div></div>")}}});if(window.opera&&this.markerDirections){d(g,"click",function(n){if(n.target.getAttribute("data-flxmap-fix-opera")){b(n)}})}},showMarker:function(k,j,o){var h=this.showMap(k,j),f=new google.maps.LatLng(o[0],o[1]),s=new google.maps.Marker({map:h,position:f,icon:this.markerIcon});this.setMarkerPoint(s);this.setMarkerLocation(f);e(this,k);if(!this.markerTitle){this.markerTitle=this.markerAddress}if(this.markerTitle){var n,p,u,l,m,r,t=this,g=document.createElement("DIV");g.className="flxmap-infowin";s.setTitle(this.markerTitle);m=document.createElement("DIV");m.className="flxmap-marker-title";m.appendChild(document.createTextNode(this.markerTitle));g.appendChild(m);if(this.markerHTML){m=document.createElement("DIV");m.innerHTML=this.markerHTML;g.appendChild(m)}if(this.markerDescription||this.markerLink){m=document.createElement("DIV");m.className="flxmap-marker-link";if(this.markerDescription){u=this.markerDescription.split("\n");for(n=0,p=u.length;n<p;n++){if(n>0){m.appendChild(document.createElement("BR"))}m.appendChild(document.createTextNode(u[n]))}if(this.markerLink){m.appendChild(document.createElement("BR"))}}if(this.markerLink){r=document.createElement("A");r.href=this.markerLink;r.appendChild(document.createTextNode(this.gettext("Click for details")));m.appendChild(r)}g.appendChild(m)}if(this.markerDirections){m=document.createElement("DIV");m.className="flxmap-directions-link";r=document.createElement("A");r.href="#";r.dataLatitude=o[0];r.dataLongitude=o[1];r.dataTitle=this.markerTitle;d(r,"click",function(i){b(i);t.showDirections(this.dataLatitude,this.dataLongitude,this.dataTitle,true)});r.appendChild(document.createTextNode(this.gettext("Directions")));m.appendChild(r);g.appendChild(m)}if(this.markerDirections||this.markerDirectionsShow){this.startDirService(h);if(this.markerDirectionsShow){this.showDirections(o[0],o[1],this.markerTitle,false)}}l=new google.maps.InfoWindow({content:g});this.setMarkerInfowin(l);if(this.markerShowInfo){google.maps.event.addListenerOnce(h,"tilesloaded",function(){l.open(h,s)})}google.maps.event.addListener(s,"click",function(){l.open(h,s)});var q=function(){t.updateGoogleLink()};google.maps.event.addListener(h,"idle",q);google.maps.event.addListener(h,"center_changed",q);google.maps.event.addListenerOnce(h,"tilesloaded",q)}},showAddress:function(f,g){var h=this,i=new google.maps.Geocoder();this.markerAddress=g;if(this.markerTitle===""){this.markerTitle=g}i.geocode({address:g,region:this.region},function(l,k){if(k==google.maps.GeocoderStatus.OK){var j=l[0].geometry.location,m=[j.lat(),j.lng()];h.showMarker(f,m,m)}else{window.alert("Map address returns error: "+k)}})},updateGoogleLink:function(){if("querySelectorAll" in document){try{var m=this.getMap().getDiv(),g=this.getMarkerLocation(),j=m.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),h=0,f=j.length,k=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+g.lat()+","+g.lng());for(;h<f;h++){j[h].href+="&mrt=loc&iwloc=A&q="+k}}catch(l){}}},redraw:function(){var h=this.getMap(),g=this.getKmlLayer();google.maps.event.trigger(h,"resize");if(g){h.fitBounds(g.getDefaultViewport())}else{h.setCenter(this.getCenter());h.setZoom(this.zoom);var f=this.getMarkerInfowin();if(f){f.open(h,this.getMarkerPoint())}}},startDirService:function(f){if(!this.dirService){this.dirService=new google.maps.DirectionsService()}if(!this.dirRenderer){this.dirRenderer=new google.maps.DirectionsRenderer({map:f,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null})}},showDirections:function(m,i,l,f){var g=this;function k(){var n=document.getElementById(g.markerDirectionsDiv),q=document.createElement("form"),o,r,s;while(!!(r=n.lastChild)){n.removeChild(r)}r=document.createElement("p");r.appendChild(document.createTextNode(g.gettext("From")+": "));s=document.createElement("input");s.type="text";s.name="from";s.value=g.markerDirectionsDefault;r.appendChild(s);o=document.createElement("input");o.type="submit";o.value=g.gettext("Get directions");r.appendChild(o);q.appendChild(r);n.appendChild(q);if(typeof q.elements.from=="undefined"){q.elements.from=s}if(f){s.focus()}d(q,"submit",function(p){b(p);var t=this.elements.from.value;if(/\S/.test(t)){j(t)}})}function j(p){var n=(g.markerAddress==="")?new google.maps.LatLng(m,i):g.markerAddress,o={origin:p,region:g.region||"",destination:n,travelMode:google.maps.DirectionsTravelMode.DRIVING};g.dirService.route(o,h)}function h(p,n){var o=google.maps.DirectionsStatus;switch(n){case o.OK:g.dirRenderer.setDirections(p);break;case o.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case o.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case o.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case o.INVALID_REQUEST:window.alert("Invalid directions request.");break;case o.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.");break}}if(this.markerDirectionsDiv&&this.dirShowSearch){k()}if(this.markerDirectionsDefault){j(this.markerDirectionsDefault)}}}})();
|
2 |
JavaScript for the WordPress plugin wp-flexible-map
|
3 |
copyright (c) 2011-2014 WebAware Pty Ltd, released under LGPL v2.1
|
4 |
*/
|
5 |
+
;function FlexibleMap(){var f,d,b,g,a,e,c=false;this.getMap=function(){return f};this.getCenter=function(){return d};this.setCenter=function(h){d=h;f.setCenter(d)};this.setMarkerLocation=function(h){b=h};this.getMarkerLocation=function(){return b};this.setMarkerPoint=function(h){g=h};this.getMarkerPoint=function(){return g};this.setMarkerInfowin=function(h){a=h};this.getMarkerInfowin=function(){return a};this.getKmlLayer=function(){return e};this.redrawOnce=function(){if(!c){c=true;this.redraw()}};this.showMap=function(h,k){d=new google.maps.LatLng(k[0],k[1]);var i,j={small:google.maps.ZoomControlStyle.SMALL,large:google.maps.ZoomControlStyle.LARGE,"default":google.maps.ZoomControlStyle.DEFAULT},l=j.small;if(this.zoomControlStyle in j){l=j[this.zoomControlStyle]}i={mapTypeId:this.mapTypeId,mapTypeControl:this.mapTypeControl,scaleControl:this.scaleControl,panControl:this.panControl,streetViewControl:this.streetViewControl,zoomControl:this.zoomControl,zoomControlOptions:{style:l},draggable:this.draggable,disableDoubleClickZoom:!this.dblclickZoom,scrollwheel:this.scrollwheel,center:d,zoom:this.zoom};if(this.mapTypeIds){i.mapTypeControlOptions={mapTypeIds:this.mapTypeIds.split(",")}}f=new google.maps.Map(document.getElementById(h),i);if(this.mapTypeId in this.mapTypes){f.mapTypes.set(this.mapTypeId,this.mapTypes[this.mapTypeId]._styled_map)}return f};this.loadKmlMap=function(h){e=new google.maps.KmlLayer({map:f,url:h});google.maps.event.addListenerOnce(e,"defaultviewport_changed",function(){d=e.getDefaultViewport().getCenter()});return e};if(!this.localised&&"flxmap" in window){this.localise()}this.mapTypeId=google.maps.MapTypeId.ROADMAP;this.mapTypeControl=true;this.scaleControl=false;this.panControl=false;this.zoomControl=true;this.zoomControlStyle="small";this.streetViewControl=false;this.scrollwheel=false;this.draggable=true;this.dblclickZoom=true;this.zoom=16;this.markerTitle="";this.markerDescription="";this.markerHTML="";this.markerLink="";this.markerIcon="";this.markerShowInfo=true;this.markerDirections=false;this.markerDirectionsShow=false;this.markerDirectionsDefault="";this.markerAddress="";this.targetFix=true;this.dirService=false;this.dirRenderer=false;this.dirDraggable=false;this.dirSuppressMarkers=false;this.dirShowSteps=true;this.dirShowSearch=true;this.region="";this.locale="en";this.localeActive=false;this.kmlcache="none"}FlexibleMap.prototype=(function(){var d,b,e;if(document.addEventListener){d=function(g,f,h){g.addEventListener(f,h,false)};b=function(f){f.stopPropagation();f.preventDefault()}}else{if(document.attachEvent){d=function(f,g,h){f.attachEvent("on"+g,function(){h.call(f,window.event)})};b=function(f){f.cancelBubble=true;f.returnValue=0}}}if(typeof MutationObserver!=="undefined"){e=function(k,f){var i=document.getElementById(f),g=i.parentNode,h;function j(l){var m=window.getComputedStyle(l);return m.display==="none"}if(j(g)){h=new MutationObserver(function(l,m){if(!j(g)){k.redrawOnce();m.disconnect()}});h.observe(g,{attributes:true,attributeFilter:["style"]})}}}else{e=function(){}}var a=(function(){function f(h){var i=h.charCodeAt(0),g=i.toString(16);if(i<256){return"\\x"+("00"+g).slice(-2)}return"\\u"+("0000"+g).slice(-4)}return function(g){return g.replace(/[\\\/"'&<>\x00-\x1f\x7f-\xa0\u2000-\u200f\u2028-\u202f]/g,f)}})();function c(g,j){var f,h,k,i=/^(\d+)\s*(minute|hour|day)s?$/.exec(j);if(i){f=(new Date()).getTime();k=+i[1];switch(i[2]){case"minute":if(k<5){k=5}h=f/(60000*k);break;case"hour":h=f/(3600000*k);break;case"day":h=f/(86400000*k);break;default:h=false;break}if(h){h=Math.floor(h);g+=(g.indexOf("?")>-1?"&":"?")+"nocache="+h}}return g}return{constructor:FlexibleMap,i18n:{},mapTypes:{},localised:false,localise:function(){var g,f;if("i18n" in flxmap){FlexibleMap.prototype.i18n=flxmap.i18n}if("mapTypes" in flxmap){f=flxmap.mapTypes;for(g in f){f[g]._styled_map=new google.maps.StyledMapType(f[g].styles,f[g].options)}FlexibleMap.prototype.mapTypes=f}FlexibleMap.prototype.localised=true},setlocale:function(f){this.locale=f;if(f in this.i18n){this.localeActive=f}else{f=f.substr(0,2);if(f in this.i18n){this.localeActive=f}else{this.localeActive=false}}return this.localeActive},gettext:function(g){var f=this.localeActive;if(f&&g in this.i18n[f]){return this.i18n[f][g]}return g},showKML:function(f,i,j){if(typeof j!="undefined"){this.zoom=j}var h=this,g=document.getElementById(f),m=g.getAttribute("data-flxmap"),l=this.showMap(f,[0,0]),k=this.loadKmlMap(c(i,this.kmlcache));e(this,f);if(typeof j!="undefined"){google.maps.event.addListenerOnce(l,"zoom_changed",function(){l.setZoom(j);h.zoom=j})}if(this.markerDirections||this.markerDirectionsShow){this.startDirService(l)}google.maps.event.addListener(k,"click",function(s){var q=s.featureData;if(!q._flxmapOnce){q._flxmapOnce=true;if(h.targetFix){var p=/ target="_blank"/ig;q.description=q.description.replace(p,"");q.infoWindowHtml=q.infoWindowHtml.replace(p,"")}if(h.markerDirections){var o=s.latLng,r=o.lat()+","+o.lng()+",'"+a(q.name)+"',true",n='<br /><a href="#" data-flxmap-fix-opera="1" onclick="'+m+".showDirections("+r+'); return false;">'+h.gettext("Directions")+"</a>";q.infoWindowHtml=q.infoWindowHtml.replace(/<\/div><\/div>$/i,n+"</div></div>")}}});if(window.opera&&this.markerDirections){d(g,"click",function(n){if(n.target.getAttribute("data-flxmap-fix-opera")){b(n)}})}},showMarker:function(k,j,o){var h=this.showMap(k,j),f=new google.maps.LatLng(o[0],o[1]),s=new google.maps.Marker({map:h,position:f,icon:this.markerIcon});this.setMarkerPoint(s);this.setMarkerLocation(f);e(this,k);if(!this.markerTitle){this.markerTitle=this.markerAddress}if(this.markerTitle){var n,p,u,l,m,r,t=this,g=document.createElement("DIV");g.className="flxmap-infowin";s.setTitle(this.markerTitle);m=document.createElement("DIV");m.className="flxmap-marker-title";m.appendChild(document.createTextNode(this.markerTitle));g.appendChild(m);if(this.markerHTML){m=document.createElement("DIV");m.innerHTML=this.markerHTML;g.appendChild(m)}if(this.markerDescription||this.markerLink){m=document.createElement("DIV");m.className="flxmap-marker-link";if(this.markerDescription){u=this.markerDescription.split("\n");for(n=0,p=u.length;n<p;n++){if(n>0){m.appendChild(document.createElement("BR"))}m.appendChild(document.createTextNode(u[n]))}if(this.markerLink){m.appendChild(document.createElement("BR"))}}if(this.markerLink){r=document.createElement("A");r.href=this.markerLink;r.appendChild(document.createTextNode(this.gettext("Click for details")));m.appendChild(r)}g.appendChild(m)}if(this.markerDirections){m=document.createElement("DIV");m.className="flxmap-directions-link";r=document.createElement("A");r.href="#";r.dataLatitude=o[0];r.dataLongitude=o[1];r.dataTitle=this.markerTitle;d(r,"click",function(i){b(i);t.showDirections(this.dataLatitude,this.dataLongitude,this.dataTitle,true)});r.appendChild(document.createTextNode(this.gettext("Directions")));m.appendChild(r);g.appendChild(m)}if(this.markerDirections||this.markerDirectionsShow){this.startDirService(h);if(this.markerDirectionsShow){this.showDirections(o[0],o[1],this.markerTitle,false)}}l=new google.maps.InfoWindow({content:g});this.setMarkerInfowin(l);if(this.markerShowInfo){google.maps.event.addListenerOnce(h,"tilesloaded",function(){l.open(h,s)})}google.maps.event.addListener(s,"click",function(){l.open(h,s)});var q=function(){t.updateGoogleLink()};google.maps.event.addListener(h,"idle",q);google.maps.event.addListener(h,"center_changed",q);google.maps.event.addListenerOnce(h,"tilesloaded",q)}},showAddress:function(f,g){var h=this,i=new google.maps.Geocoder();this.markerAddress=g;if(this.markerTitle===""){this.markerTitle=g}i.geocode({address:g,region:this.region},function(l,k){if(k==google.maps.GeocoderStatus.OK){var j=l[0].geometry.location,m=[j.lat(),j.lng()];h.showMarker(f,m,m)}else{window.alert("Map address returns error: "+k)}})},updateGoogleLink:function(){if("querySelectorAll" in document){try{var m=this.getMap().getDiv(),g=this.getMarkerLocation(),j=m.querySelectorAll("a[href*='maps.google.com/maps']:not([href*='mps_dialog']):not([href*='&q='])"),h=0,f=j.length,k=encodeURIComponent((this.markerAddress?this.markerAddress:this.markerTitle)+" @"+g.lat()+","+g.lng());for(;h<f;h++){j[h].href+="&mrt=loc&iwloc=A&q="+k}}catch(l){}}},redraw:function(){var h=this.getMap(),g=this.getKmlLayer();google.maps.event.trigger(h,"resize");if(g){h.fitBounds(g.getDefaultViewport())}else{h.setCenter(this.getCenter());h.setZoom(this.zoom);var f=this.getMarkerInfowin();if(f){f.open(h,this.getMarkerPoint())}}},startDirService:function(f){if(!this.dirService){this.dirService=new google.maps.DirectionsService()}if(!this.dirRenderer){this.dirRenderer=new google.maps.DirectionsRenderer({map:f,draggable:this.dirDraggable,suppressMarkers:this.dirSuppressMarkers,panel:this.dirShowSteps?document.getElementById(this.markerDirectionsDiv):null})}},showDirections:function(m,i,l,f){var g=this;function k(){var n=document.getElementById(g.markerDirectionsDiv),q=document.createElement("form"),o,r,s;while(!!(r=n.lastChild)){n.removeChild(r)}r=document.createElement("p");r.appendChild(document.createTextNode(g.gettext("From")+": "));s=document.createElement("input");s.type="text";s.name="from";s.value=g.markerDirectionsDefault;r.appendChild(s);o=document.createElement("input");o.type="submit";o.value=g.gettext("Get directions");r.appendChild(o);q.appendChild(r);n.appendChild(q);if(typeof q.elements.from=="undefined"){q.elements.from=s}if(f){s.focus()}d(q,"submit",function(p){b(p);var t=this.elements.from.value;if(/\S/.test(t)){j(t)}})}function j(p){var n=(g.markerAddress==="")?new google.maps.LatLng(m,i):g.markerAddress,o={origin:p,region:g.region||"",destination:n,travelMode:google.maps.DirectionsTravelMode.DRIVING};g.dirService.route(o,h)}function h(p,n){var o=google.maps.DirectionsStatus;switch(n){case o.OK:g.dirRenderer.setDirections(p);break;case o.ZERO_RESULTS:window.alert("No route could be found between the origin and destination.");break;case o.OVER_QUERY_LIMIT:window.alert("The webpage has gone over the requests limit in too short a period of time.");break;case o.REQUEST_DENIED:window.alert("The webpage is not allowed to use the directions service.");break;case o.INVALID_REQUEST:window.alert("Invalid directions request.");break;case o.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.");break}}if(this.markerDirectionsDiv&&this.dirShowSearch){k()}if(this.markerDirectionsDefault){j(this.markerDirectionsDefault)}}}})();
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Donate link: http://shop.webaware.com.au/downloads/flexible-map/
|
|
7 |
Tags: google, map, maps, google maps, shortcode, google maps shortcode, kml
|
8 |
Requires at least: 3.2.1
|
9 |
Tested up to: 4.1
|
10 |
-
Stable tag: 1.9.
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
@@ -306,6 +306,9 @@ Either turn off CloudFlare Rocketscript :) or install the [Flxmap No Rocketscrip
|
|
306 |
|
307 |
== Changelog ==
|
308 |
|
|
|
|
|
|
|
309 |
= 1.9.0 [2014-12-24] =
|
310 |
* fixed: maps broken when hidden in tabs / accordions (not for IE 10 and earlier; uses MutationObserver)
|
311 |
* fixed: strip spaces from map coordinates
|
@@ -322,7 +325,7 @@ Either turn off CloudFlare Rocketscript :) or install the [Flxmap No Rocketscrip
|
|
322 |
* added: Welsh translation (thanks, [Dylan](https://profiles.wordpress.org/dtom-ct-wp/)!)
|
323 |
|
324 |
= 1.8.1 [2014-10-05] =
|
325 |
-
* fixed: Hungarian translation (thanks, Krisztián Vörös)
|
326 |
* changed: bump version of Google Maps API to 3.17
|
327 |
|
328 |
= 1.8.0 [2014-08-31] =
|
7 |
Tags: google, map, maps, google maps, shortcode, google maps shortcode, kml
|
8 |
Requires at least: 3.2.1
|
9 |
Tested up to: 4.1
|
10 |
+
Stable tag: 1.9.1
|
11 |
License: GPLv2 or later
|
12 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
13 |
|
306 |
|
307 |
== Changelog ==
|
308 |
|
309 |
+
= 1.9.1 [2014-12-29] =
|
310 |
+
* fixed: zoom control styling / hiding was broken in v1.9.0
|
311 |
+
|
312 |
= 1.9.0 [2014-12-24] =
|
313 |
* fixed: maps broken when hidden in tabs / accordions (not for IE 10 and earlier; uses MutationObserver)
|
314 |
* fixed: strip spaces from map coordinates
|
325 |
* added: Welsh translation (thanks, [Dylan](https://profiles.wordpress.org/dtom-ct-wp/)!)
|
326 |
|
327 |
= 1.8.1 [2014-10-05] =
|
328 |
+
* fixed: Hungarian translation (thanks, Krisztián Vörös!)
|
329 |
* changed: bump version of Google Maps API to 3.17
|
330 |
|
331 |
= 1.8.0 [2014-08-31] =
|