MapPress Easy Google Maps - Version 2.43.4

Version Description

Download this release

Release Info

Developer chrisvrichardson
Plugin Icon 128x128 MapPress Easy Google Maps
Version 2.43.4
Comparing to
See all releases

Code changes from version 2.43.3 to 2.43.4

images/geolocate.png ADDED
Binary file
js/mappress.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(){mapp.Map=function(n){function vt(){var s,v,f;if(!c&&(c=["roadmap","satellite","terrain","hybrid"],mappl10n.styles))for(s in mappl10n.styles)c.push(s);for(e=e?new google.maps.LatLng(n.center.lat,n.center.lng):new google.maps.LatLng(0,0),v={backgroundColor:"transparent",center:e,draggable:ri,keyboardShortcuts:ht,mapTypeControl:ci,mapTypeControlOptions:{style:li,mapTypeIds:c},maxZoom:vi,minZoom:yi,overviewMapControl:pi,overviewMapControlOptions:{opened:wi},panControl:bi,rotateControl:di,scaleControl:gi,scrollwheel:nr,streetViewControl:rr,tilt:fr,zoom:l?l:0,zoomControl:hr,zoomControlOptions:{style:cr}},i=new google.maps.Map(a,v),f=0;f<t.length;f++)t[f].setMap(r);lr();r.setMapTypeId(pt);ar();h=="ib"?(mapp.InfoBox.prototype=new google.maps.OverlayView,u=new mapp.InfoBox):u=new google.maps.InfoWindow;h=="ib"&&(ht=!1);ft=new mapp.Geocoder(r,hi,ni);ot!="none"&&(o=new mapp.Directions(r,ot,ft,ti,ii));r.initCenter()}function lr(){var n,t,r;for(n in mappl10n.styles)t=mappl10n.styles[n],r=new google.maps.StyledMapType(t,{name:n}),i.mapTypes.set(n,r),ur==n&&i.setOptions({styles:t})}function ar(){or&&et("traffic",mappl10n.traffic,oi);kt&&et("bicycling",mappl10n.bike,fi);sr&&et("transit",mappl10n.transit,si)}function et(n,t,r){var e=f+"_"+n,o=r?"checked='checked'":"",s="<div class='gmnoprint mapp-control'><input type='checkbox' id='"+e+"' "+o+" /> "+t+"<\/div>",u=jQuery(s).get(0);i.controls[google.maps.ControlPosition.TOP_RIGHT].push(u);r&&yt(n);google.maps.event.clearListeners(u,"click");google.maps.event.addDomListener(u,"click",function(){yt(n)})}function yt(n){var r=f+"_"+n,t;switch(n){case"transit":d=d?d:new google.maps.TransitLayer;t=d;break;case"traffic":k=k?k:new google.maps.TrafficLayer;t=k;break;case"bicycling":b=b?b:new google.maps.BicyclingLayer;t=b}t.getMap()?(jQuery("#"+r).prop("checked",!1),t.setMap(null)):(jQuery("#"+r).prop("checked",!0),t.setMap(i))}var e=n.center,p=n.height,s=n.mapid,pt=n.mapTypeId?n.mapTypeId:"roadmap",wt=n.metaKey,f=n.name,bt=n.options,tt=n.query,it=n.title,w=n.width,l=parseInt(n.zoom,10),kt=n.options.bicycling,dt=n.options.bigHeight,gt=n.options.bigWidth,ni=n.options.country,rt=n.options.dataTables,ot=n.options.directions,ti=n.options.directionsServer,ii=n.options.directionsUnits,ri=n.options.draggable,ui=n.options.editable,st=n.options.from,fi=n.options.initialBicycling,ei=n.options.initialOpenDirections,ut=n.options.initialOpenInfo,oi=n.options.initialTraffic,si=n.options.initialTransit,h=n.options.iwType,ht=n.options.keyboardShortcuts,hi=n.options.language,ci=n.options.mapTypeControl,li=parseInt(n.options.mapTypeControlStyle,10),c=n.options.mapTypeIds,ai=n.options.mashupClick,vi=parseInt(n.options.maxZoom),yi=parseInt(n.options.minZoom),pi=n.options.overviewMapControl,wi=n.options.overviewMapControlOpened,bi=n.options.panControl,ki=n.options.poiZoom,di=n.options.rotateControl,gi=n.options.scaleControl,nr=n.options.scrollwheel,tr=n.height,ir=n.width,rr=n.options.streetViewControl,ur=n.options.style,fr=parseInt(n.options.tilt),ct=n.options.to,er=n.options.tooltips,or=n.options.traffic,sr=n.options.transit,hr=n.options.zoomControl,cr=parseInt(n.options.zoomControlStyle,10),r=this,b,k,d,o=null,g,lt,nt,a,v,ft=null,i=null,u=null,t=[],at=!1,y;this.display=function(){if(g=jQuery("#"+f+"_dialog"),lt=jQuery("#"+f+"_directions"),nt=jQuery("#"+f+"_layout"),a=document.getElementById(f),v=jQuery("#"+f+"_poi_list"),!a){typeof console!="undefined"&&console.log("MapPress: Missing map name or container for map: "+f);return}if(typeof google=="undefined"){typeof console!="undefined"&&console.log("MapPress: Google API not loaded");return}if(y=google.maps.Marker.MAX_ZINDEX,lt.append(jQuery("#"+f+"_directions_").contents()),v.append(jQuery("#"+f+"_poi_list_").contents()),this.setDataTables(),tt){this.ajaxQuery(function(){vt()});return}r.setPois(n.pois,!1);vt()};this.getQuery=function(){return tt};this.setQuery=function(n){tt=n};this.setDialog=function(n){n=n?n:'<span class="mapp-spinner"><\/span>'+mappl10n.loading;n='<div class="mapp-dialog-inner">'+n+"<\/div>";jQuery(g).html(n);jQuery(g).show()};this.hideDialog=function(){jQuery(g).hide()};this.setPoiList=function(n){typeof n=="string"?v.html(n):v.append(n);this.setDataTables()};this.setDataTables=function(){if(rt&&typeof jQuery.fn.dataTable!="undefined"){var n=rt==!0?{bFilter:!1,bPaginate:!1}:rt;jQuery("table",v).dataTable(n)}};this.getOptions=function(){return bt};this.getResized=function(){return at};this.show=function(){nt.show();this.display()};this.closeInfoWindow=function(){u.close()};this.openDirections=function(n,t,i){var r,u;typeof n=="object"?(r=n.address?n.address:n.getPosition().toUrlValue(),n.open()):r=n;typeof t=="object"?(u=t.address?t.address:t.getPosition().toUrlValue(),t.open()):u=t;o.open(r,u,i)};this.setMapTypeId=function(n){n=n&&jQuery.inArray(n,c)!=-1?n:c[0];i.setMapTypeId(n)};this.setCenter=function(n,t){i.setCenter(new google.maps.LatLng(n,t))};this.setZoom=function(n){i.setZoom(n)};this.getPoiZoom=function(){return parseInt(ki)};this.poiToFront=function(n){y++;n.setZIndex(y)};this.getMap=function(){return i};this.getGeocoder=function(){return ft};this.getName=function(){return f};this.setName=function(n){f=n};this.getMapid=function(){return s};this.setMapid=function(n){s=n};this.getTitle=function(){return it};this.setTitle=function(n){it=n};this.getWidth=function(){return w};this.setWidth=function(n){w=n};this.getHeight=function(){return p};this.setHeight=function(n){p=n};this.getInfoWindow=function(){return u};this.getEditable=function(){return ui};this.getTooltips=function(){return er};this.getPoi=function(n){return typeof n=="string"&&(n=parseInt(n,10)),t[n]};this.getPoiById=function(n){for(var i=0;i<t.length;i++)if(t[i].postid==n)return t[i];return null};this.getPois=function(){return t};this.insertPoi=function(n){t.unshift(n);n.setMap(this)};this.addPoi=function(n){t.push(n);n.setMap(this)};this.removePoi=function(n){var i=jQuery.inArray(n,t);i!=-1&&(t[i].setMap(null),t.splice(i,1))};this.setPois=function(n,i){for(var u,r=0;r<t.length;r++)t[r].setMap(null);for(t=[],r=0;r<n.length;r++)u=new mapp.Poi,u.fromJSON(n[r]),t.push(u),i&&u.setMap(this),u.setZIndex(y+n.length-1-r);y+=n.length-1};this.showPois=function(){for(var n=0;n<t.length;n++)t[n].setVisible(!0)};this.hidePois=function(){for(var n=0;n<t.length;n++)t[n].setVisible(!1)};this.sortPois=function(n){for(var u,i=Array(),r=0;r<n.length;r++){if(u=parseInt(n[r]),isNaN(u))return!1;i.push(t[u])}return i.length!=t.length?!1:(t=i,!0)};this.openPoi=function(n,t){var u,i;if(h&&h!="none"){if(ai=="post"&&n.postid){window.location.assign(mappl10n.options.siteUrl+"?p="+n.postid);return}i={html:null};google.maps.event.trigger(r,"poicontent",n,i);u=i.content?i.content:t&&typeof t.featureData!="undefined"?t.featureData.infoWindowHtml:n.html;this.openInfoWindow(n,u,t)}};this.openInfoWindow=function(n,t,f){(o&&o.close(),h&&h!="none")&&(this.poiToFront(n),u.close(),u.setContent(t),google.maps.event.addListenerOnce(u,"domready",function(){google.maps.event.trigger(r,"poidomready",n)}),n.type=="kml"&&f?(u.setOptions({pixelOffset:f.pixelOffset,position:f.latLng}),u.open(i)):n.type?(u.setOptions({position:n.getPosition()}),u.open(i)):u.open(i,n.overlay))};this.closeInfoWindow=function(){u.close()};this.resize=function(n,t){var r=i.getCenter();n&&t&&(jQuery(a).width(n),jQuery(a).height(t),w=n,p=t);google.maps.event.trigger(i,"resize");i.setCenter(r);at=!0;return};this.initCenter=function(){if(this.closeInfoWindow(),google.maps.event.addListenerOnce(i,"idle",function(){r.initWindows()}),e&&e.lat()&&e.lng())i.setCenter(e),i.setZoom(l);else{var n=l?l:!0;r.autoCenter(n)}};this.initWindows=function(){var i,n,t;o&&ei?(n=jQuery.trim(st),t=st==null&&ct==null?"0":jQuery.trim(ct),n=jQuery.isNumeric(n)?this.getPoi(n):n,t=jQuery.isNumeric(t)?this.getPoi(t):t,typeof n=="object"?n.center(!1):typeof t=="object"&&t.center(!1),r.openDirections(n,t,!1)):ut&&(i=jQuery.isNumeric(ut)?r.getPoi(ut):r.getPoi(0),i&&i.open())};this.autoCenter=function(n){var r,u,f;if(t.length==0){this.setCenter(0,0);typeof n=="number"?i.setZoom(n):i.setZoom(1);return}if(t.length==1){t[0].center(n);return}for(r=new google.maps.LatLngBounds,u=0;u<t.length;u++)f=t[u].getBounds(),r=f?r.union(f):r.extend(t[u].getPosition());if(n===!1){i.setCenter(r.getCenter());return}if(typeof n=="number"){i.setCenter(r.getCenter());i.setZoom(n);return}i.fitBounds(r)};this.reset=function(){this.initCenter()};this.bigger=function(n,t,i){o&&o.close();this.closeInfoWindow();jQuery(n).text()==t?(jQuery(n).text(i),jQuery(nt).width(gt),this.resize("100%",dt)):(jQuery(n).text(t),jQuery(nt).width(ir),this.resize("100%",tr))};this.toJSON=function(){return{center:{lat:i.getCenter().lat(),lng:i.getCenter().lng()},height:p,mapid:s,mapTypeId:i.getMapTypeId(),metaKey:wt,pois:t,title:it,width:w,zoom:i.getZoom()}};this.ajaxSave=function(n){var t,i;t=typeof Prototype!="undefined"&&typeof Object.toJSON!="undefined"?Object.toJSON(r):t=JSON.stringify(r);i={action:"mapp_save",map:t,postid:mappl10n.options.postid};mapp.Ajax("POST",i,function(t){t.status=="OK"&&(s=t.data.mapid,n(t.data))})};this.ajaxDelete=function(n){s||n();var t={action:"mapp_delete",mapid:s};mapp.Ajax("POST",t,function(t){t.status=="OK"&&n()})}};mapp.Map.ajaxCreate=function(n,t,i){mapp.Ajax("GET",{action:"mapp_create"},function(r){if(r.status=="OK"){jQuery.extend(r.data.map.options,t);r.data.map.name=n;var u=new mapp.Map(r.data.map);i(u)}})};mapp.Map.ajaxGet=function(n,t,i,r){var u={action:"mapp_get",mapid:n};mapp.Ajax("GET",u,function(n){if(n.status=="OK"){jQuery.extend(n.data.map.options,i);n.data.map.name=t;var u=new mapp.Map(n.data.map);r(u)}})};mapp.Map.ajaxDelete=function(n,t){var i={action:"mapp_delete",mapid:n};mapp.Ajax("POST",i,function(n){n.status=="OK"&&t&&t()})};mapp.Ajax=function(n,t,i){jQuery.ajax({type:n,cache:!1,url:mappl10n.options.ajaxurl,data:t,success:function(n){if(n.output&&(mappl10n.options.admin||mappl10n.options.debug)&&alert("AJAX Error\r\n"+n.output),n.status=="OK"){i(n);return}(mappl10n.options.admin||mappl10n.options.debug)&&(typeof n=="object"?alert("AJAX Error\r\n"+n.status):alert("AJAX Error\r\n"+n))},error:function(n,t,i){typeof i!="undefined"&&i!=""&&mappl10n.ajaxErrors&&alert("AJAX ERROR\r\nStatus="+t+"\r\nError="+i+"\r\nResponseText="+n.responseText)}})}}(jQuery);mapp=window.mapp||{};mapp.Directions=function(n,t,i,r,u){function p(){jQuery(".mapp-dir-swap",f).click(function(){var n=jQuery(".mapp-dir-daddr",f).val(),t=jQuery(".mapp-dir-saddr",f).val();return jQuery(".mapp-dir-saddr",f).val(n),jQuery(".mapp-dir-daddr",f).val(t),jQuery(".mapp-dir-get",f).click(),!1});jQuery(".mapp-dir-get",f).click(function(){return s.getDirections(),!1});jQuery(".mapp-dir-print",f).click(function(){s.printDirections()});jQuery(".mapp-dir-close",f).click(function(){return s.close(),!1});jQuery(".mapp-travelmode",f).click(function(){return jQuery(".mapp-travelmode",f).removeClass("mapp-travelmode-on"),jQuery(this).addClass("mapp-travelmode-on"),s.getDirections(),!1});jQuery(".mapp-myloc",f).click(function(){return c.geolocate(function(n){n?(jQuery(".mapp-dir-saddr",f).val("("+n.coords.latitude+", "+n.coords.longitude+")"),jQuery(".mapp-dir-get",f).click()):alert(mappl10n.no_geolocate)}),!1})}function w(n,t,i){var u=jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var o={travelMode:u,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:n,destination:t,unitSystem:y},r=jQuery(".mapp-dir-renderer",f).get(0);jQuery(".mapp-dir-renderer",f).empty();l||(l=new google.maps.DirectionsService);l.route(o,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:h.hidePois();e?(e.setDirections(n),e.setMap(a),e.setPanel(r)):e=new google.maps.DirectionsRenderer({map:a,panel:r,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_not_found);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_zero_results);break;default:alert(mappl10n.dir_default+t)}i()})}var h=n,v=t,c=i,o=r,y=u,f=jQuery("#"+n.getName()+"_directions"),e,l,a=n.getMap(),s=this;o.toLowerCase().indexOf("http")==-1&&(o="https://"+o);p();this.open=function(n,t,i){if(v=="google"){this.openGoogle(n,t);return}jQuery(f).show();jQuery(".mapp-dir-saddr",f).val(n);jQuery(".mapp-dir-daddr",f).val(t);(i||typeof i=="undefined")&&(jQuery(".mapp-dir-get",f).focus(),jQuery(".mapp-dir-saddr",f).focus())};this.close=function(){jQuery(f).hide();e&&(e.setPanel(null),e.getMap()&&(e.setMap(null),h.showPois()))};this.getDirections=function(){h.closeInfoWindow();jQuery(".mapp-spinner",f).show();var n=jQuery(".mapp-dir-saddr",f),t=jQuery(".mapp-dir-daddr",f),i=jQuery(".mapp-dir-saddr-err",f),r=jQuery(".mapp-dir-daddr-err",f);c.geocodeField(n,i,function(n){c.geocodeField(t,r,function(t){n&&t?w(n,t,function(){jQuery(".mapp-spinner",f).hide();return}):jQuery(".mapp-spinner",f).hide()})})};this.printDirections=function(){var t,n=jQuery(".mapp-travelmode-on > span",f);t=n.hasClass("mapp-dir-walk")?"w":n.hasClass("mapp-dir-bike")?"b":n.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(jQuery(".mapp-dir-saddr",f).val(),jQuery(".mapp-dir-daddr",f).val(),t)};this.openGoogle=function(n,t,i){var r=o;r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}};mapp=window.mapp||{};mapp.Geocoder=function(n,t,i){function f(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function e(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var o,u,s,h,c,r;o=i;h=t;c=n;s=c.getMap();r=this;this.geocode=function(n,t){var i=n instanceof google.maps.LatLng?{latLng:n}:{address:n,region:o,language:h};i.bounds=s.getBounds();u||(u=new google.maps.Geocoder);u.geocode(i,function(n,i){if(n){for(var r=0;r<n.length;r++)n[r].formatted_address==""&&n.splice(r,1);t(n[0],i)}else t(null,i)})};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){f(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){e(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,i,u,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(i).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(u).click(function(){return f(n,t),r.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else e(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,i,u){if(f(n,t),i=jQuery.trim(i),i==""){u(null);return}var o=r.stringToLatLng(i);if(o){u(o);return}if(i.substring(0,4)=="http"){u(i);return}r.geocode(i,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){e(n,t,mappl10n.no_address);u(null);return}u(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||{};mapp.InfoBox=function(){var u,f,n,i,t,r=this;this.setContent=function(n){u=n};this.onAdd=function(){n=jQuery("<div class='mapp-ib'><div class='mapp-ib-close'>X<\/div><\/div>");t=jQuery("<div class='mapp-ib-tip'><\/div>");typeof u=="string"?jQuery(n).append(u):jQuery(n).append(jQuery(u));jQuery("body").append(n);jQuery("body").append(t);jQuery(".mapp-ib-close",n).click(function(){r.close()});jQuery(window).resize(function(){r.close()})};this.draw=function(){var c=jQuery(n).is(":visible"),u=r.getProjection().fromLatLngToContainerPixel(i),f,o,s;if(u.x=parseInt(u.x),u.y=parseInt(u.y),f=jQuery(this.getMap().getDiv()),u.x>f.width()||u.x<0||u.y>f.height()||u.y<0){jQuery(n).hide();jQuery(t).hide();return}jQuery(n).show();jQuery(t).show();o=f.offset().left+u.x;s=f.offset().top+u.y-32;jQuery(t).offset({top:s-t.outerHeight()-2,left:o-parseInt(t.outerWidth()/2)});var e=o-parseInt(n.outerWidth()/2),l=s-n.outerHeight()-t.outerHeight(),h=jQuery(document).width();e+n.outerWidth()>h&&(e=Math.max(h-n.outerWidth(),o-n.outerWidth()+parseInt(t.outerWidth()/2)));e<0&&(e=0);jQuery(n).offset({top:l,left:e});c||google.maps.event.trigger(this,"domready")};this.onRemove=function(){jQuery(n).remove();jQuery(t).remove()};this.setPosition=function(n){i=n};this.open=function(n,t){f=n;t&&(i=typeof t.getPosition=="function"?t.getPosition():t.getBounds().getCenter());this.setMap(f);this.disableAutoPan&&n.getBounds().contains(i)||f.panTo(i);google.maps.event.addListenerOnce(n,"drag",function(){r.close()});google.maps.event.addListenerOnce(n,"click",function(){r.close()})};this.close=function(){google.maps.event.trigger(this,"closeclick");this.setMap(null)}};mapp=window.mapp||{};this.JSON||(this.JSON={}),function(){function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var h,c,l,a,v=n,s,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i));typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,s=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return l=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,l}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)c=t[h],typeof c=="string"&&(l=r(c,o))&&s.push(f(c)+(n?": ":":")+l);else for(c in o)Object.hasOwnProperty.call(o,c)&&(l=r(c,o))&&s.push(f(c)+(n?": ":":")+l);return l=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,l}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(u=n="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if((t=f)&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw Error("JSON.stringify");return r("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),e.lastIndex=0,e.test(n)&&(n=n.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*#x2F;.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}();mapp.lib={ajax:function(n){var i,t;if(jQuery.extend({type:"GET",cache:!1,data:null,spinner:null,callback:jQuery.noop},n),n.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),i=JSON.stringify(n.data),t=0;t<mapp.lib.ajax.cache.length;t++)if(mapp.lib.ajax.cache[t].data==i){n.callback(mapp.lib.ajax.cache[t].response);return}n.spinner&&mapp.lib.spinner(n.spinner,!0);jQuery.ajax({type:n.type,cache:!1,url:mappl10n.options.ajaxurl,data:n.data,success:function(t,i,r){if(mapp.lib.spinner(n.spinner,!1),t.output&&(mappl10n.options.admin||mappl10n.options.debug)){alert("AJAX Error\r\n"+t.output);return}if(t.status=="OK"){n.cache&&mapp.lib.ajax.cache.push({data:JSON.stringify(n.data),response:t});n.callback&&n.callback(t,i,r);return}if(mappl10n.options.admin||mappl10n.options.debug){var u=typeof t=="object"?t.status:t;alert("AJAX ERROR\r\nResponse="+u+" TextStatus="+i+"\r\nResponseText="+r.responseText);return}},error:function(t,i,r){if((n.spinner&&mapp.lib.spinner(n.spinner,!1),typeof r!="undefined"&&r!="")&&(mappl10n.options.admin||mappl10n.options.debug)){alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+r+"\r\nResponseText="+t.responseText);return}}})},spinner:function(n,t){return t?(jQuery(n).addClass("mapp-spinner"),jQuery(n).prepend('<div class="mapp-spinner-overlay"><\/div><div class="mapp-spinner-icon"><\/div>')):(jQuery(n).removeClass("mapp-spinner"),jQuery(".mapp-spinner-overlay, .mapp-spinner-icon",n).remove()),n},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var r=jQuery(n).scrollTop(),u=jQuery(n).height(),i=jQuery(t).position().top,f=i+jQuery(t).height();(i<0||f>u)&&jQuery(n).scrollTop(r+i)}},stringToInt:function(n){for(arg in n){var t=n[arg];typeof t=="object"?mapp.lib.stringToInt(t):n[arg]=jQuery.isNumeric(t)?parseInt(t):t}return n}};jQuery("body").on("tabsactivate tabsshow",function(n,t){var i=t.newPanel?t.newPanel:t.panel;i&&jQuery(".mapp-canvas",i).each(function(){var n=jQuery(this).attr("id");window[n].resize();window[n].init()})});mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){function l(){i=n.extend({callback:n.noop,gmap:null,kml:!1,parse:!0,types:["geocode"]},i);h=n(t);o=i.gmap;r=n("input",t);f=new google.maps.places.Autocomplete(r.get(0),{types:i.types});f.bindTo("bounds",o);s=new google.maps.places.AutocompleteService;_placesService=new google.maps.places.PlacesService(o);google.maps.event.addListener(f,"place_changed",function(){var n=f.getPlace();i.parse?n&&n.geometry&&n.geometry.viewport?(e.set(c(n.formatted_address,"text")),i.callback(n)):e.parse(i.callback):i.callback});n("[data-mapp-geolocate]",h).click(function(){return e.geolocate(),!1})}function c(n,t){var i;return(n=jQuery.trim(n),n=n.replace(", United States of America","").replace(", USA","").replace(", United States",""),t=="text")?n:(i=n.indexOf(","),i==-1?[n]:[n.substring(0,i),jQuery.trim(n.substring(i+1))])}function u(n){r.toggleClass("mapp-error",!!n)}var f,s,o,r,h,e=this;this.set=function(n){r.blur();r.val(n)};this.get=function(){return n.trim(r.val())};this.focus=function(){r.focus()};this.parse=function(n){if(u(!1),value=this.get(),!value)return this.focus(),u(!0);if(i.kml){if(input=="kml")return n("http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml");if(input.substring(0,4)=="http")return n(input)}var t=value.split(",");if(t.length==2&&!isNaN(t[0])&&!isNaN(t[1]))return n({geometry:{location:new google.maps.LatLng(t[0],t[1])}});s.getPlacePredictions({input:value,types:i.types},function(t,i){if(i!="OK"||t==null||t.length==0)return u(!0);_placesService.getDetails({placeId:t[0].place_id},function(t,i){return i!="OK"||!t||!t.geometry?u(!0):(e.set(c(t.formatted_address,"text")),n(t))})})};this.geolocate=function(){if(u(!1),!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(n){i.callback(new google.maps.LatLng(n.coords.latitude,n.coords.longitude))},function(){return u(!0)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};l.apply(this)}}(jQuery);mapp=window.mapp||{};mapp.Poi=function(){this.address=null;this.body=null;this.html=null;this.iconid=null;this.map=null;this.overlay=null;this.postid=null;this.title="";this.url=null;this.type=null;this.viewport=null;for(var n in arguments[0])typeof arguments[0][n]!="undefined"&&(this[n]=arguments[0][n])};mapp.Poi.prototype={fromJSON:function(n){var u,f,i,o,t,r,s,e;this.address=n.correctedAddress;this.body=n.body;this.correctedAddress=n.correctedAddress;this.html=n.html;this.iconid=n.iconid;this.postid=n.postid;this.title=n.title;this.type=n.type;this.url=n.url;n.viewport&&n.viewport.sw&&n.viewport.ne&&(u=new google.maps.LatLng(n.viewport.sw.lat,n.viewport.sw.lng),f=new google.maps.LatLng(n.viewport.ne.lat,n.viewport.ne.lng),this.viewport=u.lat()==0&&u.lng()==0&&f.lat()==0&&f.lng()==0?null:new google.maps.LatLngBounds(u,f));i=[];o=[];switch(this.type){case"polygon":if(n.poly&&n.poly.paths)for(t=0;t<n.poly.paths.length;t++){for(i=[],r=0;r<n.poly.paths[t].length;r++)i.push(new google.maps.LatLng(n.poly.paths[t][r].lat,n.poly.paths[t][r].lng));o.push(new google.maps.MVCArray(i))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(n.poly);break;case"polyline":if(n.poly&&n.poly.path)for(t=0;t<n.poly.path.length;t++)i.push(new google.maps.LatLng(n.poly.path[t].lat,n.poly.path[t].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(i)});this.setColors(n.poly);break;case"circle":e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Circle({center:e,radius:parseFloat(n.poly.radius)});this.setColors(n.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(n.poly);break;case"kml":s=n.kml&&n.kml.url?n.kml.url:"";this.overlay=new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Marker({position:e})}},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(),i,t;if(n.point={lat:r.lat(),lng:r.lng()},i=this.viewport?this.viewport:this.getBounds(),i&&(n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()},t=this.overlay.getDefaultViewport(),n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),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":t=this.overlay.getBounds();n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}}}return n},setTooltip:function(n){this.map.getTooltips()&&(this.type||(n?this.overlay.setTitle(n):this.overlay.setTitle(jQuery("<div>").html(this.title).text())))},setMap:function(n){var t=this;if(google.maps.event.clearInstanceListeners(this.overlay),n==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){t.viewport=t.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=t.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=n;this.overlay.setMap(n.getMap());this.setEditable(this.map.getEditable());this.setIcon(this.iconid);this.setTooltip();google.maps.event.addListener(this.overlay,"click",function(n){t.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||(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n)),this.iconid=n?n:null)},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;if(!n){t.setCenter(this.getPosition());return}if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i=this.getBounds();i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(this.map.getPoiZoom()))},open:function(n){this.map.openPoi(this,n)},zoomIn:function(){var n=this.map.getMap(),r=n.getZoom(),t=this.getBounds(),i=Math.min(r+2,21);t&&n.fitBounds(t);i>n.getZoom()&&n.setZoom(i);n.setCenter(this.getPosition())},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.getEditable()&&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();break;default:return this.viewport?this.viewport:null}return n},getPosition:function(){if(this.type){var n=this.getBounds();return n?n.getCenter():new google.maps.LatLng(0,0)}return this.overlay.getPosition()},click:function(){google.maps.event.trigger(this.overlay,"click")}}
1
+ var mapp=window.mapp||{};+function(n){mapp.Map=function(t){function yt(){var e,h,n;if(!l&&(l=["roadmap","satellite","terrain","hybrid"],mappl10n.styles))for(e in mappl10n.styles)l.push(e);for(o=o?new google.maps.LatLng(t.center.lat,t.center.lng):new google.maps.LatLng(0,0),h={backgroundColor:"transparent",center:o,draggable:ui,keyboardShortcuts:ct,mapTypeControl:li,mapTypeControlOptions:{style:ai,mapTypeIds:l},maxZoom:yi,minZoom:pi,overviewMapControl:wi,overviewMapControlOptions:{opened:bi},panControl:ki,rotateControl:gi,scaleControl:nr,scrollwheel:tr,streetViewControl:ur,tilt:er,zoom:a?a:0,zoomControl:cr,zoomControlOptions:{style:lr}},r=new google.maps.Map(v,h),n=0;n<i.length;n++)i[n].setMap(u);ar();u.setMapTypeId(wt);vr();c=="ib"?(mapp.InfoBox.prototype=new google.maps.OverlayView,f=new mapp.InfoBox):f=new google.maps.InfoWindow;c=="ib"&&(ct=!1);et=new mapp.Geocoder(u,ci,ti);st!="none"&&(s=new mapp.Directions(u,st,et,ii,ri));u.initCenter()}function ar(){var n,t,i;for(n in mappl10n.styles)t=mappl10n.styles[n],i=new google.maps.StyledMapType(t,{name:n}),r.mapTypes.set(n,i),fr==n&&r.setOptions({styles:t})}function vr(){sr&&ot("traffic",mappl10n.traffic,si);dt&&ot("bicycling",mappl10n.bike,ei);hr&&ot("transit",mappl10n.transit,hi)}function ot(n,t,i){var f=e+"_"+n,o=i?"checked='checked'":"",s="<div class='gmnoprint mapp-control'><input type='checkbox' id='"+f+"' "+o+" /> "+t+"<\/div>",u=jQuery(s).get(0);r.controls[google.maps.ControlPosition.TOP_RIGHT].push(u);i&&pt(n);google.maps.event.clearListeners(u,"click");google.maps.event.addDomListener(u,"click",function(){pt(n)})}function pt(n){var i=e+"_"+n,t;switch(n){case"transit":g=g?g:new google.maps.TransitLayer;t=g;break;case"traffic":d=d?d:new google.maps.TrafficLayer;t=d;break;case"bicycling":k=k?k:new google.maps.BicyclingLayer;t=k}t.getMap()?(jQuery("#"+i).prop("checked",!1),t.setMap(null)):(jQuery("#"+i).prop("checked",!0),t.setMap(r))}var o=t.center,w=t.height,h=t.mapid,wt=t.mapTypeId?t.mapTypeId:"roadmap",bt=t.metaKey,e=t.name,kt=t.options,it=t.query,rt=t.title,b=t.width,a=parseInt(t.zoom,10),yr=t.options.adaptive,dt=t.options.bicycling,gt=t.options.bigHeight,ni=t.options.bigWidth,ti=t.options.country,ut=t.options.dataTables,st=t.options.directions,ii=t.options.directionsServer,ri=t.options.directionsUnits,ui=t.options.draggable,fi=t.options.editable,ht=t.options.from,ei=t.options.initialBicycling,oi=t.options.initialOpenDirections,ft=t.options.initialOpenInfo,si=t.options.initialTraffic,hi=t.options.initialTransit,c=t.options.iwType,ct=t.options.keyboardShortcuts,ci=t.options.language,li=t.options.mapTypeControl,ai=parseInt(t.options.mapTypeControlStyle,10),l=t.options.mapTypeIds,vi=t.options.mashupClick,yi=parseInt(t.options.maxZoom),pi=parseInt(t.options.minZoom),wi=t.options.overviewMapControl,bi=t.options.overviewMapControlOpened,ki=t.options.panControl,di=t.options.poiZoom,gi=t.options.rotateControl,nr=t.options.scaleControl,tr=t.options.scrollwheel,ir=t.height,rr=t.width,ur=t.options.streetViewControl,fr=t.options.style,er=parseInt(t.options.tilt),lt=t.options.to,or=t.options.tooltips,sr=t.options.traffic,hr=t.options.transit,cr=t.options.zoomControl,lr=parseInt(t.options.zoomControlStyle,10),u=this,k,d,g,s=null,nt,at,tt,v,y,et=null,r=null,f=null,i=[],vt=!1,p;this.display=function(){if(nt=jQuery("#"+e+"_dialog"),at=jQuery("#"+e+"_directions"),tt=jQuery("#"+e+"_layout"),v=document.getElementById(e),y=jQuery("#"+e+"_poi_list"),!v)return mapp.lib.log("MapPress: Missing map name or container for map: "+e);if(typeof google=="undefined")return mapp.lib.log("MapPress: Google API not loaded");if(mapp.lib.jqVersionCheck("1.7")||mapp.lib.log("jQuery version is too old: "+n.fn.jquery),p=google.maps.Marker.MAX_ZINDEX,at.append(jQuery("#"+e+"_directions_").contents()),y.append(jQuery("#"+e+"_poi_list_").contents()),this.setDataTables(),it){this.ajaxQuery(function(){yt()});return}u.setPois(t.pois,!1);yt()};this.getQuery=function(){return it};this.setQuery=function(n){it=n};this.setDialog=function(n){n=n?n:'<span class="mapp-spinner"><\/span>'+mappl10n.loading;n='<div class="mapp-dialog-inner">'+n+"<\/div>";jQuery(nt).html(n);jQuery(nt).show()};this.hideDialog=function(){jQuery(nt).hide()};this.setPoiList=function(n){typeof n=="string"?y.html(n):y.append(n);this.setDataTables()};this.setDataTables=function(){if(ut&&typeof jQuery.fn.dataTable!="undefined"){var n=ut==!0?{bFilter:!1,bPaginate:!1}:ut;jQuery("table",y).dataTable(n)}};this.getOptions=function(){return kt};this.getResized=function(){return vt};this.show=function(){tt.show();this.display()};this.closeInfoWindow=function(){f.close()};this.openDirections=function(n,t,i){var r,u;typeof n=="object"?(r=n.address?n.address:n.getPosition().toUrlValue(),n.open()):r=n;typeof t=="object"?(u=t.address?t.address:t.getPosition().toUrlValue(),t.open()):u=t;s.open(r,u,i)};this.setMapTypeId=function(n){n=n&&jQuery.inArray(n,l)!=-1?n:l[0];r.setMapTypeId(n)};this.setCenter=function(n,t){r.setCenter(new google.maps.LatLng(n,t))};this.setZoom=function(n){r.setZoom(n)};this.getPoiZoom=function(){return parseInt(di)};this.poiToFront=function(n){p++;n.setZIndex(p)};this.getMap=function(){return r};this.getGeocoder=function(){return et};this.getName=function(){return e};this.setName=function(n){e=n};this.getMapid=function(){return h};this.setMapid=function(n){h=n};this.getTitle=function(){return rt};this.setTitle=function(n){rt=n};this.getWidth=function(){return b};this.setWidth=function(n){b=n};this.getHeight=function(){return w};this.setHeight=function(n){w=n};this.getInfoWindow=function(){return f};this.getEditable=function(){return fi};this.getTooltips=function(){return or};this.getPoi=function(n){return typeof n=="string"&&(n=parseInt(n,10)),i[n]};this.getPoiById=function(n){for(var t=0;t<i.length;t++)if(i[t].postid==n)return i[t];return null};this.getPois=function(){return i};this.insertPoi=function(n){i.unshift(n);n.setMap(this)};this.addPoi=function(n){i.push(n);n.setMap(this)};this.removePoi=function(n){var t=jQuery.inArray(n,i);t!=-1&&(i[t].setMap(null),i.splice(t,1))};this.setPois=function(n,t){for(var u,r=0;r<i.length;r++)i[r].setMap(null);for(i=[],r=0;r<n.length;r++)u=new mapp.Poi,u.fromJSON(n[r]),i.push(u),t&&u.setMap(this),u.setZIndex(p+n.length-1-r);p+=n.length-1};this.showPois=function(){for(var n=0;n<i.length;n++)i[n].setVisible(!0)};this.hidePois=function(){for(var n=0;n<i.length;n++)i[n].setVisible(!1)};this.sortPois=function(n){for(var u,t=Array(),r=0;r<n.length;r++){if(u=parseInt(n[r]),isNaN(u))return!1;t.push(i[u])}return t.length!=i.length?!1:(i=t,!0)};this.openPoi=function(n,t){var r,i;if(c&&c!="none"){if(vi=="post"&&n.postid){window.location.assign(n.url);return}i={html:null};google.maps.event.trigger(u,"poicontent",n,i);r=i.content?i.content:t&&typeof t.featureData!="undefined"?t.featureData.infoWindowHtml:n.html;this.openInfoWindow(n,r,t)}};this.openInfoWindow=function(n,t,i){(s&&s.close(),c&&c!="none")&&(this.poiToFront(n),f.close(),f.setContent(t),google.maps.event.addListenerOnce(f,"domready",function(){google.maps.event.trigger(u,"poidomready",n)}),n.type=="kml"&&i?(f.setOptions({pixelOffset:i.pixelOffset,position:i.latLng}),f.open(r)):n.type?(f.setOptions({position:n.getPosition()}),f.open(r)):f.open(r,n.overlay))};this.closeInfoWindow=function(){f.close()};this.resize=function(n,t){var i=r.getCenter();n&&t&&(jQuery(v).width(n),jQuery(v).height(t),b=n,w=t);google.maps.event.trigger(r,"resize");r.setCenter(i);vt=!0;return};this.initCenter=function(){if(this.closeInfoWindow(),google.maps.event.addListenerOnce(r,"idle",function(){u.initWindows()}),o&&o.lat()&&o.lng())r.setCenter(o),r.setZoom(a);else{var n=a?a:!0;u.autoCenter(n)}};this.initWindows=function(){var i,n,t;s&&oi?(n=jQuery.trim(ht),t=ht==null&&lt==null?"0":jQuery.trim(lt),n=jQuery.isNumeric(n)?this.getPoi(n):n,t=jQuery.isNumeric(t)?this.getPoi(t):t,typeof n=="object"?n.center(!1):typeof t=="object"&&t.center(!1),u.openDirections(n,t,!1)):ft&&(i=jQuery.isNumeric(ft)?u.getPoi(ft):u.getPoi(0),i&&i.open())};this.autoCenter=function(n){var t,u,f;if(i.length==0){this.setCenter(0,0);typeof n=="number"?r.setZoom(n):r.setZoom(1);return}if(i.length==1){i[0].center(n);return}for(t=new google.maps.LatLngBounds,u=0;u<i.length;u++)f=i[u].getBounds(),t=f?t.union(f):t.extend(i[u].getPosition());if(n===!1){r.setCenter(t.getCenter());return}if(typeof n=="number"){r.setCenter(t.getCenter());r.setZoom(n);return}r.fitBounds(t)};this.reset=function(){this.initCenter()};this.bigger=function(n,t,i){s&&s.close();this.closeInfoWindow();jQuery(n).text()==t?(jQuery(n).text(i),jQuery(tt).width(ni),this.resize("100%",gt)):(jQuery(n).text(t),jQuery(tt).width(rr),this.resize("100%",ir))};this.toJSON=function(){return{center:{lat:r.getCenter().lat(),lng:r.getCenter().lng()},height:w,mapid:h,mapTypeId:r.getMapTypeId(),metaKey:bt,pois:i,title:rt,width:b,zoom:r.getZoom()}};this.ajaxSave=function(n){var t,i;t=typeof Prototype!="undefined"&&typeof Object.toJSON!="undefined"?Object.toJSON(u):t=JSON.stringify(u);i={action:"mapp_save",map:t,postid:mappl10n.options.postid};mapp.Ajax("POST",i,function(t){t.status=="OK"&&(h=t.data.mapid,n(t.data))})};this.ajaxDelete=function(n){h||n();var t={action:"mapp_delete",mapid:h};mapp.Ajax("POST",t,function(t){t.status=="OK"&&n()})}};mapp.Map.ajaxCreate=function(n,t,i){mapp.Ajax("GET",{action:"mapp_create"},function(r){if(r.status=="OK"){jQuery.extend(r.data.map.options,t);r.data.map.name=n;var u=new mapp.Map(r.data.map);i(u)}})};mapp.Map.ajaxGet=function(n,t,i,r){var u={action:"mapp_get",mapid:n};mapp.Ajax("GET",u,function(n){if(n.status=="OK"){jQuery.extend(n.data.map.options,i);n.data.map.name=t;var u=new mapp.Map(n.data.map);r(u)}})};mapp.Map.ajaxDelete=function(n,t){var i={action:"mapp_delete",mapid:n};mapp.Ajax("POST",i,function(n){n.status=="OK"&&t&&t()})};mapp.Ajax=function(n,t,i){jQuery.ajax({type:n,cache:!1,url:mappl10n.options.ajaxurl,data:t,success:function(n){if(n.output&&(mappl10n.options.admin||mappl10n.options.debug)&&alert("AJAX Error\r\n"+n.output),n.status=="OK"){i(n);return}(mappl10n.options.admin||mappl10n.options.debug)&&(typeof n=="object"?alert("AJAX Error\r\n"+n.status):alert("AJAX Error\r\n"+n))},error:function(n,t,i){typeof i!="undefined"&&i!=""&&mappl10n.ajaxErrors&&alert("AJAX ERROR\r\nStatus="+t+"\r\nError="+i+"\r\nResponseText="+n.responseText)}})}}(jQuery);mapp=window.mapp||{};mapp.Directions=function(n,t,i,r,u){function p(){jQuery(".mapp-dir-swap",f).click(function(){var n=jQuery(".mapp-dir-daddr",f).val(),t=jQuery(".mapp-dir-saddr",f).val();return jQuery(".mapp-dir-saddr",f).val(n),jQuery(".mapp-dir-daddr",f).val(t),jQuery(".mapp-dir-get",f).click(),!1});jQuery(".mapp-dir-get",f).click(function(){return s.getDirections(),!1});jQuery(".mapp-dir-print",f).click(function(){s.printDirections()});jQuery(".mapp-dir-close",f).click(function(){return s.close(),!1});jQuery(".mapp-travelmode",f).click(function(){return jQuery(".mapp-travelmode",f).removeClass("mapp-travelmode-on"),jQuery(this).addClass("mapp-travelmode-on"),s.getDirections(),!1});jQuery(".mapp-myloc",f).click(function(){return c.geolocate(function(n){n?(jQuery(".mapp-dir-saddr",f).val("("+n.coords.latitude+", "+n.coords.longitude+")"),jQuery(".mapp-dir-get",f).click()):alert(mappl10n.no_geolocate)}),!1})}function w(n,t,i){var u=jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var o={travelMode:u,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:n,destination:t,unitSystem:y},r=jQuery(".mapp-dir-renderer",f).get(0);jQuery(".mapp-dir-renderer",f).empty();l||(l=new google.maps.DirectionsService);l.route(o,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:h.hidePois();e?(e.setDirections(n),e.setMap(a),e.setPanel(r)):e=new google.maps.DirectionsRenderer({map:a,panel:r,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_not_found);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_zero_results);break;default:alert(mappl10n.dir_default+t)}i()})}var h=n,v=t,c=i,o=r,y=u,f=jQuery("#"+n.getName()+"_directions"),e,l,a=n.getMap(),s=this;o.toLowerCase().indexOf("http")==-1&&(o="https://"+o);p();this.open=function(n,t,i){if(v=="google"){this.openGoogle(n,t);return}jQuery(f).show();jQuery(".mapp-dir-saddr",f).val(n);jQuery(".mapp-dir-daddr",f).val(t);(i||typeof i=="undefined")&&(jQuery(".mapp-dir-get",f).focus(),jQuery(".mapp-dir-saddr",f).focus())};this.close=function(){jQuery(f).hide();e&&(e.setPanel(null),e.getMap()&&(e.setMap(null),h.showPois()))};this.getDirections=function(){h.closeInfoWindow();jQuery(".mapp-spinner",f).show();var n=jQuery(".mapp-dir-saddr",f),t=jQuery(".mapp-dir-daddr",f),i=jQuery(".mapp-dir-saddr-err",f),r=jQuery(".mapp-dir-daddr-err",f);c.geocodeField(n,i,function(n){c.geocodeField(t,r,function(t){n&&t?w(n,t,function(){jQuery(".mapp-spinner",f).hide();return}):jQuery(".mapp-spinner",f).hide()})})};this.printDirections=function(){var t,n=jQuery(".mapp-travelmode-on > span",f);t=n.hasClass("mapp-dir-walk")?"w":n.hasClass("mapp-dir-bike")?"b":n.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(jQuery(".mapp-dir-saddr",f).val(),jQuery(".mapp-dir-daddr",f).val(),t)};this.openGoogle=function(n,t,i){var r=o;r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}};mapp=window.mapp||{};mapp.Geocoder=function(n,t,i){function f(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function e(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var o,u,s,h,c,r;o=i;h=t;c=n;s=c.getMap();r=this;this.geocode=function(n,t){var i=n instanceof google.maps.LatLng?{latLng:n}:{address:n,region:o,language:h};i.bounds=s.getBounds();u||(u=new google.maps.Geocoder);u.geocode(i,function(n,i){if(n){for(var r=0;r<n.length;r++)n[r].formatted_address==""&&n.splice(r,1);t(n[0],i)}else t(null,i)})};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){f(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){e(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,i,u,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(i).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(u).click(function(){return f(n,t),r.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else e(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,i,u){if(f(n,t),i=jQuery.trim(i),i==""){u(null);return}var o=r.stringToLatLng(i);if(o){u(o);return}if(i.substring(0,4)=="http"){u(i);return}r.geocode(i,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){e(n,t,mappl10n.no_address);u(null);return}u(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||{};mapp.InfoBox=function(){var u,f,n,i,t,r=this;this.setContent=function(n){u=n};this.onAdd=function(){n=jQuery("<div class='mapp-ib'><div class='mapp-ib-close'>X<\/div><\/div>");t=jQuery("<div class='mapp-ib-tip'><\/div>");typeof u=="string"?jQuery(n).append(u):jQuery(n).append(jQuery(u));jQuery("body").append(n);jQuery("body").append(t);jQuery(".mapp-ib-close",n).click(function(){r.close()});jQuery(window).resize(function(){r.close()})};this.draw=function(){var c=jQuery(n).is(":visible"),u=r.getProjection().fromLatLngToContainerPixel(i),f,o,s;if(u.x=parseInt(u.x),u.y=parseInt(u.y),f=jQuery(this.getMap().getDiv()),u.x>f.width()||u.x<0||u.y>f.height()||u.y<0){jQuery(n).hide();jQuery(t).hide();return}jQuery(n).show();jQuery(t).show();o=f.offset().left+u.x;s=f.offset().top+u.y-32;jQuery(t).offset({top:s-t.outerHeight()-2,left:o-parseInt(t.outerWidth()/2)});var e=o-parseInt(n.outerWidth()/2),l=s-n.outerHeight()-t.outerHeight(),h=jQuery(document).width();e+n.outerWidth()>h&&(e=Math.max(h-n.outerWidth(),o-n.outerWidth()+parseInt(t.outerWidth()/2)));e<0&&(e=0);jQuery(n).offset({top:l,left:e});c||google.maps.event.trigger(this,"domready")};this.onRemove=function(){jQuery(n).remove();jQuery(t).remove()};this.setPosition=function(n){i=n};this.open=function(n,t){f=n;t&&(i=typeof t.getPosition=="function"?t.getPosition():t.getBounds().getCenter());this.setMap(f);this.disableAutoPan&&n.getBounds().contains(i)||f.panTo(i);google.maps.event.addListenerOnce(n,"drag",function(){r.close()});google.maps.event.addListenerOnce(n,"click",function(){r.close()})};this.close=function(){google.maps.event.trigger(this,"closeclick");this.setMap(null)}};mapp=window.mapp||{};this.JSON||(this.JSON={}),function(){function i(n){return n<10?"0"+n:n}function f(n){return o.lastIndex=0,o.test(n)?'"'+n.replace(o,function(n){var t=s[n];return typeof t=="string"?t:"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+n+'"'}function r(i,e){var h,c,l,a,v=n,s,o=e[i];o&&typeof o=="object"&&typeof o.toJSON=="function"&&(o=o.toJSON(i));typeof t=="function"&&(o=t.call(e,i,o));switch(typeof o){case"string":return f(o);case"number":return isFinite(o)?String(o):"null";case"boolean":case"null":return String(o);case"object":if(!o)return"null";if(n+=u,s=[],Object.prototype.toString.apply(o)==="[object Array]"){for(a=o.length,h=0;h<a;h+=1)s[h]=r(h,o)||"null";return l=s.length===0?"[]":n?"[\n"+n+s.join(",\n"+n)+"\n"+v+"]":"["+s.join(",")+"]",n=v,l}if(t&&typeof t=="object")for(a=t.length,h=0;h<a;h+=1)c=t[h],typeof c=="string"&&(l=r(c,o))&&s.push(f(c)+(n?": ":":")+l);else for(c in o)Object.hasOwnProperty.call(o,c)&&(l=r(c,o))&&s.push(f(c)+(n?": ":":")+l);return l=s.length===0?"{}":n?"{\n"+n+s.join(",\n"+n)+"\n"+v+"}":"{"+s.join(",")+"}",n=v,l}}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+i(this.getUTCMonth()+1)+"-"+i(this.getUTCDate())+"T"+i(this.getUTCHours())+":"+i(this.getUTCMinutes())+":"+i(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var e=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n,u,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},t;typeof JSON.stringify!="function"&&(JSON.stringify=function(i,f,e){var o;if(u=n="",typeof e=="number")for(o=0;o<e;o+=1)u+=" ";else typeof e=="string"&&(u=e);if((t=f)&&typeof f!="function"&&(typeof f!="object"||typeof f.length!="number"))throw Error("JSON.stringify");return r("",{"":i})});typeof JSON.parse!="function"&&(JSON.parse=function(n,t){function r(n,i){var f,e,u=n[i];if(u&&typeof u=="object")for(f in u)Object.hasOwnProperty.call(u,f)&&(e=r(u,f),e!==undefined?u[f]=e:delete u[f]);return t.call(n,i,u)}var i;if(n=String(n),e.lastIndex=0,e.test(n)&&(n=n.replace(e,function(n){return"\\u"+("0000"+n.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*#x2F;.test(n.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return i=eval("("+n+")"),typeof t=="function"?r({"":i},""):i;throw new SyntaxError("JSON.parse");})}();mapp.lib={ajax:function(n){var i,t;if(jQuery.extend({type:"GET",cache:!1,data:null,spinner:null,callback:jQuery.noop},n),n.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),i=JSON.stringify(n.data),t=0;t<mapp.lib.ajax.cache.length;t++)if(mapp.lib.ajax.cache[t].data==i){n.callback(mapp.lib.ajax.cache[t].response);return}n.spinner&&mapp.lib.spinner(n.spinner,!0);jQuery.ajax({type:n.type,cache:!1,url:mappl10n.options.ajaxurl,data:n.data,success:function(t,i,r){if(mapp.lib.spinner(n.spinner,!1),t.output&&(mappl10n.options.admin||mappl10n.options.debug)){alert("AJAX Error\r\n"+t.output);return}if(t.status=="OK"){n.cache&&mapp.lib.ajax.cache.push({data:JSON.stringify(n.data),response:t});n.callback&&n.callback(t,i,r);return}if(mappl10n.options.admin||mappl10n.options.debug){var u=typeof t=="object"?t.status:t;alert("AJAX ERROR\r\nResponse="+u+" TextStatus="+i+"\r\nResponseText="+r.responseText);return}},error:function(t,i,r){if((n.spinner&&mapp.lib.spinner(n.spinner,!1),typeof r!="undefined"&&r!="")&&(mappl10n.options.admin||mappl10n.options.debug)){alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+r+"\r\nResponseText="+t.responseText);return}}})},jqVersionCheck:function(n){if(typeof jQuery=="undefined"||typeof n=="undefined")return!1;for(n=n.split("."),v=jQuery.fn.jquery.split("."),i=0;i<n.length;i++){var t=parseInt(n[i]),r=typeof v[i]!="undefined"?parseInt(v[i]):0;if(r!=t)return r>t}return!0},log:function(n,t){mappl10n.options.debug&&window.console&&console.log(n+" : "+t)},spinner:function(n,t){return t?(jQuery(n).addClass("mapp-spinner"),jQuery(n).prepend('<div class="mapp-spinner-overlay"><\/div><div class="mapp-spinner-icon"><\/div>')):(jQuery(n).removeClass("mapp-spinner"),jQuery(".mapp-spinner-overlay, .mapp-spinner-icon",n).remove()),n},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var r=jQuery(n).scrollTop(),u=jQuery(n).height(),i=jQuery(t).position().top,f=i+jQuery(t).height();(i<0||f>u)&&jQuery(n).scrollTop(r+i)}},stringToInt:function(n){for(arg in n){var t=n[arg];typeof t=="object"?mapp.lib.stringToInt(t):n[arg]=jQuery.isNumeric(t)?parseInt(t):t}return n}};jQuery("body").on("tabsactivate tabsshow",function(n,t){var i=t.newPanel?t.newPanel:t.panel;i&&jQuery(".mapp-canvas",i).each(function(){var t=jQuery(this).attr("id"),n=window[t];n.getResized()||(n.resize(),n.initCenter())})});mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){function l(){i=n.extend({callback:n.noop,gmap:null,kml:!1,parse:!0,types:["geocode"]},i);h=n(t);o=i.gmap;r=n("input",t);f=new google.maps.places.Autocomplete(r.get(0),{types:i.types});f.bindTo("bounds",o);s=new google.maps.places.AutocompleteService;_placesService=new google.maps.places.PlacesService(o);google.maps.event.addListener(f,"place_changed",function(){var n=f.getPlace();i.parse?n&&n.geometry&&n.geometry.viewport?(e.set(c(n.formatted_address,"text")),i.callback(n)):e.parse(i.callback):i.callback});n("[data-mapp-geolocate]",h).click(function(){return e.geolocate(),!1})}function c(n,t){var i;return(n=jQuery.trim(n),n=n.replace(", United States of America","").replace(", USA","").replace(", United States",""),t=="text")?n:(i=n.indexOf(","),i==-1?[n]:[n.substring(0,i),jQuery.trim(n.substring(i+1))])}function u(n){r.toggleClass("mapp-error",!!n)}var f,s,o,r,h,e=this;this.set=function(n){r.blur();r.val(n)};this.get=function(){return n.trim(r.val())};this.focus=function(){r.focus()};this.parse=function(n){if(u(!1),value=this.get(),!value)return this.focus(),u(!0);if(i.kml){if(input=="kml")return n("http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml");if(input.substring(0,4)=="http")return n(input)}var t=value.split(",");if(t.length==2&&!isNaN(t[0])&&!isNaN(t[1]))return n({geometry:{location:new google.maps.LatLng(t[0],t[1])}});s.getPlacePredictions({input:value,types:i.types},function(t,i){if(i!="OK"||t==null||t.length==0)return u(!0);_placesService.getDetails({placeId:t[0].place_id},function(t,i){return i!="OK"||!t||!t.geometry?u(!0):(e.set(c(t.formatted_address,"text")),n(t))})})};this.geolocate=function(){if(u(!1),!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(n){i.callback(new google.maps.LatLng(n.coords.latitude,n.coords.longitude))},function(){return u(!0)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};l.apply(this)}}(jQuery);mapp=window.mapp||{};mapp.Poi=function(){this.address=null;this.body=null;this.html=null;this.iconid=null;this.map=null;this.overlay=null;this.postid=null;this.title="";this.url=null;this.type=null;this.viewport=null;for(var n in arguments[0])typeof arguments[0][n]!="undefined"&&(this[n]=arguments[0][n])};mapp.Poi.prototype={fromJSON:function(n){var u,f,i,o,t,r,s,e;this.address=n.correctedAddress;this.body=n.body;this.correctedAddress=n.correctedAddress;this.html=n.html;this.iconid=n.iconid;this.postid=n.postid;this.title=n.title;this.type=n.type;this.url=n.url;n.viewport&&n.viewport.sw&&n.viewport.ne&&(u=new google.maps.LatLng(n.viewport.sw.lat,n.viewport.sw.lng),f=new google.maps.LatLng(n.viewport.ne.lat,n.viewport.ne.lng),this.viewport=u.lat()==0&&u.lng()==0&&f.lat()==0&&f.lng()==0?null:new google.maps.LatLngBounds(u,f));i=[];o=[];switch(this.type){case"polygon":if(n.poly&&n.poly.paths)for(t=0;t<n.poly.paths.length;t++){for(i=[],r=0;r<n.poly.paths[t].length;r++)i.push(new google.maps.LatLng(n.poly.paths[t][r].lat,n.poly.paths[t][r].lng));o.push(new google.maps.MVCArray(i))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(n.poly);break;case"polyline":if(n.poly&&n.poly.path)for(t=0;t<n.poly.path.length;t++)i.push(new google.maps.LatLng(n.poly.path[t].lat,n.poly.path[t].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(i)});this.setColors(n.poly);break;case"circle":e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Circle({center:e,radius:parseFloat(n.poly.radius)});this.setColors(n.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(n.poly);break;case"kml":s=n.kml&&n.kml.url?n.kml.url:"";this.overlay=new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Marker({position:e})}},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(),i,t;if(n.point={lat:r.lat(),lng:r.lng()},i=this.viewport?this.viewport:this.getBounds(),i&&(n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()},t=this.overlay.getDefaultViewport(),n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),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":t=this.overlay.getBounds();n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}}}return n},setTooltip:function(n){this.map.getTooltips()&&(this.type||(n?this.overlay.setTitle(n):this.overlay.setTitle(jQuery("<div>").html(this.title).text())))},setMap:function(n){var t=this;if(google.maps.event.clearInstanceListeners(this.overlay),n==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){t.viewport=t.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=t.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=n;this.overlay.setMap(n.getMap());this.setEditable(this.map.getEditable());this.setIcon(this.iconid);this.setTooltip();google.maps.event.addListener(this.overlay,"click",function(n){t.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;if(!n){t.setCenter(this.getPosition());return}if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i=this.getBounds();i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(this.map.getPoiZoom()))},open:function(n){this.map.openPoi(this,n)},zoomIn:function(){var n=this.map.getMap(),r=n.getZoom(),t=this.getBounds(),i=Math.min(r+2,21);t&&n.fitBounds(t);i>n.getZoom()&&n.setZoom(i);n.setCenter(this.getPosition())},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.getEditable()&&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();break;default:return this.viewport?this.viewport:null}return n},getPosition:function(){if(this.type){var n=this.getBounds();return n?n.getCenter():new google.maps.LatLng(0,0)}return this.overlay.getPosition()},click:function(){google.maps.event.trigger(this.overlay,"click")}}
js/mappress_editor.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};mapp.Media=function(){function u(i){n=i;jQuery("#mapp_m_editor").empty();jQuery("#mapp_m_editor").append(r.clone());var u=n.getMapid();u?jQuery("#mapp_m_mapid").text(u):jQuery("#mapp_m_mapid").text("");jQuery("#mapp_m_title").val(n.getTitle());jQuery("#mapp_m_width").val(n.getWidth());jQuery("#mapp_m_height").val(n.getHeight());jQuery("#mapp_m_edit_panel").show();jQuery("#mapp_m_list_panel").hide();t=new mapp.Editor(n)}function f(){t.close();n=null;t=null;jQuery("#mapp_m_edit_panel").hide();jQuery("#mapp_m_list_panel").show()}function o(){mapp.Map.ajaxCreate("mapp_edit",i,function(n){u(n)})}function s(n){mapp.Map.ajaxGet(n,"mapp_edit",i,function(n){u(n)})}function h(n){var t='[mappress mapid="'+n+'"]';send_to_editor(t)}function e(){if(n){var t=jQuery.trim(jQuery("#mapp_m_title").val());t=t!=""?t:mappl10n.untitled;n.setTitle(t);n.ajaxSave(function(n){n.list&&jQuery("#mapp_m_maplist").html(n.list);f()})}}function c(n){confirm(mappl10n.delete_map_prompt)&&(jQuery("#mapp_m_maplist tr[data-mapid='"+n+"']").remove(),mapp.Map.ajaxDelete(n))}var t,n,r,l=this,i;r=jQuery("#mapp_m_editor").contents().detach();i={bicycling:!1,directions:"none",editable:!0,initialOpenInfo:!1,iwDisableAutoPan:!1,iwType:"ib",mapTypeControl:!0,mapTypeControlStyle:2,mapTypeIds:null,navigationControlOptions:{style:0},overviewMapControl:!1,overviewMapControlOptions:{opened:!1},streetViewControl:!1,traffic:!1,transit:!1};jQuery("#mapp_m_list_panel").show();jQuery("#mapp_m_add_map").click(function(){return o(),!1});jQuery("#mapp_m_maplist").on("click","tr",function(n){var t=jQuery(this).attr("data-mapid");return jQuery(n.target).hasClass("mapp-maplist-edit")?(s(t),!1):jQuery(n.target).hasClass("mapp-maplist-delete")?(c(t),!1):jQuery(n.target).hasClass("mapp-maplist-insert")?(h(t),!1):void 0});jQuery(".mapp-m-size").click(function(){var n=jQuery(this).data("width"),i=jQuery(this).data("height");return jQuery("#mapp_m_width").val(n),jQuery("#mapp_m_height").val(i),t.resize(n,i),!1});jQuery("#mapp_m_width, #mapp_m_height").change(function(){var n=jQuery("#mapp_m_width").val(),i=jQuery("#mapp_m_height").val();return t.resize(n,i),!1});jQuery("#publish, #post-preview").click(function(){e()});jQuery("#mapp_m_save").click(function(){return e(),!1});jQuery("#mapp_m_title").keydown(function(n){if(n.which==13)return n.preventDefault(),jQuery("#mapp_m_save").click(),!1});jQuery("#mapp_m_cancel").click(function(){return f(),!1});jQuery("#mapp_m_insert").click(function(){var t=n.getMapid(),i='[mappress mapid="'+n.getMapid()+'"]';return t?send_to_editor(i):alert(mappl10n.save_first),!1});this.getMap=function(){return n}};mapp.Editor=function(n){function c(){o=jQuery("#mapp_e_infobox").detach();t=n;t.display();this.resize(t.getWidth(),t.getHeight());i();t.getGeocoder().autocompleteField("#mapp_e_saddr","#mapp_e_saddr_err","#mapp_e_search","#mapp_e_myloc",v);google.maps.event.addListener(t,"poicontent",l);google.maps.event.addListener(t,"poidomready",a);jQuery("#mapp_e_recenter").click(function(){return t.closeInfoWindow(),t.autoCenter(!0),!1});google.maps.event.addListener(t.getMap(),"click",function(n){jQuery("#mapp_e_latlng").text(n.latLng.toUrlValue())})}function i(){for(var r=t.getPois(),u="<table>",n=0;n<r.length;n++){var f=r[n].title.replace(/\'/g,"&rsquo;"),e=mapp.Icons.getUrl(r[n].iconid),o=r[n].address;u+="<tr id='"+n+"'><td><img class='mapp-e-icon' src='"+e+"'><\/td><td style='width:100%'><a href='#' title='"+o+"'><b>"+f+"<\/b><\/a><div class='mapp-e-actions'><a href='#' class='mapp-e-poi-list-zoom' data-idx='"+n+"'>"+mappl10n.zoom+"<\/a> | <a href='#' class='mapp-e-poi-list-delete' data-idx='"+n+"'>"+mappl10n.del+"<\/a><\/div><\/td><\/tr>"}u+="<\/table>";jQuery("#mapp_e_poi_list").html(u);jQuery("#mapp_e_poi_list tbody").sortable({axis:"y",placeholder:"mapp-e-sortable-placeholder",forcePlaceholderSize:!0,delay:200,update:function(){var n=jQuery("#mapp_e_poi_list tbody").sortable("toArray");t.sortPois(n);i()}});jQuery("#mapp_e_poi_list tr").click(function(n){var r=jQuery(this).attr("id"),i=t.getPoi(r);return jQuery(n.target).hasClass("mapp-e-poi-list-zoom")?i.zoomIn():jQuery(n.target).hasClass("mapp-e-poi-list-delete")?k(i):t.openPoi(i),!1})}function l(n,t){var i=jQuery(o).clone();jQuery("#mapp_e_poi_title",i).val(n.title);jQuery("#mapp_e_poi_body",i).val(n.body);jQuery("#mapp_e_poi_iconid",i).val(n.iconid);n.type=="kml"&&(jQuery("#mapp_e_poi_kml_fields",i).show(),jQuery("#mapp_e_poi_kml_url",i).val(n.overlay.getUrl()));t.content=i}function a(n){var r={title:n.title,body:n.body,iconid:n.iconid,colors:n.getColors()};w();jQuery("#mapp_e_poi_title").focus();google.maps.event.addListenerOnce(t.getInfoWindow(),"closeclick",function(){n.title=jQuery("#mapp_e_poi_title").val();n.body=jQuery("#mapp_e_poi_body").val();i()});jQuery("#mapp_e_save_poi").click(function(n){t.closeInfoWindow();n.preventDefault()});jQuery("#mapp_e_cancel_poi").click(function(u){t.closeInfoWindow();n.title=r.title;n.body=r.body;n.iconid=r.iconid;n.setIcon(r.iconid);n.setColors(r.colors);i();u.preventDefault()})}function v(n){if(n){if(n.geometry){var t=mapp.Geocoder.parseAddress(n.formatted_address),i=n.name?n.name:t.firstLine,u=n.name?t.firstLine+", "+t.secondLine:t.secondLine,e=new mapp.Poi({address:n.formatted_address,body:u,iconid:f,overlay:new google.maps.Marker({position:n.geometry.location}),title:i,type:null,viewport:n.geometry.viewport?n.geometry.viewport:null});r(e,!0);return}if(n instanceof google.maps.LatLng)return p(n);if(typeof n=="string"&&n.substring(0,4)=="http")return y(n);alert("Internal error, unable to add location")}}function y(n){var t=new mapp.Poi({iconid:f,overlay:new google.maps.KmlLayer(n,{suppressInfoWindows:!0}),title:"KML",type:"kml"});google.maps.event.addListener(t.overlay,"status_changed",function(){var r=t.overlay.getStatus(),n;r=="OK"?(n=t.overlay.getMetadata(),t.title=n.name,t.body=n.description,t.viewport=t.overlay.getDefaultViewport(),i()):alert(mappl10n.kml_error+":"+r)});r(t,!0)}function p(n){poi=new mapp.Poi({body:"",iconid:f,overlay:new google.maps.Marker({position:n}),title:n.toUrlValue(4)});r(poi,!0)}function r(n,r){t.closeInfoWindow();u&&u.setDrawingMode(null);t.insertPoi(n);r&&n.center(!0);i()}function w(){typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(b(),e&&s(),jQuery("#mapp_e_visual").click(function(){s();e=!0}),jQuery("#mapp_e_html").click(function(){h();e=!1}),google.maps.event.addListenerOnce(t.getInfoWindow(),"closeclick",function(){tinyMCE.get("mapp_e_poi_body")&&(tinyMCE.get("mapp_e_poi_body").save(),h())}))}function b(){var i="en",t,n;typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,i=typeof t.language!="undefined"?t.language:"en");n={mode:"none",height:"175px",convert_urls:!1,language:i,menubar:!1,plugins:"paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"formatselect,forecolor,bold,italic,alignleft,aligncenter,alignright,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.majorVersion<"4"&&(oldOpts={plugins:"paste",skin:"wp_theme",theme:"advanced",theme_advanced_toolbar_location:"top",theme_advanced_buttons1:"formatselect, forecolor,|,bold,italic,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,separator,undo,redo",theme_advanced_buttons2:"",theme_advanced_buttons3:""},n=jQuery.extend(n,oldOpts));tinyMCE.init(n)}function s(){tinyMCE.majorVersion>="4"?tinyMCE.execCommand("mceAddEditor",!1,"mapp_e_poi_body"):tinyMCE.execCommand("mceAddControl",!1,"mapp_e_poi_body")}function h(){tinyMCE.majorVersion>="4"?tinyMCE.execCommand("mceRemoveEditor",!1,"mapp_e_poi_body"):tinyMCE.execCommand("mceRemoveControl",!1,"mapp_e_poi_body")}function k(n){return t.closeInfoWindow(),confirm(mappl10n.delete_prompt)?(t.removePoi(n),i(),!0):!1}var u,o,f=null,e=!0,t=n;this.close=function(){t.closeInfoWindow()};this.resize=function(n,i){t.resize(n,i);t.closeInfoWindow();var r=jQuery("#mapp_e_top_toolbar").outerHeight(),u=jQuery("#mapp_edit").outerHeight();jQuery("#mapp_e_poi_list").height(r+u)};c.apply(this)}
1
+ var mapp=window.mapp||{};mapp.Media=function(){function u(i){n=i;jQuery("#mapp_m_editor").empty();jQuery("#mapp_m_editor").append(r.clone());var u=n.getMapid();u?jQuery("#mapp_m_mapid").text(u):jQuery("#mapp_m_mapid").text("");jQuery("#mapp_m_title").val(n.getTitle());jQuery("#mapp_m_width").val(n.getWidth());jQuery("#mapp_m_height").val(n.getHeight());jQuery("#mapp_m_edit_panel").show();jQuery("#mapp_m_list_panel").hide();t=new mapp.Editor(n)}function f(){t.close();n=null;t=null;jQuery("#mapp_m_edit_panel").hide();jQuery("#mapp_m_list_panel").show()}function o(){mapp.Map.ajaxCreate("mapp_edit",i,function(n){u(n)})}function s(n){mapp.Map.ajaxGet(n,"mapp_edit",i,function(n){u(n)})}function h(n){var t='[mappress mapid="'+n+'"]';send_to_editor(t)}function e(){if(n){var t=jQuery.trim(jQuery("#mapp_m_title").val());t=t!=""?t:mappl10n.untitled;n.setTitle(t);n.ajaxSave(function(n){n.list&&jQuery("#mapp_m_maplist").html(n.list);f()})}}function c(n){confirm(mappl10n.delete_map_prompt)&&(jQuery("#mapp_m_maplist tr[data-mapid='"+n+"']").remove(),mapp.Map.ajaxDelete(n))}var t,n,r,l=this,i;r=jQuery("#mapp_m_editor").contents().detach();i={bicycling:!1,directions:"none",editable:!0,initialOpenInfo:!1,iwDisableAutoPan:!1,iwType:"ib",mapTypeControl:!0,mapTypeControlStyle:2,mapTypeIds:null,navigationControlOptions:{style:0},overviewMapControl:!1,overviewMapControlOptions:{opened:!1},streetViewControl:!1,traffic:!1,transit:!1};jQuery("#mapp_m_list_panel").show();jQuery("#mapp_m_add_map").click(function(){return o(),!1});jQuery("#mapp_m_maplist").on("click","tr",function(n){var t=jQuery(this).attr("data-mapid");return jQuery(n.target).hasClass("mapp-maplist-edit")?(s(t),!1):jQuery(n.target).hasClass("mapp-maplist-delete")?(c(t),!1):jQuery(n.target).hasClass("mapp-maplist-insert")?(h(t),!1):void 0});jQuery(".mapp-m-size").click(function(){var n=jQuery(this).data("width"),i=jQuery(this).data("height");return jQuery("#mapp_m_width").val(n),jQuery("#mapp_m_height").val(i),t.resize(n,i),!1});jQuery("#mapp_m_width, #mapp_m_height").change(function(){var n=jQuery("#mapp_m_width").val(),i=jQuery("#mapp_m_height").val();return t.resize(n,i),!1});jQuery("#publish, #post-preview").click(function(){e()});jQuery("#mapp_m_save").click(function(){return e(),!1});jQuery("#mapp_m_title").keydown(function(n){if(n.which==13)return n.preventDefault(),jQuery("#mapp_m_save").click(),!1});jQuery("#mapp_m_cancel").click(function(){return f(),!1});jQuery("#mapp_m_insert").click(function(){var t=n.getMapid(),i='[mappress mapid="'+n.getMapid()+'"]';return t?send_to_editor(i):alert(mappl10n.save_first),!1});this.getMap=function(){return n}};mapp.Editor=function(n){function c(){o=jQuery("#mapp_e_infobox").detach();t=n;t.display();this.resize(t.getWidth(),t.getHeight());i();t.getGeocoder().autocompleteField("#mapp_e_saddr","#mapp_e_saddr_err","#mapp_e_search","#mapp_e_myloc",v);google.maps.event.addListener(t,"poicontent",l);google.maps.event.addListener(t,"poidomready",a);jQuery("#mapp_e_recenter").click(function(){return t.closeInfoWindow(),t.autoCenter(!0),!1});google.maps.event.addListener(t.getMap(),"click",function(n){jQuery("#mapp_e_latlng").text(n.latLng.toUrlValue())})}function i(){for(var r=t.getPois(),u="<table>",n=0;n<r.length;n++){var f=r[n].title.replace(/\'/g,"&rsquo;"),e=mapp.Icons.getUrl(r[n].iconid),o=r[n].address;u+="<tr id='"+n+"'><td><img class='mapp-e-icon' src='"+e+"'><\/td><td style='width:100%'><a href='#' title='"+o+"'><b>"+f+"<\/b><\/a><div class='mapp-e-actions'><a href='#' class='mapp-e-poi-list-zoom' data-idx='"+n+"'>"+mappl10n.zoom+"<\/a> | <a href='#' class='mapp-e-poi-list-delete' data-idx='"+n+"'>"+mappl10n.del+"<\/a><\/div><\/td><\/tr>"}u+="<\/table>";jQuery("#mapp_e_poi_list").html(u);jQuery("#mapp_e_poi_list tbody").sortable({axis:"y",placeholder:"mapp-e-sortable-placeholder",forcePlaceholderSize:!0,delay:200,update:function(){var n=jQuery("#mapp_e_poi_list tbody").sortable("toArray");t.sortPois(n);i()}});jQuery("#mapp_e_poi_list tr").click(function(n){var r=jQuery(this).attr("id"),i=t.getPoi(r);return jQuery(n.target).hasClass("mapp-e-poi-list-zoom")?i.zoomIn():jQuery(n.target).hasClass("mapp-e-poi-list-delete")?k(i):t.openPoi(i),!1})}function l(n,t){var i=jQuery(o).clone();jQuery("#mapp_e_poi_title",i).val(n.title);jQuery("#mapp_e_poi_body",i).val(n.body);jQuery("#mapp_e_poi_iconid",i).val(n.iconid);n.type=="kml"&&(jQuery("#mapp_e_poi_kml_fields",i).show(),jQuery("#mapp_e_poi_kml_url",i).val(n.overlay.getUrl()));t.content=i}function a(n){var r={title:n.title,body:n.body,iconid:n.iconid,colors:n.getColors()};w();jQuery("#mapp_e_poi_title").focus();google.maps.event.addListenerOnce(t.getInfoWindow(),"closeclick",function(){n.title=jQuery("#mapp_e_poi_title").val();n.body=jQuery("#mapp_e_poi_body").val();i()});jQuery("#mapp_e_save_poi").click(function(n){t.closeInfoWindow();n.preventDefault()});jQuery("#mapp_e_cancel_poi").click(function(u){t.closeInfoWindow();n.title=r.title;n.body=r.body;n.iconid=r.iconid;n.setIcon(r.iconid);n.setColors(r.colors);i();u.preventDefault()})}function v(n){if(n){if(n.geometry){var t=mapp.Geocoder.parseAddress(n.formatted_address),i=n.name?n.name:t.firstLine,u=n.name?t.firstLine+", "+t.secondLine:t.secondLine,e=new mapp.Poi({address:n.formatted_address,body:u,iconid:f,overlay:new google.maps.Marker({position:n.geometry.location}),title:i,type:null,viewport:n.geometry.viewport?n.geometry.viewport:null});r(e,!0);return}if(n instanceof google.maps.LatLng)return p(n);if(typeof n=="string"&&n.substring(0,4)=="http")return y(n);alert("Internal error, unable to add location")}}function y(n){var t=new mapp.Poi({iconid:f,overlay:new google.maps.KmlLayer(n,{suppressInfoWindows:!0}),title:"KML",type:"kml"});google.maps.event.addListener(t.overlay,"status_changed",function(){var r=t.overlay.getStatus(),n;r=="OK"?(n=t.overlay.getMetadata(),t.title=n.name,t.body=n.description,t.viewport=t.overlay.getDefaultViewport(),i()):alert(mappl10n.kml_error+":"+r)});r(t,!0)}function p(n){poi=new mapp.Poi({body:"",iconid:f,overlay:new google.maps.Marker({position:n}),title:n.toUrlValue(4)});r(poi,!0)}function r(n,r){t.closeInfoWindow();u&&u.setDrawingMode(null);t.insertPoi(n);r&&n.center(!0);i()}function w(){typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(b(),e&&s(),jQuery("#mapp_e_visual").click(function(){s();e=!0}),jQuery("#mapp_e_html").click(function(){h();e=!1}),google.maps.event.addListenerOnce(t.getInfoWindow(),"closeclick",function(){tinyMCE.get("mapp_e_poi_body")&&(tinyMCE.get("mapp_e_poi_body").save(),h())}))}function b(){var i="en",t,n;typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,i=typeof t.language!="undefined"?t.language:"en");n={mode:"none",height:"175px",convert_urls:!1,language:i,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"formatselect,forecolor,bold,italic,alignleft,aligncenter,alignright,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""};tinyMCE.majorVersion<"4"&&(oldOpts={plugins:"paste",skin:"wp_theme",theme:"advanced",theme_advanced_toolbar_location:"top",theme_advanced_buttons1:"formatselect, forecolor,|,bold,italic,|,justifyleft,justifycenter,justifyright,|,link,unlink,|,image,separator,undo,redo",theme_advanced_buttons2:"",theme_advanced_buttons3:""},n=jQuery.extend(n,oldOpts));tinyMCE.init(n)}function s(){tinyMCE.majorVersion>="4"?tinyMCE.execCommand("mceAddEditor",!1,"mapp_e_poi_body"):tinyMCE.execCommand("mceAddControl",!1,"mapp_e_poi_body")}function h(){tinyMCE.majorVersion>="4"?tinyMCE.execCommand("mceRemoveEditor",!1,"mapp_e_poi_body"):tinyMCE.execCommand("mceRemoveControl",!1,"mapp_e_poi_body")}function k(n){return t.closeInfoWindow(),confirm(mappl10n.delete_prompt)?(t.removePoi(n),i(),!0):!1}var u,o,f=null,e=!0,t=n;this.close=function(){t.closeInfoWindow()};this.resize=function(n,i){t.resize(n,i);t.closeInfoWindow();var r=jQuery("#mapp_e_top_toolbar").outerHeight(),u=jQuery("#mapp_edit").outerHeight();jQuery("#mapp_e_poi_list").height(r+u)};c.apply(this)}
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.43.3
8
Author: Chris Richardson
9
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
10
*/
@@ -31,7 +31,7 @@ if (file_exists(dirname( __FILE__ ) . '/pro/mappress_pro.php')) {
31
include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
32
}
33
class Mappress {
34
- const VERSION = '2.43.3';
35
36
static
37
$baseurl,
@@ -307,7 +307,6 @@ class Mappress {
307
if (class_exists('Mappress_Pro')) {
308
Mappress_Icons::register();
309
Mappress_Query::register();
310
- Mappress_Pro_Settings::register();
311
}
312
313
// Check if upgrade is needed
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.43.4
8
Author: Chris Richardson
9
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
10
*/
31
include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
32
}
33
class Mappress {
34
+ const VERSION = '2.43.4';
35
36
static
37
$baseurl,
307
if (class_exists('Mappress_Pro')) {
308
Mappress_Icons::register();
309
Mappress_Query::register();
310
}
311
312
// Check if upgrade is needed
mappress_map.php CHANGED
@@ -376,10 +376,8 @@ class Mappress_Map extends Mappress_Obj {
376
$poi->map($this);
377
378
// Prepare the pois
379
- foreach($this->pois as $poi) {
380
- $poi->set_title();
381
- $poi->set_body();
382
- }
383
384
// Sort the pois
385
if ($this->options->sort)
376
$poi->map($this);
377
378
// Prepare the pois
379
+ foreach($this->pois as $poi)
380
+ $poi->prepare();
381
382
// Sort the pois
383
if ($this->options->sort)
mappress_poi.php CHANGED
@@ -76,6 +76,7 @@ class Mappress_Poi extends Mappress_Obj {
76
77
if (class_exists('Mappress_Pro')) {
78
$html = $mappress->get_template($this->map()->options->templatePoi, array('poi' => $this));
79
} else {
80
$html = "<div class='mapp-iw'>"
81
. "<div class='mapp-title'>" . $this->title . "</div>"
@@ -87,43 +88,28 @@ class Mappress_Poi extends Mappress_Obj {
87
}
88
89
/**
90
- * Sets the poi title and url
91
- * - may replace title with post title (used in sorting)
92
- * - sets poi url if mashupClick=true,
93
- *
94
*/
95
- function set_title() {
96
$map = $this->map();
97
98
- $style = ($this->postid) ? $map->options->mashupTitle : 'poi';
99
-
100
- if ($style == 'post') {
101
$post = get_post($this->postid);
102
$this->title = $post->post_title;
103
}
104
- }
105
-
106
- /**
107
- * Sets the poi body based on style settings; replaces original body
108
- *
109
- */
110
- function set_body() {
111
- $map = $this->map();
112
-
113
- // If a filter exists, use it instead of this function
114
- if (has_filter('mappress_poi_body')) {
115
- $this->body = apply_filters('mappress_poi_body', $this->body, $this);
116
- return;
117
- }
118
119
$style = ($this->postid) ? $map->options->mashupBody : 'poi';
120
121
- // Get the post excerpt
122
- if ($style == 'post')
123
$this->body = $this->get_post_excerpt();
124
-
125
- if ($style == 'address')
126
$this->body = $this->get_address();
127
}
128
129
/**
@@ -140,8 +126,8 @@ class Mappress_Poi extends Mappress_Obj {
140
*/
141
function get_title_link() {
142
$map = $this->map();
143
- $link = ($this->postid) ? $map->options->mashupLink : false;
144
- return ($link) ? "<a href='" . get_permalink($this->postid) . "'>$this->title</a>" : $this->title;
145
}
146
147
/**
@@ -199,7 +185,7 @@ class Mappress_Poi extends Mappress_Obj {
199
function get_links($context = '') {
200
$map = $this->map();
201
202
- $links = apply_filters('mappress_poi_links', $map->options->poiLinks, $context, $this);
203
204
$a = array();
205
@@ -219,7 +205,7 @@ class Mappress_Poi extends Mappress_Obj {
219
return "";
220
221
$html = implode('&nbsp;&nbsp;', $a);
222
- return apply_filters('mappress_poi_links_html', $html, $context, $this);
223
}
224
225
function get_icon() {
@@ -278,7 +264,7 @@ class Mappress_Poi extends Mappress_Obj {
278
function get_open_link ($args = '') {
279
$map = $this->map();
280
extract(wp_parse_args($args, array(
281
- 'title' => $this->get_title(),
282
'zoom' => null
283
)));
284
@@ -319,7 +305,7 @@ class Mappress_Poi extends Mappress_Obj {
319
320
// If linking poi to underlying post, then link the featured image
321
if ($map->options->mashupLink)
322
- $html = "<a href='" . get_permalink($this->postid) . "'>$html</a>";
323
324
return $html;
325
}
76
77
if (class_exists('Mappress_Pro')) {
78
$html = $mappress->get_template($this->map()->options->templatePoi, array('poi' => $this));
79
+ $html = apply_filters('mappress_poi_html', $html, $this);
80
} else {
81
$html = "<div class='mapp-iw'>"
82
. "<div class='mapp-title'>" . $this->title . "</div>"
88
}
89
90
/**
91
+ * Prepare poi for output
92
*/
93
+ function prepare() {
94
$map = $this->map();
95
96
+ // Set title
97
+ if ($map->options->mashupTitle = 'post' && $this->postid) {
98
$post = get_post($this->postid);
99
$this->title = $post->post_title;
100
}
101
102
$style = ($this->postid) ? $map->options->mashupBody : 'poi';
103
104
+ // Set body
105
+ if ($map->options->mashupBody == 'post' && $this->postid)
106
$this->body = $this->get_post_excerpt();
107
+ else if ($map->options->mashupBody == 'address')
108
$this->body = $this->get_address();
109
+
110
+ // Set URL
111
+ if ($this->postid && ($map->options->mashupClick == 'post' || $map->options->mashupLink))
112
+ $this->url = get_permalink($this->postid);
113
}
114
115
/**
126
*/
127
function get_title_link() {
128
$map = $this->map();
129
+ $link = ($this->postid && $map->options->mashupLink) ? sprintf("<a href='%s'>%s</a>", $this->url, esc_html($this->title)) : $this->title;
130
+ return $link;
131
}
132
133
/**
185
function get_links($context = '') {
186
$map = $this->map();
187
188
+ $links = $map->options->poiLinks;
189
190
$a = array();
191
205
return "";
206
207
$html = implode('&nbsp;&nbsp;', $a);
208
+ return $html;
209
}
210
211
function get_icon() {
264
function get_open_link ($args = '') {
265
$map = $this->map();
266
extract(wp_parse_args($args, array(
267
+ 'title' => $this->title,
268
'zoom' => null
269
)));
270
305
306
// If linking poi to underlying post, then link the featured image
307
if ($map->options->mashupLink)
308
+ $html = "<a href='" . $this->url . "'>$html</a>";
309
310
return $html;
311
}
mappress_settings.php CHANGED
@@ -3,7 +3,8 @@
3
* Options
4
*/
5
class Mappress_Options extends Mappress_Obj {
6
- var $alignment,
7
$autoicons,
8
$apiKey,
9
$autodisplay = 'top',
@@ -162,6 +163,7 @@ class Mappress_Settings {
162
163
add_settings_section('misc_settings', __('Miscellaneous', 'mappress'), array($this, 'section_settings'), 'mappress');
164
add_settings_field('sizes', __('Map sizes', 'mappress'), array($this, 'set_sizes'), 'mappress', 'misc_settings');
165
add_settings_field('footer', __('Scripts', 'mappress'), array($this, 'set_footer'), 'mappress', 'misc_settings');
166
add_settings_field('css', __('CSS', 'mappress'), array($this, 'set_css'), 'mappress', 'misc_settings');
167
}
@@ -217,6 +219,10 @@ class Mappress_Settings {
217
echo "</p>";
218
}
219
220
function set_post_types() {
221
$labels = array(
222
'post' => __('Posts', 'mappress'),
3
* Options
4
*/
5
class Mappress_Options extends Mappress_Obj {
6
+ var $adaptive,
7
+ $alignment,
8
$autoicons,
9
$apiKey,
10
$autodisplay = 'top',
163
164
add_settings_section('misc_settings', __('Miscellaneous', 'mappress'), array($this, 'section_settings'), 'mappress');
165
add_settings_field('sizes', __('Map sizes', 'mappress'), array($this, 'set_sizes'), 'mappress', 'misc_settings');
166
+ add_settings_field('adaptive', __('Adaptive display', 'mappress'), array($this, 'set_adaptive'), 'mappress', 'misc_settings');
167
add_settings_field('footer', __('Scripts', 'mappress'), array($this, 'set_footer'), 'mappress', 'misc_settings');
168
add_settings_field('css', __('CSS', 'mappress'), array($this, 'set_css'), 'mappress', 'misc_settings');
169
}
219
echo "</p>";
220
}
221
222
+ function set_adaptive() {
223
+ echo self::checkbox($this->options->adaptive, 'mappress_options[adaptive]', __("Recenter maps when window is resized", 'mappress'));
224
+ }
225
+
226
function set_post_types() {
227
$labels = array(
228
'post' => __('Posts', 'mappress'),
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.3
7
- Stable tag: 2.43.3
8
9
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
@@ -94,6 +94,17 @@ See full [installation intructions and Documentation](http://www.wphostreviews.c
94
95
== Changelog ==
96
97
2.43.3
98
=
99
* Fixed: unable to save POIs in editor
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.3
7
+ Stable tag: 2.43.4
8
9
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
94
95
== Changelog ==
96
97
+ 2.43.4
98
+ =
99
+ * Added: check for jQuery version
100
+ * Changed: to support new geocoding API: removed 'sensor' parameter from geocoding calls, added api key and switched to https
101
+ * Changed: restored filter 'mappress_poi_html'
102
+ * Changed: removed filters 'mappress_poi_body', 'mappress_poi_links', and 'mappress_poi_links_html'
103
+ * Fixed: workaround for WP bug #33393 (deletes text in POI editor when switching visual/html tab)
104
+ * Fixed: workaround for hidden tabs calling wrong method to display map
105
+ * Fixed: addresses with foreign characters (like umlaut) were incorrect when geocoding custom fields due to double utf8-encoding
106
+ * Fixed: when using WPML, mashups with mashupClick="post" were always redirecting to post in base language
107
+
108
2.43.3
109
=
110
* Fixed: unable to save POIs in editor