MapPress Easy Google Maps - Version 2.43.3

Version Description

Download this release

Release Info

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

Code changes from version 2.43.2 to 2.43.3

css/mappress.css CHANGED
@@ -248,11 +248,6 @@
248
  margin: 10px 0 0 0 ;
249
  }
250
 
251
- /* Hide print button in mobile - new Google URL parameters don't allow print mode */
252
- .mobile .mapp-directions .mapp-dir-print {
253
- display: none;
254
- }
255
-
256
  /* Directions travel mode buttons */
257
  .mapp-travelmode {
258
  border: 1px solid lightgray !important; /* 2015 */
248
  margin: 10px 0 0 0 ;
249
  }
250
 
 
 
 
 
 
251
  /* Directions travel mode buttons */
252
  .mapp-travelmode {
253
  border: 1px solid lightgray !important; /* 2015 */
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 n;jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-walk")?n="w":jQuery(".mapp-travelmode-on > span",f).hasClass("mapp-dir-bike")&&(n="b");this.openGoogle(jQuery(".mapp-dir-saddr",f).val(),jQuery(".mapp-dir-daddr",f).val(),2,n)};this.openGoogle=function(n,t,i,r){var u=o;u+="?saddr="+encodeURIComponent(n);u+="&daddr="+encodeURIComponent(t);i&&(u+="&pw="+i);r&&(u+="&dirflg="+r);window.open(u)}};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]*$/.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(){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]*$/.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")}}
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 f={title:n.title,body:n.body,iconid:n.iconid,colors:n.getColors()},u;if(w(),jQuery("#mapp_e_poi_title").focus(),n.isPoly()){jQuery("#mapp_e_poi_poly_fields").show();u=n.getColors();jQuery("#mapp_e_poi_color").mappColorPicker({color:n.type=="polyline"?u.strokeColor:u.fillColor});jQuery("#mapp_e_poi_opacity").val(n.type=="polyline"?u.strokeOpacity*100:u.fillOpacity*100);jQuery("#mapp_e_poi_weight").val(u.strokeWeight);jQuery("#mapp_e_poi_color, #mapp_e_poi_opacity, #mapp_e_poi_weight").on("change change.mapp.colorpicker",function(){var t=jQuery("#mapp_e_poi_color").attr("data-mapp-color"),i=jQuery("#mapp_e_poi_opacity").val(),r=jQuery("#mapp_e_poi_weight").val();n.type=="polyline"?n.setColors({strokeColor:t,strokeOpacity:i/100,strokeWeight:r}):n.setColors({fillColor:t,fillOpacity:i/100,strokeColor:t,strokeWeight:r,strokeOpacity:1})})}if(!n.type){jQuery("#mapp_e_poi_iconid").mappIconPicker();jQuery("#mapp_e_poi_iconid").on("change.mapp.iconpicker",function(){n.setIcon(jQuery("#mapp_e_poi_iconid").val());r=n.iconid;i()})}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(r){t.closeInfoWindow();n.title=f.title;n.body=f.body;n.iconid=f.iconid;n.setIcon(f.iconid);n.setColors(f.colors);i();r.preventDefault()})}function v(n){if(n){if(n.geometry){var t=mapp.Geocoder.parseAddress(n.formatted_address),i=n.name?n.name:t.firstLine,f=n.name?t.firstLine+", "+t.secondLine:t.secondLine,e=new mapp.Poi({address:n.formatted_address,body:f,iconid:r,overlay:new google.maps.Marker({position:n.geometry.location}),title:i,type:null,viewport:n.geometry.viewport?n.geometry.viewport:null});u(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:r,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)});u(t,!0)}function p(n){poi=new mapp.Poi({body:"",iconid:r,overlay:new google.maps.Marker({position:n}),title:n.toUrlValue(4)});u(poi,!0)}function u(n,r){t.closeInfoWindow();f&&f.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 f,o,r=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:"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.2
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.2';
35
 
36
  static
37
  $baseurl,
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
  include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
32
  }
33
  class Mappress {
34
+ const VERSION = '2.43.3';
35
 
36
  static
37
  $baseurl,
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.2
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,11 @@ See full [installation intructions and Documentation](http://www.wphostreviews.c
94
 
95
  == Changelog ==
96
 
 
 
 
 
 
97
  2.43.2
98
  =
99
  * Fixed: public variables caused query errors with null queries
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
 
95
  == Changelog ==
96
 
97
+ 2.43.3
98
+ =
99
+ * Fixed: unable to save POIs in editor
100
+ * Fixed: directions not working because Google changed URL structure
101
+
102
  2.43.2
103
  =
104
  * Fixed: public variables caused query errors with null queries