Version Description
- Added: setting to open POIs in a new tab/window. For shortcodes use [mashup mashupClick="postnew"]
- Fixed: mashups for custom post types were displaying all post types
- Fixed: maps saved from custom fields in older versions were not auto-centering properly
Download this release
Release Info
Developer | chrisvrichardson |
Plugin | MapPress Easy Google Maps |
Version | 2.47.4 |
Comparing to | |
See all releases |
Code changes from version 2.47.1 to 2.47.4
- js/mappress.min.js +1 -1
- languages/mappress-google-maps-for-wordpress.pot +29 -25
- languages/texts.php +2 -1
- mappress.php +9 -3
- readme.txt +17 -6
- templates/map-filters.php +0 -1
js/mappress.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var mapp=window.mapp||{};+function(n){mapp.Map=function(t,r){function v(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)google.maps.event.addListener(u,n[i],t)}function y(){var i,t;n("[data-mapp-type]",e.menu).removeClass("mapp-active");n('[data-mapp-type="'+u.getMapTypeId()+'"]',e.menu).addClass("mapp-active");for(layer in s)i=!!s[layer].getMap(),n('[data-mapp-layer="'+layer+'"]',e.menu).toggleClass("mapp-active",i);t=!!(f.center&&f.zoom);n('[data-mapp-action="viewport-set"]',e.menu).toggle(!t);n('[data-mapp-action="viewport-reset"]',e.menu).toggle(t)}function p(){var n=mappl10n.options.styles,i=mappl10n.options.style,r=["roadmap","satellite","terrain","hybrid"],t;if(i&&typeof n[i]!="undefined"&&u.setOptions({styles:n[i]}),f.editable){for(t in n)u.mapTypes.set(t,new google.maps.StyledMapType(n[t],{name:t})),r.push(t);u.setOptions({mapTypeControlOptions:{mapTypeIds:r,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else typeof n[f.mapTypeId]!="undefined"&&u.setOptions({styles:n[f.mapTypeId]})}function w(){e.controls.children("[data-mapp-position]").each(function(){var t=n(this).attr("data-mapp-position"),i;t=t?google.maps.ControlPosition[t]:google.maps.ControlPosition.TOP_RIGHT;i=n(this);i.get(0).index=0;u.controls[t].push(i.get(0))})}function b(){var e,i,t,r;for(s={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},e=n.makeArray(f.layers),i=0;i<e.length;i++)t=n.trim(e[i]),r=t.split(".").pop(),s[t]?l(t):r=="kml"||r=="kmz"?s[t]=new google.maps.KmlLayer({map:u,preserveViewport:!0,url:t}):r=="json"&&(s[t]=new google.maps.Data({map:u}).loadGeoJson(t))}function l(t,i){n.each(["traffic","bicycling","transit"],function(n,t){s[t].setMap(null)});t&&(i=typeof i=="undefined"?s[t].getMap()==null:i,s[t].setMap(i?u:null))}function a(t,i){var r=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(u.getMapTypeId()==t);t=f.editable?i&&(r||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":r?t:"roadmap";u.setMapTypeId(t)}this.defaults={center:null,editable:null,geolocate:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,minZoom:null,name:null,pois:null,postid:null,query:null,title:null,width:null,zoom:null};this.iw=null;this.places=null;this.poi=null;this.settings=r;var f=this,h=null,e={},u=null,s={},o=[],c;_.extend(this,this.defaults,_.pick(t,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));this.display=function(){if(e.layout=n("#"+this.name),n.each(["canvas","controls","dialog","directions","filters","list","menu","search"],function(t,i){e[i]=n(".mapp-"+i,e.layout)}),!e.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);u=new google.maps.Map(e.canvas.get(0),{mapTypeId:"roadmap",zoom:1});var t={backgroundColor:"transparent",fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:this.minZoom?parseInt(this.minZoom):0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query};u.setOptions(t);p();w();b();a(this.mapTypeId,!0);e.search.length&&(this.places=new mapp.Places(n(".mapp-places",e.search),{map:f}),f.editable||google.maps.event.addListener(this.places,"search",function(n){f.search(n)}));e.layout.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");t.preventDefault();f.action(i,n(this).attr("data-mapp-"+i),n(this))});e.filters.on("change",function(){f.ajaxQuery(u.getBounds())});v("click drag",function(){f.closeInfoWindow()});e.layout.on("click",function(t){var i=n(t.target),r=i.attr("data-mapp-action");i==e.filters||r=="filters-toggle"||i.closest(e.filters).length||f.toggleView("filters",!1);i==e.menu||r=="menu-toggle"||i.closest(e.menu).length||f.toggleView("menu",!1)});if(n(window).resize(function(){f.resize()}),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.query){this.geolocate?this.places.parse("geolocate"):this.ajaxQuery();return}google.maps.event.addListenerOnce(u,"idle",function(){f.initCenter()});this.setPois(this.pois)};this.load=function(n){_.extend(this,this.defaults,_.pick(n,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));f.resize();a(this.mapTypeId,!0);this.toggleView("menu",!1);l();this.poiSelect(null);this.setPois(this.pois);this.places&&this.places.set("");f.recenter();google.maps.event.trigger(this,"load")};this.action=function(t,i,r){switch(t){case"center":this.toggleView("menu",!1);this.closeInfoWindow();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":e.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(u.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate();break;case"layer":l(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var f=r.attr("data-mapp-poi");this.openInfoWindow(o[f]);break;case"show":e.layout.show();this.resize();this.initCenter();break;case"viewport-set":this.center=u.getCenter().toJSON();this.zoom=u.getZoom();this.toggleView("menu",!1);break;case"viewport-reset":this.center=null;this.zoom=null;this.toggleView("menu",!1);this.recenter();break;default:return!0}};this.closeInfoWindow=function(){this.iw.close();this.poiSelect(null)};this.openDirections=function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";h||(h=new mapp.Directions(e.directions,{map:f,directions:mappl10n.options.directions}));h.open(i,r)};this.poiSelect=function(t){if(this.poi=t,n("[data-mapp-poi]",e.list).removeClass("mapp-selected"),t){var r=n.inArray(t,o),i=n('[data-mapp-poi="'+r+'"]',e.list);i.addClass("mapp-selected");mapp.lib.scrollTo(e.list,i);c++;t.setZIndex(c)}};this.getMap=function(){return u};this.renderList=function(){this.editable&&(e.list.html(mapp.lib.template("poi-list",{pois:o})),google.maps.event.trigger(this,"render-list"))};this.getPois=function(){return o};this.addPoi=function(n){o.unshift(n);n.setMap(this);f.renderList();this.poiSelect(n)};this.removePoi=function(t){var i=n.inArray(t,o);i!=-1&&(o[i].setMap(null),o.splice(i,1),f.renderList())};this.resetPois=function(){for(i=0;i<o.length;i++)o[i].setMap(null);o=[];c=google.maps.Marker.MAX_ZINDEX};this.setPois=function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),o.push(i),i.setMap(this),i.setZIndex(c+n.length-1-t);c+=n.length-1}this.renderList()};this.sortPois=function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(o[r])}if(t.length!=o.length)return!1;o=t;this.renderList()};this.openInfoWindow=function(n,t){if(h&&h.close(),this.iw.close(),this.poiSelect(n),!this.editable){if(mappl10n.options.mashupClick=="post"&&n.postid&&n.url){window.location.assign(n.url);return}this.iw.setContent(n.html)}google.maps.event.addListenerOnce(this.iw,"domready",function(){google.maps.event.trigger(f,"poidomready",n)});google.maps.event.trigger(f,"open",n);var i=new google.maps.MVCObject;i.setValues({position:n.getPosition(t),anchorPoint:n.getAnchorPoint(t)});this.iw.open(u,i)};this.togglePois=function(n){n=!!n;for(var t=0;t<o.length;t++)o[t].setVisible(n)};this.toggleView=function(n,t){t=typeof t=="undefined"?!e.layout.hasClass("mapp-view-"+n):t;e.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&y();n=="directions"&&this.resize()};this.resize=function(){var n=u.getCenter();google.maps.event.trigger(u,"resize");u.setCenter(n);return};this.initCenter=function(){var n=o.length?o[0]:null;google.maps.event.addListenerOnce(u,"idle",function(){if(f.initialOpenDirections){f.openDirections(null,n);return}n&&f.initialOpenInfo&&n.open()});this.recenter()};this.recenter=function(){var r=!this.query&&this.center?new google.maps.LatLng(this.center.lat,this.center.lng):null,t=!this.query&&this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,n,i;if(r){u.setCenter(r);u.setZoom(t?t:1);return}if(o.length==0){u.setCenter(new google.maps.LatLng(0,0));u.setZoom(1);return}if(o.length==1){o[0].center(t);return}for(bounds=new google.maps.LatLngBounds,n=0;n<o.length;n++)i=o[n].getBounds(),bounds=i?bounds.union(i):bounds.extend(o[n].getPosition());u.fitBounds(bounds)};this.toJSON=function(){var n;for(this.pois=[],n=0;n<o.length;n++)this.pois.push(o[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:u.getMapTypeId(),metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}};this.ajaxSave=function(n){var t=JSON.stringify(this),i=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:t,postid:i},callback:function(t){t.status=="OK"&&(f.mapid=t.data.mapid,n(t.data),google.maps.event.trigger(f,"save"))}})}};mapp.Map.ajaxCreate=function(n,t){mapp.lib.ajax({type:"GET",data:{action:"mapp_create"},callback:function(i){if(i.status=="OK"){var r=new mapp.Map(i.data.map,n);t(r)}}})};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){function h(t,i,o){var c=n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var l={travelMode:c,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:t,destination:i},h=n(".mapp-dir-renderer",r).get(0);n(".mapp-dir-renderer",r).empty();s||(s=new google.maps.DirectionsService);s.route(l,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:f.opts.map.togglePois(!1);u?(u.setDirections(n),u.setMap(e),u.setPanel(h)):u=new google.maps.DirectionsRenderer({map:e,panel:h,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_error);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_error);break;default:alert(mappl10n.dir_error+t)}o()})}this.opts=n.extend({map:null,directions:null},i);var r=n(t),e,o,u,s,f=this;e=this.opts.map.getMap();o=new mapp.Geocoder(e);r.on("keydown",function(t){t.which==13?(f.getDirections(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val()),t.preventDefault()):t.which==27&&f.close()});r.on("click","[data-mapp-action]",function(t){var h=n(this).attr("data-mapp-action"),i,u,e,s;t.preventDefault();switch(h){case"dir-cancel":f.close();break;case"dir-get":f.getDirections();break;case"dir-google":i=n(".mapp-dir-saddr",r).val();u=n(".mapp-dir-daddr",r).val();f.openGoogle(i,u);f.close();break;case"dir-myloc":o.geolocate(function(t){t?n(".mapp-dir-saddr",r).val(t.coords.latitude+", "+t.coords.longitude):alert(mappl10n.no_geolocate)});break;case"dir-swap":e=n(".mapp-dir-daddr",r).val();s=n(".mapp-dir-saddr",r).val();n(".mapp-dir-saddr",r).val(e);n(".mapp-dir-daddr",r).val(s)}});this.open=function(t,i){if(this.opts.directions=="google"){this.openGoogle(t,i);return}this.opts.map.toggleView("directions",!0);n(".mapp-dir-saddr",r).val(t);n(".mapp-dir-daddr",r).val(i);n(".mapp-dir-get",r).focus();n(".mapp-dir-saddr",r).focus()};this.close=function(){this.opts.map.toggleView("directions",!1);u&&(u.setPanel(null),u.getMap()&&(u.setMap(null),this.opts.map.togglePois(!0)))};this.getDirections=function(){this.opts.map.closeInfoWindow();n(".mapp-spinner",r).show();var t=n(".mapp-dir-saddr",r),i=n(".mapp-dir-daddr",r),u=n(".mapp-dir-saddr-err",r),f=n(".mapp-dir-daddr-err",r);o.geocodeField(t,u,function(t){o.geocodeField(i,f,function(i){t&&i?h(t,i,function(){n(".mapp-spinner",r).hide();return}):n(".mapp-spinner",r).hide()})})};this.printDirections=function(){var i,t=n(".mapp-travelmode-on > span",r);i=t.hasClass("mapp-dir-walk")?"w":t.hasClass("mapp-dir-bike")?"b":t.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val(),i)};this.openGoogle=function(n,t,i){var r=mappl10n.options.directionsServer;r.toLowerCase().indexOf("http")==-1&&(r="https://"+r);r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}}}(jQuery);mapp=window.mapp||{};mapp.Geocoder=function(n){function r(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function u(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var t,f,i=this;f=n;this.geocode=function(i,r){typeof i=="string"&&i.substring(0,1)=="("&&(split=i.replace(/\(|\)/g,"").split(","),i=new google.maps.LatLng(split[0],split[1]));var u=i instanceof google.maps.LatLng?{location:i}:{address:i,region:mappl10n.options.country,bounds:n.getBounds()};t||(t=new google.maps.Geocoder);t.geocode(u,function(n,t){if(n){for(var i=0;i<n.length;i++)n[i].formatted_address==""&&n.splice(i,1);r(n[0],t)}else r(null,t)})};this.geolocate=function(n){if(!navigator||!navigator.geolocation)return null;navigator.geolocation.getCurrentPosition(function(t){n(t)},function(){n(null)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};this.stringToLatLng=function(n){var t=n.split(",",2),i=Number(t[0]),r=Number(t[1]);return isNaN(i)||isNaN(r)?!1:new google.maps.LatLng(i,r)};this.geocodeField=function(n,t,i){r(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){u(n,t,mappl10n.no_address);i(null);return}if(r&&r.formatted_address){jQuery(n).val(r.formatted_address);i(r.formatted_address);return}i(r);return})};this.autocompleteField=function(n,t,f,e,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(f).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(e).click(function(){return r(n,t),i.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else u(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,f,e){if(r(n,t),f=jQuery.trim(f),f==""){e(null);return}var o=i.stringToLatLng(f);if(o){e(o);return}if(f.substring(0,4)=="http"){e(f);return}i.geocode(f,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){u(n,t,mappl10n.no_address);e(null);return}e(i);return})}};mapp.Geocoder.parseAddress=function(n){return!n||n==""?{firstLine:"",secondLine:""}:(n.lastIndexOf(", USA")>0||n.lastIndexOf(", United States")>0)&&(n.lastIndexOf(", USA")>0&&(n=n.slice(0,n.lastIndexOf(", USA"))),n.lastIndexOf(", United States")>0&&(n=n.slice(0,n.lastIndexOf(", United States"))),n.indexOf(",")==n.lastIndexOf(","))?{firstLine:n,secondLine:""}:n.indexOf(",")==-1?{firstLine:n,secondLine:""}:{firstLine:n.slice(0,n.indexOf(",")),secondLine:n.slice(n.indexOf(", ")+2)}};mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({disableAutoPan:!1,border:20},i),u=null,r=null,e=null,o=this;r=n('<div class="mapp-ib" tabindex="0">').appendTo(t.getMap().getDiv());e=n('<div class="mapp-ib-tip">').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){o.close()});r.on("keydown",function(n){n.which==27&&o.close()});r.on("click",".mapp-close",function(){o.close()});this.getContent=function(){return r};this.setContent=function(n){r.empty().append(n)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){r.show();e.show();var t=n(":input",r);t.length?t.first().focus():r.focus();google.maps.event.trigger(o,"domready")};this.draw=function(){var l=this.getMap(),c=this.getProjection().fromLatLngToContainerPixel(u.position),t={width:n(l.getDiv()).width(),height:n(l.getDiv()).height()},v=n(".mapp-ib-body",r);if(!f.disableAutoPan){r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var s=r.outerWidth(!0),h=r.outerHeight(!0),a=e.outerHeight(!0),i=c.x,o=c.y;i+s/2>t.width&&(i=t.width-s/2);i-s/2<0&&(i=s/2);o-h+u.anchorPoint.y-a<f.border&&(o=h-u.anchorPoint.y+f.border+a);o>t.height&&(o=t.height);l.panBy(c.x-i,c.y-o);h>t.height+u.anchorPoint.y-2*f.border&&(h=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":h+2}));r.css({left:i-s/2,bottom:t.height-o-u.anchorPoint.y+a});e.css({left:i,bottom:t.height-o-u.anchorPoint.y})}};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.empty();r.hide();e.hide()}};mapp.InfoBox.prototype=new google.maps.OverlayView}(jQuery);mapp=window.mapp||{};+function(n){if(mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}},typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("ERROR: Google Maps API Key missing, please check MapPress settings and FAQ");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")});mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).attr("id"),t=window[i];t.resize();t.initCenter()})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;if(this.sel=n(t),this.opts=n.extend({map:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length){this.opts.types||(this.opts.types=[]);this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types});this.autocomplete.bindTo("bounds",this.opts.map.getMap());this.sel.on("keydown",function(n){n.which==13&&n.preventDefault()});google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())})}};mapp.Places.prototype={parse:function(t){var u,i=this,r,f;if(this.error(!1),r=t&&t.name?n.trim(t.name):n.trim(t),!r)return this.error(!0);if(r=="geolocate")return this.geolocate();if(r.substring(0,4)=="http"){google.maps.event.trigger(i,"search",r);return}if(t&&t.geometry){t.formatted_address&&this.set(t.formatted_address);google.maps.event.trigger(i,"search",t);return}if(f=this.parseLatLng(t),f){google.maps.event.trigger(i,"search",f);return}this.autocompleteService.getPlacePredictions({input:r,types:this.opts.types,bounds:this.opts.map.getMap().getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return i.error(!0);u=typeof n[0].description!="undefined"?n[0].description:null;i.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return i.error(!0);u=u?u:n.formatted_address;i.set(u);google.maps.event.trigger(i,"search",n)})})},parseLatLng:function(t){var r,i;return t instanceof google.maps.LatLng?t:t&&t.lat&&t.lng?new google.maps.LatLng(t.lat,t.lng):(r=t&&t.name?n.trim(t.name):n.trim(t),i=r.split(","),i.length==2&&!isNaN(i[0])&&!isNaN(i[1]))?new google.maps.LatLng(i[0],i[1]):null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){n.set("");google.maps.event.trigger(n,"search",new google.maps.LatLng(t.coords.latitude,t.coords.longitude))},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){n=n.replace(", United States of America","").replace(", USA","").replace(", United States","");this.sel.val(n);this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n)},destroy:function(){this.autocomplete.unbindAll();google.maps.event.clearInstanceListeners(this.sel.get(0))}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var f,e,r,s,i,u,h,o;if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),t.viewport&&t.viewport.sw&&t.viewport.ne&&(f=new google.maps.LatLng(t.viewport.sw.lat,t.viewport.sw.lng),e=new google.maps.LatLng(t.viewport.ne.lat,t.viewport.ne.lng),this.viewport=f.lat()==0&&f.lng()==0&&e.lat()==0&&e.lng()==0?null:new google.maps.LatLngBounds(f,e)),r=[],s=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],u=0;u<t.poly.paths[i].length;u++)r.push(new google.maps.LatLng(t.poly.paths[i][u].lat,t.poly.paths[i][u].lng));s.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:o,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":h=t.kml&&t.kml.url?t.kml.url:"";this.overlay=new google.maps.KmlLayer(h,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Marker({position:o})}};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},r=this.getPosition(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},setMap:function(t){var i=this;if(google.maps.event.clearInstanceListeners(this.overlay),t==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=t;this.overlay.setMap(t.getMap());this.setEditable(this.map.editable);this.setIcon(this.iconid);this.type||this.overlay.setTitle(n("<div>").html(this.title).text());google.maps.event.addListener(this.overlay,"click",function(n){i.open(n)})},setEditable:function(n){var t=this;this.type!="kml"&&(this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),google.maps.event.clearListeners(this.overlay,"rightclick"),google.maps.event.clearListeners(this.overlay,"dragstart"),n&&(google.maps.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.closeInfoWindow()}),(this.type=="polygon"||this.type=="polyline")&&google.maps.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},getZIndex:function(){return this.type?this.overlay.zIndex:this.overlay.getZIndex()},setZIndex:function(n){this.type?this.overlay.zIndex=n:this.overlay.setZIndex(n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n)),this.iconid=n)},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},center:function(n){var t=this.map.getMap(),i=this.getBounds();if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(parseInt(mappl10n.options.poiZoom)))},open:function(n){this.map.openInfoWindow(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.editable&&this.viewport)return this.viewport;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport?this.viewport:null}return n},getPosition:function(n){if(!this.type)return this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():new google.maps.LatLng(0,0)},click:function(){google.maps.event.trigger(this.overlay,"click")},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){return this.type=="kml"?n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0):this.type?new google.maps.Point(0,0):typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
|
1 |
+
var mapp=window.mapp||{};+function(n){mapp.Map=function(t,r){function v(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)google.maps.event.addListener(u,n[i],t)}function y(){var i,t;n("[data-mapp-type]",e.menu).removeClass("mapp-active");n('[data-mapp-type="'+u.getMapTypeId()+'"]',e.menu).addClass("mapp-active");for(layer in s)i=!!s[layer].getMap(),n('[data-mapp-layer="'+layer+'"]',e.menu).toggleClass("mapp-active",i);t=!!(f.center&&f.zoom);n('[data-mapp-action="viewport-set"]',e.menu).toggle(!t);n('[data-mapp-action="viewport-reset"]',e.menu).toggle(t)}function p(){var n=mappl10n.options.styles,i=mappl10n.options.style,r=["roadmap","satellite","terrain","hybrid"],t;if(i&&typeof n[i]!="undefined"&&u.setOptions({styles:n[i]}),f.editable){for(t in n)u.mapTypes.set(t,new google.maps.StyledMapType(n[t],{name:t})),r.push(t);u.setOptions({mapTypeControlOptions:{mapTypeIds:r,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else typeof n[f.mapTypeId]!="undefined"&&u.setOptions({styles:n[f.mapTypeId]})}function w(){e.controls.children("[data-mapp-position]").each(function(){var t=n(this).attr("data-mapp-position"),i;t=t?google.maps.ControlPosition[t]:google.maps.ControlPosition.TOP_RIGHT;i=n(this);i.get(0).index=0;u.controls[t].push(i.get(0))})}function b(){var e,i,t,r;for(s={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},e=n.makeArray(f.layers),i=0;i<e.length;i++)t=n.trim(e[i]),r=t.split(".").pop(),s[t]?l(t):r=="kml"||r=="kmz"?s[t]=new google.maps.KmlLayer({map:u,preserveViewport:!0,url:t}):r=="json"&&(s[t]=new google.maps.Data({map:u}).loadGeoJson(t))}function l(t,i){n.each(["traffic","bicycling","transit"],function(n,t){s[t].setMap(null)});t&&(i=typeof i=="undefined"?s[t].getMap()==null:i,s[t].setMap(i?u:null))}function a(t,i){var r=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(u.getMapTypeId()==t);t=f.editable?i&&(r||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":r?t:"roadmap";u.setMapTypeId(t)}this.defaults={center:null,editable:null,geolocate:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,minZoom:null,name:null,pois:null,postid:null,query:null,title:null,width:null,zoom:null};this.iw=null;this.places=null;this.poi=null;this.settings=r;var f=this,h=null,e={},u=null,s={},o=[],c;_.extend(this,this.defaults,_.pick(t,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));this.display=function(){if(e.layout=n("#"+this.name),n.each(["canvas","controls","dialog","directions","filters","list","menu","search"],function(t,i){e[i]=n(".mapp-"+i,e.layout)}),!e.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);u=new google.maps.Map(e.canvas.get(0),{mapTypeId:"roadmap",zoom:1});var t={backgroundColor:"transparent",fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:this.minZoom?parseInt(this.minZoom):0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query};u.setOptions(t);p();w();b();a(this.mapTypeId,!0);e.search.length&&(this.places=new mapp.Places(n(".mapp-places",e.search),{map:f}),f.editable||google.maps.event.addListener(this.places,"search",function(n){f.search(n)}));e.layout.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");t.preventDefault();f.action(i,n(this).attr("data-mapp-"+i),n(this))});e.filters.on("change",function(){f.ajaxQuery(u.getBounds())});v("click drag",function(){f.closeInfoWindow()});e.layout.on("click",function(t){var i=n(t.target),r=i.attr("data-mapp-action");i==e.filters||r=="filters-toggle"||i.closest(e.filters).length||f.toggleView("filters",!1);i==e.menu||r=="menu-toggle"||i.closest(e.menu).length||f.toggleView("menu",!1)});if(n(window).resize(function(){f.resize()}),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.query){this.geolocate?this.places.parse("geolocate"):this.ajaxQuery();return}google.maps.event.addListenerOnce(u,"idle",function(){f.initCenter()});this.setPois(this.pois)};this.load=function(n){_.extend(this,this.defaults,_.pick(n,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));f.resize();a(this.mapTypeId,!0);this.toggleView("menu",!1);l();this.poiSelect(null);this.setPois(this.pois);this.places&&this.places.set("");f.recenter();google.maps.event.trigger(this,"load")};this.action=function(t,i,r){switch(t){case"center":this.toggleView("menu",!1);this.closeInfoWindow();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":e.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(u.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate();break;case"layer":l(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var f=r.attr("data-mapp-poi");this.openInfoWindow(o[f]);break;case"show":e.layout.show();this.resize();this.initCenter();break;case"viewport-set":this.center=u.getCenter().toJSON();this.zoom=u.getZoom();this.toggleView("menu",!1);break;case"viewport-reset":this.center=null;this.zoom=null;this.toggleView("menu",!1);this.recenter();break;default:return!0}};this.closeInfoWindow=function(){this.iw.close();this.poiSelect(null)};this.openDirections=function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";h||(h=new mapp.Directions(e.directions,{map:f,directions:mappl10n.options.directions}));h.open(i,r)};this.poiSelect=function(t){if(this.poi=t,n("[data-mapp-poi]",e.list).removeClass("mapp-selected"),t){var r=n.inArray(t,o),i=n('[data-mapp-poi="'+r+'"]',e.list);i.addClass("mapp-selected");mapp.lib.scrollTo(e.list,i);c++;t.setZIndex(c)}};this.getMap=function(){return u};this.renderList=function(){this.editable&&(e.list.html(mapp.lib.template("poi-list",{pois:o})),google.maps.event.trigger(this,"render-list"))};this.getPois=function(){return o};this.addPoi=function(n){o.unshift(n);n.setMap(this);f.renderList();this.poiSelect(n)};this.removePoi=function(t){var i=n.inArray(t,o);i!=-1&&(o[i].setMap(null),o.splice(i,1),f.renderList())};this.resetPois=function(){for(i=0;i<o.length;i++)o[i].setMap(null);o=[];c=google.maps.Marker.MAX_ZINDEX};this.setPois=function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),o.push(i),i.setMap(this),i.setZIndex(c+n.length-1-t);c+=n.length-1}this.renderList()};this.sortPois=function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(o[r])}if(t.length!=o.length)return!1;o=t;this.renderList()};this.openInfoWindow=function(n,t){if(h&&h.close(),this.iw.close(),this.poiSelect(n),!this.editable){if((mappl10n.options.mashupClick=="post"||mappl10n.options.mashupClick=="postnew")&&n.postid&&n.url){mappl10n.options.mashupClick=="post"?window.location.assign(n.url):window.open(n.url);return}this.iw.setContent(n.html)}google.maps.event.addListenerOnce(this.iw,"domready",function(){google.maps.event.trigger(f,"poidomready",n)});google.maps.event.trigger(f,"open",n);var i=new google.maps.MVCObject;i.setValues({position:n.getPosition(t),anchorPoint:n.getAnchorPoint(t)});this.iw.open(u,i)};this.togglePois=function(n){n=!!n;for(var t=0;t<o.length;t++)o[t].setVisible(n)};this.toggleView=function(n,t){t=typeof t=="undefined"?!e.layout.hasClass("mapp-view-"+n):t;e.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&y();n=="directions"&&this.resize()};this.resize=function(){var n=u.getCenter();google.maps.event.trigger(u,"resize");u.setCenter(n);return};this.initCenter=function(){var n=o.length?o[0]:null;google.maps.event.addListenerOnce(u,"idle",function(){if(f.initialOpenDirections){f.openDirections(null,n);return}n&&f.initialOpenInfo&&n.open()});this.recenter()};this.recenter=function(){var t=!this.query&&this.center?new google.maps.LatLng(this.center.lat,this.center.lng):null,i=!this.query&&this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,n,r;if(this.center&&this.center.lat==0&&this.center.lng==0&&(t=null),t){u.setCenter(t);u.setZoom(i?i:1);return}if(o.length==0){u.setCenter(new google.maps.LatLng(0,0));u.setZoom(1);return}if(o.length==1){o[0].center(i);return}for(bounds=new google.maps.LatLngBounds,n=0;n<o.length;n++)r=o[n].getBounds(),bounds=r?bounds.union(r):bounds.extend(o[n].getPosition());u.fitBounds(bounds)};this.toJSON=function(){var n;for(this.pois=[],n=0;n<o.length;n++)this.pois.push(o[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:u.getMapTypeId(),metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}};this.ajaxSave=function(n){var t=JSON.stringify(this),i=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:t,postid:i},callback:function(t){t.status=="OK"&&(f.mapid=t.data.mapid,n(t.data),google.maps.event.trigger(f,"save"))}})}};mapp.Map.ajaxCreate=function(n,t){mapp.lib.ajax({type:"GET",data:{action:"mapp_create"},callback:function(i){if(i.status=="OK"){var r=new mapp.Map(i.data.map,n);t(r)}}})};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){function h(t,i,o){var c=n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var l={travelMode:c,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:t,destination:i},h=n(".mapp-dir-renderer",r).get(0);n(".mapp-dir-renderer",r).empty();s||(s=new google.maps.DirectionsService);s.route(l,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:f.opts.map.togglePois(!1);u?(u.setDirections(n),u.setMap(e),u.setPanel(h)):u=new google.maps.DirectionsRenderer({map:e,panel:h,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_error);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_error);break;default:alert(mappl10n.dir_error+t)}o()})}this.opts=n.extend({map:null,directions:null},i);var r=n(t),e,o,u,s,f=this;e=this.opts.map.getMap();o=new mapp.Geocoder(e);r.on("keydown",function(t){t.which==13?(f.getDirections(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val()),t.preventDefault()):t.which==27&&f.close()});r.on("click","[data-mapp-action]",function(t){var h=n(this).attr("data-mapp-action"),i,u,e,s;t.preventDefault();switch(h){case"dir-cancel":f.close();break;case"dir-get":f.getDirections();break;case"dir-google":i=n(".mapp-dir-saddr",r).val();u=n(".mapp-dir-daddr",r).val();f.openGoogle(i,u);f.close();break;case"dir-myloc":o.geolocate(function(t){t?n(".mapp-dir-saddr",r).val(t.coords.latitude+", "+t.coords.longitude):alert(mappl10n.no_geolocate)});break;case"dir-swap":e=n(".mapp-dir-daddr",r).val();s=n(".mapp-dir-saddr",r).val();n(".mapp-dir-saddr",r).val(e);n(".mapp-dir-daddr",r).val(s)}});this.open=function(t,i){if(this.opts.directions=="google"){this.openGoogle(t,i);return}this.opts.map.toggleView("directions",!0);n(".mapp-dir-saddr",r).val(t);n(".mapp-dir-daddr",r).val(i);n(".mapp-dir-get",r).focus();n(".mapp-dir-saddr",r).focus()};this.close=function(){this.opts.map.toggleView("directions",!1);u&&(u.setPanel(null),u.getMap()&&(u.setMap(null),this.opts.map.togglePois(!0)))};this.getDirections=function(){this.opts.map.closeInfoWindow();n(".mapp-spinner",r).show();var t=n(".mapp-dir-saddr",r),i=n(".mapp-dir-daddr",r),u=n(".mapp-dir-saddr-err",r),f=n(".mapp-dir-daddr-err",r);o.geocodeField(t,u,function(t){o.geocodeField(i,f,function(i){t&&i?h(t,i,function(){n(".mapp-spinner",r).hide();return}):n(".mapp-spinner",r).hide()})})};this.printDirections=function(){var i,t=n(".mapp-travelmode-on > span",r);i=t.hasClass("mapp-dir-walk")?"w":t.hasClass("mapp-dir-bike")?"b":t.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val(),i)};this.openGoogle=function(n,t,i){var r=mappl10n.options.directionsServer;r.toLowerCase().indexOf("http")==-1&&(r="https://"+r);r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}}}(jQuery);mapp=window.mapp||{};mapp.Geocoder=function(n){function r(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function u(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var t,f,i=this;f=n;this.geocode=function(i,r){typeof i=="string"&&i.substring(0,1)=="("&&(split=i.replace(/\(|\)/g,"").split(","),i=new google.maps.LatLng(split[0],split[1]));var u=i instanceof google.maps.LatLng?{location:i}:{address:i,region:mappl10n.options.country,bounds:n.getBounds()};t||(t=new google.maps.Geocoder);t.geocode(u,function(n,t){if(n){for(var i=0;i<n.length;i++)n[i].formatted_address==""&&n.splice(i,1);r(n[0],t)}else r(null,t)})};this.geolocate=function(n){if(!navigator||!navigator.geolocation)return null;navigator.geolocation.getCurrentPosition(function(t){n(t)},function(){n(null)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};this.stringToLatLng=function(n){var t=n.split(",",2),i=Number(t[0]),r=Number(t[1]);return isNaN(i)||isNaN(r)?!1:new google.maps.LatLng(i,r)};this.geocodeField=function(n,t,i){r(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){u(n,t,mappl10n.no_address);i(null);return}if(r&&r.formatted_address){jQuery(n).val(r.formatted_address);i(r.formatted_address);return}i(r);return})};this.autocompleteField=function(n,t,f,e,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(f).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(e).click(function(){return r(n,t),i.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else u(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,f,e){if(r(n,t),f=jQuery.trim(f),f==""){e(null);return}var o=i.stringToLatLng(f);if(o){e(o);return}if(f.substring(0,4)=="http"){e(f);return}i.geocode(f,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){u(n,t,mappl10n.no_address);e(null);return}e(i);return})}};mapp.Geocoder.parseAddress=function(n){return!n||n==""?{firstLine:"",secondLine:""}:(n.lastIndexOf(", USA")>0||n.lastIndexOf(", United States")>0)&&(n.lastIndexOf(", USA")>0&&(n=n.slice(0,n.lastIndexOf(", USA"))),n.lastIndexOf(", United States")>0&&(n=n.slice(0,n.lastIndexOf(", United States"))),n.indexOf(",")==n.lastIndexOf(","))?{firstLine:n,secondLine:""}:n.indexOf(",")==-1?{firstLine:n,secondLine:""}:{firstLine:n.slice(0,n.indexOf(",")),secondLine:n.slice(n.indexOf(", ")+2)}};mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({disableAutoPan:!1,border:20},i),u=null,r=null,e=null,o=this;r=n('<div class="mapp-ib" tabindex="0">').appendTo(t.getMap().getDiv());e=n('<div class="mapp-ib-tip">').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){o.close()});r.on("keydown",function(n){n.which==27&&o.close()});r.on("click",".mapp-close",function(){o.close()});this.getContent=function(){return r};this.setContent=function(n){r.empty().append(n)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){r.show();e.show();var t=n(":input",r);t.length?t.first().focus():r.focus();google.maps.event.trigger(o,"domready")};this.draw=function(){var l=this.getMap(),c=this.getProjection().fromLatLngToContainerPixel(u.position),t={width:n(l.getDiv()).width(),height:n(l.getDiv()).height()},v=n(".mapp-ib-body",r);if(!f.disableAutoPan){r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var s=r.outerWidth(!0),h=r.outerHeight(!0),a=e.outerHeight(!0),i=c.x,o=c.y;i+s/2>t.width&&(i=t.width-s/2);i-s/2<0&&(i=s/2);o-h+u.anchorPoint.y-a<f.border&&(o=h-u.anchorPoint.y+f.border+a);o>t.height&&(o=t.height);l.panBy(c.x-i,c.y-o);h>t.height+u.anchorPoint.y-2*f.border&&(h=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":h+2}));r.css({left:i-s/2,bottom:t.height-o-u.anchorPoint.y+a});e.css({left:i,bottom:t.height-o-u.anchorPoint.y})}};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.empty();r.hide();e.hide()}};mapp.InfoBox.prototype=new google.maps.OverlayView}(jQuery);mapp=window.mapp||{};+function(n){if(mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}},typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("ERROR: Google Maps API Key missing, please check MapPress settings and FAQ");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")});mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).attr("id"),t=window[i];t.resize();t.initCenter()})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;if(this.sel=n(t),this.opts=n.extend({map:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length){this.opts.types||(this.opts.types=[]);this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types});this.autocomplete.bindTo("bounds",this.opts.map.getMap());this.sel.on("keydown",function(n){n.which==13&&n.preventDefault()});google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())})}};mapp.Places.prototype={parse:function(t){var u,i=this,r,f;if(this.error(!1),r=t&&t.name?n.trim(t.name):n.trim(t),!r)return this.error(!0);if(r=="geolocate")return this.geolocate();if(r.substring(0,4)=="http"){google.maps.event.trigger(i,"search",r);return}if(t&&t.geometry){t.formatted_address&&this.set(t.formatted_address);google.maps.event.trigger(i,"search",t);return}if(f=this.parseLatLng(t),f){google.maps.event.trigger(i,"search",f);return}this.autocompleteService.getPlacePredictions({input:r,types:this.opts.types,bounds:this.opts.map.getMap().getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return i.error(!0);u=typeof n[0].description!="undefined"?n[0].description:null;i.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return i.error(!0);u=u?u:n.formatted_address;i.set(u);google.maps.event.trigger(i,"search",n)})})},parseLatLng:function(t){var r,i;return t instanceof google.maps.LatLng?t:t&&t.lat&&t.lng?new google.maps.LatLng(t.lat,t.lng):(r=t&&t.name?n.trim(t.name):n.trim(t),i=r.split(","),i.length==2&&!isNaN(i[0])&&!isNaN(i[1]))?new google.maps.LatLng(i[0],i[1]):null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){n.set("");google.maps.event.trigger(n,"search",new google.maps.LatLng(t.coords.latitude,t.coords.longitude))},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){n=n.replace(", United States of America","").replace(", USA","").replace(", United States","");this.sel.val(n);this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n)},destroy:function(){this.autocomplete.unbindAll();google.maps.event.clearInstanceListeners(this.sel.get(0))}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var f,e,r,s,i,u,h,o;if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),t.viewport&&t.viewport.sw&&t.viewport.ne&&(f=new google.maps.LatLng(t.viewport.sw.lat,t.viewport.sw.lng),e=new google.maps.LatLng(t.viewport.ne.lat,t.viewport.ne.lng),this.viewport=f.lat()==0&&f.lng()==0&&e.lat()==0&&e.lng()==0?null:new google.maps.LatLngBounds(f,e)),r=[],s=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],u=0;u<t.poly.paths[i].length;u++)r.push(new google.maps.LatLng(t.poly.paths[i][u].lat,t.poly.paths[i][u].lng));s.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:o,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":h=t.kml&&t.kml.url?t.kml.url:"";this.overlay=new google.maps.KmlLayer(h,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Marker({position:o})}};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},r=this.getPosition(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},setMap:function(t){var i=this;if(google.maps.event.clearInstanceListeners(this.overlay),t==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=t;this.overlay.setMap(t.getMap());this.setEditable(this.map.editable);this.setIcon(this.iconid);this.type||this.overlay.setTitle(n("<div>").html(this.title).text());google.maps.event.addListener(this.overlay,"click",function(n){i.open(n)})},setEditable:function(n){var t=this;this.type!="kml"&&(this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),google.maps.event.clearListeners(this.overlay,"rightclick"),google.maps.event.clearListeners(this.overlay,"dragstart"),n&&(google.maps.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.closeInfoWindow()}),(this.type=="polygon"||this.type=="polyline")&&google.maps.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},getZIndex:function(){return this.type?this.overlay.zIndex:this.overlay.getZIndex()},setZIndex:function(n){this.type?this.overlay.zIndex=n:this.overlay.setZIndex(n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n)),this.iconid=n)},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},center:function(n){var t=this.map.getMap(),i=this.getBounds();if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(parseInt(mappl10n.options.poiZoom)))},open:function(n){this.map.openInfoWindow(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.editable&&this.viewport)return this.viewport;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport?this.viewport:null}return n},getPosition:function(n){if(!this.type)return this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():new google.maps.LatLng(0,0)},click:function(){google.maps.event.trigger(this.overlay,"click")},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){return this.type=="kml"?n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0):this.type?new google.maps.Point(0,0):typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
|
languages/mappress-google-maps-for-wordpress.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the MapPress Easy Google Maps package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MapPress Easy Google Maps 2.47.
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
-
"POT-Creation-Date: 2017-10-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -97,43 +97,43 @@ msgstr ""
|
|
97 |
msgid "Size"
|
98 |
msgstr ""
|
99 |
|
100 |
-
#: languages/texts.php:20 mappress.php:
|
101 |
msgid "Version"
|
102 |
msgstr ""
|
103 |
|
104 |
-
#: languages/texts.php:21 mappress.php:
|
105 |
msgid "Documentation"
|
106 |
msgstr ""
|
107 |
|
108 |
-
#: languages/texts.php:22 mappress.php:
|
109 |
msgid "Support"
|
110 |
msgstr ""
|
111 |
|
112 |
-
#: languages/texts.php:23 mappress.php:
|
113 |
msgid "Upgrade to MapPress Pro"
|
114 |
msgstr ""
|
115 |
|
116 |
-
#: languages/texts.php:24 mappress.php:
|
117 |
msgid "MapPress database tables are missing. Please deactivate the plugin and activate it again to fix this."
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: languages/texts.php:25 mappress.php:
|
121 |
msgid "WARNING: MapPress now requires WordPress 3.2 or higher. Please upgrade before using MapPress."
|
122 |
msgstr ""
|
123 |
|
124 |
-
#: languages/texts.php:26 mappress.php:
|
125 |
msgid "WARNING: MapPress is not compfatible with the WP-Geo plugin. Please deactivate or uninstall WP-Geo before using MapPress."
|
126 |
msgstr ""
|
127 |
|
128 |
-
#: languages/texts.php:27 mappress.php:
|
129 |
msgid "A Google Maps API key is required"
|
130 |
msgstr ""
|
131 |
|
132 |
-
#: languages/texts.php:28 mappress.php:
|
133 |
msgid "Please update your"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: languages/texts.php:29 mappress.php:
|
137 |
msgid "MapPress Settings"
|
138 |
msgstr ""
|
139 |
|
@@ -149,7 +149,7 @@ msgstr ""
|
|
149 |
msgid "One of the addresses could not be found."
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: languages/texts.php:33 mappress.php:
|
153 |
msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
|
154 |
msgstr ""
|
155 |
|
@@ -161,7 +161,7 @@ msgstr ""
|
|
161 |
msgid "Directions"
|
162 |
msgstr ""
|
163 |
|
164 |
-
#: languages/texts.php:36 mappress.php:
|
165 |
msgid "Error reading KML file"
|
166 |
msgstr ""
|
167 |
|
@@ -169,11 +169,11 @@ msgstr ""
|
|
169 |
msgid "Loading..."
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: languages/texts.php:38 mappress.php:
|
173 |
msgid "No matching address"
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: languages/texts.php:39 mappress.php:
|
177 |
msgid "Unable to get your location"
|
178 |
msgstr ""
|
179 |
|
@@ -202,11 +202,11 @@ msgstr ""
|
|
202 |
msgid "Click to change"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: languages/texts.php:47 mappress.php:
|
206 |
msgid "Delete this POI?"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: languages/texts.php:48 mappress.php:
|
210 |
msgid "Delete this map?"
|
211 |
msgstr ""
|
212 |
|
@@ -214,7 +214,7 @@ msgstr ""
|
|
214 |
msgid "Please save the map first"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: languages/texts.php:50 mappress.php:
|
218 |
msgid "Shape"
|
219 |
msgstr ""
|
220 |
|
@@ -651,15 +651,15 @@ msgstr ""
|
|
651 |
msgid "Reset Defaults"
|
652 |
msgstr ""
|
653 |
|
654 |
-
#: languages/texts.php:160 mappress.php:
|
655 |
msgid "Settings"
|
656 |
msgstr ""
|
657 |
|
658 |
-
#: languages/texts.php:161 pro/mappress_updater.php:
|
659 |
msgid "download it now"
|
660 |
msgstr ""
|
661 |
|
662 |
-
#: languages/texts.php:162 pro/mappress_updater.php:
|
663 |
msgid "A PRO Version update is available for manual installation: %s"
|
664 |
msgstr ""
|
665 |
|
@@ -1188,7 +1188,11 @@ msgid "Open POI"
|
|
1188 |
msgstr ""
|
1189 |
|
1190 |
#: pro/mappress_pro_settings.php:229
|
1191 |
-
msgid "
|
|
|
|
|
|
|
|
|
1192 |
msgstr ""
|
1193 |
|
1194 |
#: pro/mappress_pro_settings.php:236
|
@@ -1219,11 +1223,11 @@ msgstr ""
|
|
1219 |
msgid "or "
|
1220 |
msgstr ""
|
1221 |
|
1222 |
-
#: pro/mappress_updater.php:
|
1223 |
msgid "Communication error"
|
1224 |
msgstr ""
|
1225 |
|
1226 |
-
#: pro/mappress_updater.php:
|
1227 |
msgid "JSON error"
|
1228 |
msgstr ""
|
1229 |
|
2 |
# This file is distributed under the same license as the MapPress Easy Google Maps package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MapPress Easy Google Maps 2.47.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
|
7 |
+
"POT-Creation-Date: 2017-10-31 23:18:12+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
97 |
msgid "Size"
|
98 |
msgstr ""
|
99 |
|
100 |
+
#: languages/texts.php:20 mappress.php:140
|
101 |
msgid "Version"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: languages/texts.php:21 mappress.php:148
|
105 |
msgid "Documentation"
|
106 |
msgstr ""
|
107 |
|
108 |
+
#: languages/texts.php:22 mappress.php:149
|
109 |
msgid "Support"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: languages/texts.php:23 mappress.php:151
|
113 |
msgid "Upgrade to MapPress Pro"
|
114 |
msgstr ""
|
115 |
|
116 |
+
#: languages/texts.php:24 mappress.php:422
|
117 |
msgid "MapPress database tables are missing. Please deactivate the plugin and activate it again to fix this."
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: languages/texts.php:25 mappress.php:427
|
121 |
msgid "WARNING: MapPress now requires WordPress 3.2 or higher. Please upgrade before using MapPress."
|
122 |
msgstr ""
|
123 |
|
124 |
+
#: languages/texts.php:26 mappress.php:432
|
125 |
msgid "WARNING: MapPress is not compfatible with the WP-Geo plugin. Please deactivate or uninstall WP-Geo before using MapPress."
|
126 |
msgstr ""
|
127 |
|
128 |
+
#: languages/texts.php:27 mappress.php:439
|
129 |
msgid "A Google Maps API key is required"
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: languages/texts.php:28 mappress.php:439
|
133 |
msgid "Please update your"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: languages/texts.php:29 mappress.php:439
|
137 |
msgid "MapPress Settings"
|
138 |
msgstr ""
|
139 |
|
149 |
msgid "One of the addresses could not be found."
|
150 |
msgstr ""
|
151 |
|
152 |
+
#: languages/texts.php:33 mappress.php:568
|
153 |
msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
|
154 |
msgstr ""
|
155 |
|
161 |
msgid "Directions"
|
162 |
msgstr ""
|
163 |
|
164 |
+
#: languages/texts.php:36 mappress.php:569
|
165 |
msgid "Error reading KML file"
|
166 |
msgstr ""
|
167 |
|
169 |
msgid "Loading..."
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: languages/texts.php:38 mappress.php:570
|
173 |
msgid "No matching address"
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: languages/texts.php:39 mappress.php:571
|
177 |
msgid "Unable to get your location"
|
178 |
msgstr ""
|
179 |
|
202 |
msgid "Click to change"
|
203 |
msgstr ""
|
204 |
|
205 |
+
#: languages/texts.php:47 mappress.php:572
|
206 |
msgid "Delete this POI?"
|
207 |
msgstr ""
|
208 |
|
209 |
+
#: languages/texts.php:48 mappress.php:573
|
210 |
msgid "Delete this map?"
|
211 |
msgstr ""
|
212 |
|
214 |
msgid "Please save the map first"
|
215 |
msgstr ""
|
216 |
|
217 |
+
#: languages/texts.php:50 mappress.php:574
|
218 |
msgid "Shape"
|
219 |
msgstr ""
|
220 |
|
651 |
msgid "Reset Defaults"
|
652 |
msgstr ""
|
653 |
|
654 |
+
#: languages/texts.php:160 mappress.php:134
|
655 |
msgid "Settings"
|
656 |
msgstr ""
|
657 |
|
658 |
+
#: languages/texts.php:161 pro/mappress_updater.php:150
|
659 |
msgid "download it now"
|
660 |
msgstr ""
|
661 |
|
662 |
+
#: languages/texts.php:162 pro/mappress_updater.php:154
|
663 |
msgid "A PRO Version update is available for manual installation: %s"
|
664 |
msgstr ""
|
665 |
|
1188 |
msgstr ""
|
1189 |
|
1190 |
#: pro/mappress_pro_settings.php:229
|
1191 |
+
msgid "Open post"
|
1192 |
+
msgstr ""
|
1193 |
+
|
1194 |
+
#: pro/mappress_pro_settings.php:229
|
1195 |
+
msgid "Open post in new tab"
|
1196 |
msgstr ""
|
1197 |
|
1198 |
#: pro/mappress_pro_settings.php:236
|
1223 |
msgid "or "
|
1224 |
msgstr ""
|
1225 |
|
1226 |
+
#: pro/mappress_updater.php:118
|
1227 |
msgid "Communication error"
|
1228 |
msgstr ""
|
1229 |
|
1230 |
+
#: pro/mappress_updater.php:124
|
1231 |
msgid "JSON error"
|
1232 |
msgstr ""
|
1233 |
|
languages/texts.php
CHANGED
@@ -291,7 +291,8 @@ __("License is invalid or expired");
|
|
291 |
__("POI title + body");
|
292 |
__("Post title + excerpt");
|
293 |
__("Open POI");
|
294 |
-
__("
|
|
|
295 |
__("Address line ");
|
296 |
__("Map Field");
|
297 |
__("Overwrite maps when posts are saved");
|
291 |
__("POI title + body");
|
292 |
__("Post title + excerpt");
|
293 |
__("Open POI");
|
294 |
+
__("Open post");
|
295 |
+
__("Open post in new tab");
|
296 |
__("Address line ");
|
297 |
__("Map Field");
|
298 |
__("Overwrite maps when posts are saved");
|
mappress.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Easy Google Maps
|
|
4 |
Plugin URI: http://www.wphostreviews.com/mappress
|
5 |
Author URI: http://www.wphostreviews.com/mappress
|
6 |
Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
|
7 |
-
Version: 2.47.
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
@@ -34,7 +34,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
|
|
34 |
}
|
35 |
|
36 |
class Mappress {
|
37 |
-
const VERSION = '2.47.
|
38 |
|
39 |
static
|
40 |
$baseurl,
|
@@ -106,8 +106,14 @@ class Mappress {
|
|
106 |
$posts_table = $wpdb->prefix . 'mappress_posts';
|
107 |
$results = $wpdb->get_results("SELECT postid, mapid FROM $posts_table");
|
108 |
echo "<br/>postid => mapid";
|
109 |
-
foreach($results as $result)
|
|
|
|
|
110 |
echo "<br/>$result->postid => $result->mapid";
|
|
|
|
|
|
|
|
|
111 |
die();
|
112 |
}
|
113 |
|
4 |
Plugin URI: http://www.wphostreviews.com/mappress
|
5 |
Author URI: http://www.wphostreviews.com/mappress
|
6 |
Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
|
7 |
+
Version: 2.47.4
|
8 |
Author: Chris Richardson
|
9 |
Text Domain: mappress-google-maps-for-wordpress
|
10 |
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
|
34 |
}
|
35 |
|
36 |
class Mappress {
|
37 |
+
const VERSION = '2.47.4';
|
38 |
|
39 |
static
|
40 |
$baseurl,
|
106 |
$posts_table = $wpdb->prefix . 'mappress_posts';
|
107 |
$results = $wpdb->get_results("SELECT postid, mapid FROM $posts_table");
|
108 |
echo "<br/>postid => mapid";
|
109 |
+
foreach($results as $i => $result) {
|
110 |
+
if ($i > 50)
|
111 |
+
break;
|
112 |
echo "<br/>$result->postid => $result->mapid";
|
113 |
+
}
|
114 |
+
$options = Mappress_Options::get();
|
115 |
+
unset($options->license, $options->apiKey, $options->apiKeyServer);
|
116 |
+
echo str_replace(array("\r", "\n"), array('<br/>', '<br/>'), print_r($options, true));
|
117 |
die();
|
118 |
}
|
119 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.9
|
7 |
-
Stable tag: 2.47.
|
8 |
|
9 |
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
|
10 |
|
@@ -86,8 +86,19 @@ Please see the plugin documentation pages:
|
|
86 |
|
87 |
== Changelog ==
|
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
= 2.47.1 =
|
90 |
-
* Changed: the settings for mashup POI title and body display have been combined. Select either poi title + body or post title + excerpt. For shortcodes use [
|
91 |
|
92 |
= 2.47 =
|
93 |
* Added: filter dropdown now includes icons from the 'automatic icons' setting (for use as a map legend)
|
@@ -137,7 +148,7 @@ Please see the plugin documentation pages:
|
|
137 |
* Added: NEW TEMPLATES - this release includes all new template files - please update any custom templates to match the new versions.
|
138 |
* Added: mashup results can now be filtered by taxonomies, see the MapPress settings screen
|
139 |
* Added: setting 'Automatic updates' allows automatic updates for the Pro version
|
140 |
-
* Added: new layout with POIs on the left instead of under map, enable with: [
|
141 |
* Added: check for multiple Google Maps API loads
|
142 |
* Changed: template names now use hyphens instead of underscores and some names have changed: map_layout.php => map.php, map_poi_list.php => map-list.php
|
143 |
* Changed: CSS class names, for example for the POI list class '.mapp-poi-list' is now '.mapp-list'. Please update any custom CSS.
|
@@ -173,7 +184,7 @@ Please see the plugin documentation pages:
|
|
173 |
* Added: POI list sorting can now be set via the settings screen, the default is no sort
|
174 |
* Added: POI list can now be clicked anywhere to select a POI (not just the POI title)
|
175 |
* Added: a new 'hamburger' menu on the map provides map functions including centering and the bicycling, traffic, and transit layers
|
176 |
-
* Added: a new 'layers' shortcode attribute enables bicycling/transit/traffic layers when map is initially displayed, for example [
|
177 |
* Changed: autoicons function simplified: only 1 rule type is allowed, unfortunately you must *re-enter* any existing autoicons settings.
|
178 |
* Changed: mashup settings are now global including infowindow type ('iwtype'), POI body ('mashupBody'), and POI title ('mashupTtitle') - use the settings screen to set them, NOT the shortcode
|
179 |
* Changed: obsolete map control settings have been removed, and settings have been simplified to match Google defaults
|
@@ -269,7 +280,7 @@ Please see the plugin documentation pages:
|
|
269 |
* Fixed: public variables caused query errors with null queries
|
270 |
|
271 |
= 2.43.1 =
|
272 |
-
* Added: wp_query public variables can be included in queries, for example [
|
273 |
* Fixed: drawing manager not showing up in editor
|
274 |
|
275 |
= 2.43 =
|
@@ -328,7 +339,7 @@ Please see the plugin documentation pages:
|
|
328 |
|
329 |
= 2.40.8 =
|
330 |
* Added: workaround for Google infoWindow sizing bug
|
331 |
-
* Added: shortcode parameters 'from' and 'to' can be used to set a default for all directions. Use a string or POI number, for example [
|
332 |
* Fixed: layout style was incorrect if map layout had rounded corners; this also prevented show="hidden" from working.
|
333 |
* Fixed: filter 'mappress_poi_iconid' was being called as 'mapress_poi_iconid' (with one 'p' instead of two)
|
334 |
* Fixed: Google CSS made copyright appear vertical in IE in some themes
|
4 |
Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
|
5 |
Requires at least: 3.5
|
6 |
Tested up to: 4.9
|
7 |
+
Stable tag: 2.47.4
|
8 |
|
9 |
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
|
10 |
|
86 |
|
87 |
== Changelog ==
|
88 |
|
89 |
+
= 2.47.4 =
|
90 |
+
* Added: setting to open POIs in a new tab/window. For shortcodes use [mashup mashupClick="postnew"]
|
91 |
+
* Fixed: mashups for custom post types were displaying all post types
|
92 |
+
* Fixed: maps saved from custom fields in older versions were not auto-centering properly
|
93 |
+
|
94 |
+
= 2.47.3 =
|
95 |
+
* Fixed: Pro version updater bug fixes
|
96 |
+
|
97 |
+
= 2.47.2 =
|
98 |
+
* Fixed: Pro version automatic updater was not notifying about new updates (it may be necessary to update to the current version manually).
|
99 |
+
|
100 |
= 2.47.1 =
|
101 |
+
* Changed: the settings for mashup POI title and body display have been combined. Select either poi title + body or post title + excerpt. For shortcodes use [mashup mashupbody="poi"] for poi title + body, or [mashup mashupbody="post"] for post title + excerpt
|
102 |
|
103 |
= 2.47 =
|
104 |
* Added: filter dropdown now includes icons from the 'automatic icons' setting (for use as a map legend)
|
148 |
* Added: NEW TEMPLATES - this release includes all new template files - please update any custom templates to match the new versions.
|
149 |
* Added: mashup results can now be filtered by taxonomies, see the MapPress settings screen
|
150 |
* Added: setting 'Automatic updates' allows automatic updates for the Pro version
|
151 |
+
* Added: new layout with POIs on the left instead of under map, enable with: [mappresss layout="left"]
|
152 |
* Added: check for multiple Google Maps API loads
|
153 |
* Changed: template names now use hyphens instead of underscores and some names have changed: map_layout.php => map.php, map_poi_list.php => map-list.php
|
154 |
* Changed: CSS class names, for example for the POI list class '.mapp-poi-list' is now '.mapp-list'. Please update any custom CSS.
|
184 |
* Added: POI list sorting can now be set via the settings screen, the default is no sort
|
185 |
* Added: POI list can now be clicked anywhere to select a POI (not just the POI title)
|
186 |
* Added: a new 'hamburger' menu on the map provides map functions including centering and the bicycling, traffic, and transit layers
|
187 |
+
* Added: a new 'layers' shortcode attribute enables bicycling/transit/traffic layers when map is initially displayed, for example [mappress layers="bicycling"]
|
188 |
* Changed: autoicons function simplified: only 1 rule type is allowed, unfortunately you must *re-enter* any existing autoicons settings.
|
189 |
* Changed: mashup settings are now global including infowindow type ('iwtype'), POI body ('mashupBody'), and POI title ('mashupTtitle') - use the settings screen to set them, NOT the shortcode
|
190 |
* Changed: obsolete map control settings have been removed, and settings have been simplified to match Google defaults
|
280 |
* Fixed: public variables caused query errors with null queries
|
281 |
|
282 |
= 2.43.1 =
|
283 |
+
* Added: wp_query public variables can be included in queries, for example [mashup query="cat=@cat"] to show posts in the current category
|
284 |
* Fixed: drawing manager not showing up in editor
|
285 |
|
286 |
= 2.43 =
|
339 |
|
340 |
= 2.40.8 =
|
341 |
* Added: workaround for Google infoWindow sizing bug
|
342 |
+
* Added: shortcode parameters 'from' and 'to' can be used to set a default for all directions. Use a string or POI number, for example [mappress from="2"] or [mappress from="Mountain View, CA"]
|
343 |
* Fixed: layout style was incorrect if map layout had rounded corners; this also prevented show="hidden" from working.
|
344 |
* Fixed: filter 'mappress_poi_iconid' was being called as 'mapress_poi_iconid' (with one 'p' instead of two)
|
345 |
* Fixed: Google CSS made copyright appear vertical in IE in some themes
|
templates/map-filters.php
CHANGED
@@ -8,5 +8,4 @@
|
|
8 |
</div>
|
9 |
<span class='mapp-button-submit mapp-filters-done' data-mapp-action='filters-toggle'><?php _e('Done', 'mappress-google-maps-for-wordpress');?></span>
|
10 |
<span class='mapp-button mapp-filters-reset' data-mapp-action='filters-reset'><?php _e('Reset', 'mappress-google-maps-for-wordpress');?></span>
|
11 |
-
|
12 |
</div>
|
8 |
</div>
|
9 |
<span class='mapp-button-submit mapp-filters-done' data-mapp-action='filters-toggle'><?php _e('Done', 'mappress-google-maps-for-wordpress');?></span>
|
10 |
<span class='mapp-button mapp-filters-reset' data-mapp-action='filters-reset'><?php _e('Reset', 'mappress-google-maps-for-wordpress');?></span>
|
|
|
11 |
</div>
|