MapPress Easy Google Maps - Version 2.43.10

Version Description

Download this release

Release Info

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

Code changes from version 2.43.9 to 2.43.10

css/mappress.css CHANGED
@@ -114,10 +114,15 @@
114
  /* Override common theme / user agent styles that interfere */
115
  .mapp-iw * {
116
  color: black;
 
117
  margin: 0px !important;
118
  padding: 0px !important;
119
  }
120
 
 
 
 
 
121
  .mapp-iw .mapp-title {
122
  font-weight: bold;
123
  }
114
  /* Override common theme / user agent styles that interfere */
115
  .mapp-iw * {
116
  color: black;
117
+ line-height: normal; /* To support wpautop */
118
  margin: 0px !important;
119
  padding: 0px !important;
120
  }
121
 
122
+ .mapp-iw p {
123
+ margin: 5px 0 5px 0 !important; /* To support wpautop */
124
+ }
125
+
126
  .mapp-iw .mapp-title {
127
  font-weight: bold;
128
  }
js/mappress.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(n){mapp.Map=function(t){function vr(){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),er==n&&i.setOptions({styles:t})}function yr(){hr&&ot("traffic",mappl10n.traffic,hi);gt&&ot("bicycling",mappl10n.bike,oi);cr&&ot("transit",mappl10n.transit,ci)}function ot(n,t,r){var f=e+"_"+n,o=r?"checked='checked'":"",s="<div class='gmnoprint mapp-control'><input type='checkbox' id='"+f+"' "+o+" /> "+t+"<\/div>",u=jQuery(s).get(0);i.controls[google.maps.ControlPosition.TOP_RIGHT].push(u);r&&pt(n);google.maps.event.clearListeners(u,"click");google.maps.event.addDomListener(u,"click",function(){pt(n)})}function pt(n){var r=e+"_"+n,t;switch(n){case"transit":k=k?k:new google.maps.TransitLayer;t=k;break;case"traffic":b=b?b:new google.maps.TrafficLayer;t=b;break;case"bicycling":w=w?w:new google.maps.BicyclingLayer;t=w}t.getMap()?(jQuery("#"+r).prop("checked",!1),t.setMap(null)):(jQuery("#"+r).prop("checked",!0),t.setMap(i))}var s=t.center,y=t.height,h=t.mapid,wt=t.mapTypeId?t.mapTypeId:"roadmap",bt=t.metaKey,e=t.name,kt=t.options,tt=t.query,it=t.title,p=t.width,rt=parseInt(t.zoom,10),dt=t.options.adaptive,gt=t.options.bicycling,ni=t.options.bigHeight,ti=t.options.bigWidth,ii=t.options.country,st=t.options.directions,ri=t.options.directionsServer,ui=t.options.directionsUnits,fi=t.options.draggable,ei=t.options.editable,ht=t.options.from,oi=t.options.initialBicycling,si=t.options.initialOpenDirections,ut=t.options.initialOpenInfo,hi=t.options.initialTraffic,ci=t.options.initialTransit,c=t.options.iwType,ct=t.options.keyboardShortcuts,li=t.options.language,ai=t.options.mapTypeControl,vi=parseInt(t.options.mapTypeControlStyle,10),l=t.options.mapTypeIds,yi=t.options.mashupClick,pi=parseInt(t.options.maxZoom),wi=parseInt(t.options.minZoom),bi=t.options.overviewMapControl,ki=t.options.overviewMapControlOpened,di=t.options.panControl,gi=t.options.poiZoom,pr=t.options.radius,nr=t.options.rotateControl,tr=t.options.scaleControl,ir=t.options.scrollwheel,lt=t.options.search,rr=t.height,ur=t.width,fr=t.options.streetViewControl,er=t.options.style,or=parseInt(t.options.tilt),at=t.options.to,sr=t.options.tooltips,hr=t.options.traffic,cr=t.options.transit,lr=t.options.zoomControl,ar=parseInt(t.options.zoomControlStyle,10),u=this,w,b,k,o=null,d,vt,g,a,nt,ft=null,i=null,f=null,et,r=[],yt=!1,v;this.display=function(){var r,h;if(d=jQuery("#"+e+"_dialog"),vt=jQuery("#"+e+"_directions"),g=jQuery("#"+e+"_layout"),a=document.getElementById(e),nt=jQuery("#"+e+"_poi_list"),!a)return mapp.lib.alert("MapPress: Missing map name or container for map: "+e);if(typeof google=="undefined")return mapp.lib.alert("MapPress: Google API not loaded");if(mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery),i=new google.maps.Map(a,{mapTypeId:"roadmap",center:new google.maps.LatLng(0,0),zoom:1}),v=google.maps.Marker.MAX_ZINDEX,vt.append(jQuery("#"+e+"_directions_").contents()),nt.append(jQuery("#"+e+"_poi_list_").contents()),et=new mapp.Places(null,{gmap:i}),google.maps.event.addListener(et,"search",function(n){u.search(n)}),!l&&(l=["roadmap","satellite","terrain","hybrid"],mappl10n.styles))for(r in mappl10n.styles)l.push(r);if(s=s?new google.maps.LatLng(t.center.lat,t.center.lng):new google.maps.LatLng(0,0),h={backgroundColor:"transparent",draggable:fi,keyboardShortcuts:ct,mapTypeControl:ai,mapTypeControlOptions:{style:vi,mapTypeIds:l},maxZoom:pi,minZoom:wi,overviewMapControl:bi,overviewMapControlOptions:{opened:ki},panControl:di,rotateControl:nr,scaleControl:tr,scrollwheel:ir,streetViewControl:fr,tilt:or,zoomControl:lr,zoomControlOptions:{style:ar}},i.setOptions(h),vr(),u.setMapTypeId(wt),yr(),c=="ib"?(mapp.InfoBox.prototype=new google.maps.OverlayView,f=new mapp.InfoBox):f=new google.maps.InfoWindow,c=="ib"&&(ct=!1),ft=new mapp.Geocoder(u,li,ii),st!="none"&&(o=new mapp.Directions(u,st,ft,ri,ui)),dt&&jQuery(window).resize(function(){u.resize()}),tt){lt?et.parse(lt):this.ajaxQuery();return}google.maps.event.addListenerOnce(i,"idle",function(){u.initCenter()});this.setPois(t.pois)};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(d).html(n);jQuery(d).show()};this.hideDialog=function(){jQuery(d).hide()};this.setPoiList=function(n){typeof n=="string"?nt.html(n):nt.append(n)};this.getOptions=function(){return kt};this.getResized=function(){return yt};this.show=function(){g.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;o.open(r,u,i)};this.setMapTypeId=function(n){n=n&&jQuery.inArray(n,l)!=-1?n:l[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(gi)};this.poiToFront=function(n){v++;n.setZIndex(v)};this.getMap=function(){return i};this.getGeocoder=function(){return ft};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 it};this.setTitle=function(n){it=n};this.getWidth=function(){return p};this.setWidth=function(n){p=n};this.getHeight=function(){return y};this.setHeight=function(n){y=n};this.getInfoWindow=function(){return f};this.getEditable=function(){return ei};this.getTooltips=function(){return sr};this.getPoi=function(n){return typeof n=="string"&&(n=parseInt(n,10)),r[n]};this.getPoiById=function(n){for(var t=0;t<r.length;t++)if(r[t].postid==n)return r[t];return null};this.getPois=function(){return r};this.insertPoi=function(n){r.unshift(n);n.setMap(this)};this.addPoi=function(n){r.push(n);n.setMap(this)};this.removePoi=function(n){var t=jQuery.inArray(n,r);t!=-1&&(r[t].setMap(null),r.splice(t,1))};this.setPois=function(n){for(var i,t=0;t<r.length;t++)r[t].setMap(null);for(r=[],t=0;t<n.length;t++)i=new mapp.Poi,i.fromJSON(n[t]),r.push(i),i.setMap(this),i.setZIndex(v+n.length-1-t);v+=n.length-1};this.showPois=function(){for(var n=0;n<r.length;n++)r[n].setVisible(!0)};this.hidePois=function(){for(var n=0;n<r.length;n++)r[n].setVisible(!1)};this.sortPois=function(n){for(var u,t=Array(),i=0;i<n.length;i++){if(u=parseInt(n[i]),isNaN(u))return!1;t.push(r[u])}return t.length!=r.length?!1:(r=t,!0)};this.openPoi=function(n,t){var r,i;if(c&&c!="none"){if(yi=="post"&&n.postid&&n.url){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,r){(o&&o.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"&&r?(f.setOptions({pixelOffset:r.pixelOffset,position:r.latLng}),f.open(i)):n.type?(f.setOptions({position:n.getPosition()}),f.open(i)):f.open(i,n.overlay))};this.closeInfoWindow=function(){f.close()};this.resize=function(n,t){var r=i.getCenter();n&&t&&(jQuery(a).width(n),jQuery(a).height(t),p=n,y=t);google.maps.event.trigger(i,"resize");i.setCenter(r);yt=!0;return};this.initCenter=function(){if(this.closeInfoWindow(),google.maps.event.addListenerOnce(i,"idle",function(){u.initWindows()}),s&&s.lat()&&s.lng())i.setCenter(s),i.setZoom(rt);else{var n=rt?rt:!0;u.autoCenter(n)}};this.initWindows=function(){var i,n,t;o&&si?(n=jQuery.trim(ht),t=ht==null&&at==null?"0":jQuery.trim(at),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)):ut&&(i=jQuery.isNumeric(ut)?u.getPoi(ut):u.getPoi(0),i&&i.open())};this.autoCenter=function(n){var t,u,f;if(r.length==0){this.setCenter(0,0);typeof n=="number"?i.setZoom(n):i.setZoom(1);return}if(r.length==1){r[0].center(n);return}for(t=new google.maps.LatLngBounds,u=0;u<r.length;u++)f=r[u].getBounds(),t=f?t.union(f):t.extend(r[u].getPosition());if(n===!1){i.setCenter(t.getCenter());return}if(typeof n=="number"){i.setCenter(t.getCenter());i.setZoom(n);return}i.fitBounds(t)};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(g).width(ti),this.resize("100%",ni)):(jQuery(n).text(t),jQuery(g).width(ur),this.resize("100%",rr))};this.toJSON=function(){return{center:{lat:i.getCenter().lat(),lng:i.getCenter().lng()},height:y,mapid:h,mapTypeId:i.getMapTypeId(),metaKey:bt,pois:r,title:it,width:p,zoom:i.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,c,h,r;o=i;c=t;h=n;s=h.getMap();r=this;this.geocode=function(n,t){typeof n=="string"&&n.substring(0,1)=="("&&(split=n.replace(/\(|\)/g,"").split(","),n=new google.maps.LatLng(split[0],split[1]));var i=n instanceof google.maps.LatLng?{location:n}:{address:n,region:o,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||{};+function(n){mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}t.spinner&&mapp.lib.spinner(t.spinner,!0);n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(mapp.lib.spinner(t.spinner,!1),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){mapp.lib.spinner(t.spinner,!1);typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},alert:function(n){mappl10n.options.admin||mappl10n.debug?alert(n):window.console&&console.log(n)},spinner:function(t,i){return i=typeof i=="undefined"?t.hasClass("mapp-spinner"):i,i?(n(t).addClass("mapp-spinner"),n(t).prepend('<div class="mapp-spinner-overlay"><\/div><div class="mapp-spinner-icon"><\/div>')):(n(t).removeClass("mapp-spinner"),n(".mapp-spinner-overlay, .mapp-spinner-icon",t).remove()),t},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var r=n.scrollTop(),i=t.position().top,u=i+t.height();i<r?n.scrollTop(i):u>r&&n.scrollTop(u)}}};n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-canvas",r).each(function(){var i=n(this).attr("id"),t=window[i];t.getResized()||(t.resize(),t.initCenter())})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;(this.sel=n(t),this.opts=n.extend({gmap:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length)&&(this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types}),this.autocomplete.bindTo("bounds",this.opts.gmap),google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())}))};mapp.Places.prototype={parse:function(t){var i,u,r=this;if(i=t&&t.name?n.trim(t.name):n.trim(t),this.error(!1),this.sel.blur(),!i)return this.error(!0);if(t&&t.geometry)return google.maps.event.trigger(r,"search",t);if(u=this.parseLatLng(t))return google.maps.event.trigger(r,"search",u);if(i=="geolocate")return this.geolocate();if(i.substring(0,4)=="http")return u=i=="kml"?"http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml":i,google.maps.event.trigger(r,"search",u);this.autocompleteService.getPlacePredictions({input:i,types:this.opts.types,bounds:this.opts.gmap.getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return r.error(!0);r.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return r.error(!0);google.maps.event.trigger(r,"search",n)})})},parseLatLng:function(t){var i,r;return t instanceof google.maps.LatLng?i=t:t&&t.lat&&t.lng?i=new google.maps.LatLng(t.lat,t.lng):(name=t&&t.name?n.trim(t.name):n.trim(t),r=name.split(","),r.length!=2||isNaN(r[0])||isNaN(r[1])||(i=new google.maps.LatLng(r[0],r[1]))),i?{name:i.toUrlValue(),geometry:{location:i}}:null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i=new google.maps.LatLng(t.coords.latitude,t.coords.longitude),r={name:i.toUrlValue(),geometry:{location:i}};n.set("");google.maps.event.trigger(n,"search",r)},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){this.sel.val(n);this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n);this.focus()}}}(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(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},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();n=n?n:this.viewport;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")}};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop(),t=new mapp.Map(n);window[n.name]=t;t.display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
1
+ var mapp=window.mapp||{};+function(){mapp.Map=function(n){function ar(){var n,i,r;for(n in mappl10n.styles)i=mappl10n.styles[n],r=new google.maps.StyledMapType(i,{name:n}),t.mapTypes.set(n,r),fr==n&&t.setOptions({styles:i})}function vr(){sr&&et("traffic",mappl10n.traffic,si);dt&&et("bicycling",mappl10n.bike,ei);hr&&et("transit",mappl10n.transit,hi)}function et(n,i,r){var e=f+"_"+n,o=r?"checked='checked'":"",s="<div class='gmnoprint mapp-control'><input type='checkbox' id='"+e+"' "+o+" /> "+i+"<\/div>",u=jQuery(s).get(0);t.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,i;switch(n){case"transit":b=b?b:new google.maps.TransitLayer;i=b;break;case"traffic":w=w?w:new google.maps.TrafficLayer;i=w;break;case"bicycling":p=p?p:new google.maps.BicyclingLayer;i=p}i.getMap()?(jQuery("#"+r).prop("checked",!1),i.setMap(null)):(jQuery("#"+r).prop("checked",!0),i.setMap(t))}var o=n.center,v=n.height,s=n.mapid,pt=n.mapTypeId?n.mapTypeId:"roadmap",wt=n.metaKey,f=n.name,bt=n.options,nt=n.query,tt=n.title,y=n.width,it=parseInt(n.zoom,10),kt=n.options.adaptive,dt=n.options.bicycling,gt=n.options.bigHeight,ni=n.options.bigWidth,ti=n.options.country,ot=n.options.directions,ii=n.options.directionsServer,ri=n.options.directionsUnits,ui=n.options.draggable,fi=n.options.editable,st=n.options.from,ei=n.options.initialBicycling,oi=n.options.initialOpenDirections,rt=n.options.initialOpenInfo,si=n.options.initialTraffic,hi=n.options.initialTransit,h=n.options.iwType,ht=n.options.keyboardShortcuts,ci=n.options.language,li=n.options.mapTypeControl,ai=parseInt(n.options.mapTypeControlStyle,10),c=n.options.mapTypeIds,vi=n.options.mashupClick,yi=parseInt(n.options.maxZoom),pi=parseInt(n.options.minZoom),wi=n.options.overviewMapControl,bi=n.options.overviewMapControlOpened,ki=n.options.panControl,di=n.options.poiZoom,yr=n.options.radius,gi=n.options.rotateControl,nr=n.options.scaleControl,tr=n.options.scrollwheel,ct=n.options.search,ir=n.height,rr=n.width,ur=n.options.streetViewControl,fr=n.options.style,er=parseInt(n.options.tilt),lt=n.options.to,or=n.options.tooltips,sr=n.options.traffic,hr=n.options.transit,cr=n.options.zoomControl,lr=parseInt(n.options.zoomControlStyle,10),r=this,p,w,b,e=null,k,at,d,l,g,ut=null,t=null,u=null,ft,i=[],vt=!1,a;this.display=function(){var i,s;if(k=jQuery("#"+f+"_dialog"),at=jQuery("#"+f+"_directions"),d=jQuery("#"+f+"_layout"),l=document.getElementById(f),g=jQuery("#"+f+"_poi_list"),!l)return mapp.lib.log("MapPress: Missing map name or container for map: "+f);if(typeof google=="undefined")return mapp.lib.alert("MapPress: Google API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("MapPress: Google API Key missing, please check MapPress settings");if(t=new google.maps.Map(l,{mapTypeId:"roadmap",zoom:1}),a=google.maps.Marker.MAX_ZINDEX,at.append(jQuery("#"+f+"_directions_").contents()),g.append(jQuery("#"+f+"_poi_list_").contents()),ft=new mapp.Places(null,{gmap:t}),google.maps.event.addListener(ft,"search",function(n){r.search(n)}),!c&&(c=["roadmap","satellite","terrain","hybrid"],mappl10n.styles))for(i in mappl10n.styles)c.push(i);if(o=o?new google.maps.LatLng(n.center.lat,n.center.lng):null,s={backgroundColor:"transparent",draggable:ui,keyboardShortcuts:ht,mapTypeControl:li,mapTypeControlOptions:{style:ai,mapTypeIds:c},maxZoom:yi,minZoom:pi,overviewMapControl:wi,overviewMapControlOptions:{opened:bi},panControl:ki,rotateControl:gi,scaleControl:nr,scrollwheel:tr,streetViewControl:ur,tilt:er,zoomControl:cr,zoomControlOptions:{style:lr}},t.setOptions(s),ar(),r.setMapTypeId(pt),vr(),h=="ib"?(mapp.InfoBox.prototype=new google.maps.OverlayView,u=new mapp.InfoBox):u=new google.maps.InfoWindow,h=="ib"&&(ht=!1),ut=new mapp.Geocoder(r,ci,ti),ot!="none"&&(e=new mapp.Directions(r,ot,ut,ii,ri)),kt&&jQuery(window).resize(function(){r.resize()}),nt){ct?ft.parse(ct):this.ajaxQuery();return}google.maps.event.addListenerOnce(t,"idle",function(){r.initCenter()});this.setPois(n.pois)};this.getQuery=function(){return nt};this.setQuery=function(n){nt=n};this.setDialog=function(n){n=n?n:'<span class="mapp-spinner"><\/span>'+mappl10n.loading;n='<div class="mapp-dialog-inner">'+n+"<\/div>";jQuery(k).html(n);jQuery(k).show()};this.hideDialog=function(){jQuery(k).hide()};this.setPoiList=function(n){typeof n=="string"?g.html(n):g.append(n)};this.getOptions=function(){return bt};this.getResized=function(){return vt};this.show=function(){d.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;e.open(r,u,i)};this.setMapTypeId=function(n){n=n&&jQuery.inArray(n,c)!=-1?n:c[0];t.setMapTypeId(n)};this.setCenter=function(n,i){t.setCenter(new google.maps.LatLng(n,i))};this.setZoom=function(n){t.setZoom(n)};this.getPoiZoom=function(){return parseInt(di)};this.poiToFront=function(n){a++;n.setZIndex(a)};this.getMap=function(){return t};this.getGeocoder=function(){return ut};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 tt};this.setTitle=function(n){tt=n};this.getWidth=function(){return y};this.setWidth=function(n){y=n};this.getHeight=function(){return v};this.setHeight=function(n){v=n};this.getInfoWindow=function(){return u};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){for(var r,t=0;t<i.length;t++)i[t].setMap(null);for(i=[],t=0;t<n.length;t++)r=new mapp.Poi,r.fromJSON(n[t]),i.push(r),r.setMap(this),r.setZIndex(a+n.length-1-t);a+=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 u,i;if(h&&h!="none"){if(vi=="post"&&n.postid&&n.url){window.location.assign(n.url);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,i,f){(e&&e.close(),h&&h!="none")&&(this.poiToFront(n),u.close(),u.setContent(i),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(t)):n.type?(u.setOptions({position:n.getPosition()}),u.open(t)):u.open(t,n.overlay))};this.closeInfoWindow=function(){u.close()};this.resize=function(n,i){var r=t.getCenter();n&&i&&(jQuery(l).width(n),jQuery(l).height(i),y=n,v=i);google.maps.event.trigger(t,"resize");t.setCenter(r);vt=!0;return};this.initCenter=function(){if(this.closeInfoWindow(),google.maps.event.addListenerOnce(t,"idle",function(){r.initWindows()}),o&&o.lat()&&o.lng())t.setCenter(o),t.setZoom(it);else{var n=it?it:!0;r.autoCenter(n)}};this.initWindows=function(){var i,n,t;e&&oi?(n=jQuery.trim(st),t=st==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),r.openDirections(n,t,!1)):rt&&(i=jQuery.isNumeric(rt)?r.getPoi(rt):r.getPoi(0),i&&i.open())};this.autoCenter=function(n){var r,u,f;if(i.length==0){this.setCenter(0,0);typeof n=="number"?t.setZoom(n):t.setZoom(1);return}if(i.length==1){i[0].center(n);return}for(r=new google.maps.LatLngBounds,u=0;u<i.length;u++)f=i[u].getBounds(),r=f?r.union(f):r.extend(i[u].getPosition());if(n===!1){t.setCenter(r.getCenter());return}if(typeof n=="number"){t.setCenter(r.getCenter());t.setZoom(n);return}t.fitBounds(r)};this.reset=function(){this.initCenter()};this.bigger=function(n,t,i){e&&e.close();this.closeInfoWindow();jQuery(n).text()==t?(jQuery(n).text(i),jQuery(d).width(ni),this.resize("100%",gt)):(jQuery(n).text(t),jQuery(d).width(rr),this.resize("100%",ir))};this.toJSON=function(){return{center:{lat:t.getCenter().lat(),lng:t.getCenter().lng()},height:v,mapid:s,mapTypeId:t.getMapTypeId(),metaKey:wt,pois:i,title:tt,width:y,zoom:t.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,c,h,r;o=i;c=t;h=n;s=h.getMap();r=this;this.geocode=function(n,t){typeof n=="string"&&n.substring(0,1)=="("&&(split=n.replace(/\(|\)/g,"").split(","),n=new google.maps.LatLng(split[0],split[1]));var i=n instanceof google.maps.LatLng?{location:n}:{address:n,region:o,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||{};+function(n){mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}t.spinner&&mapp.lib.spinner(t.spinner,!0);n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(mapp.lib.spinner(t.spinner,!1),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){mapp.lib.spinner(t.spinner,!1);typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.log(n)},log:function(n){window.console&&console.log(n)},spinner:function(t,i){return i=typeof i=="undefined"?t.hasClass("mapp-spinner"):i,i?(n(t).addClass("mapp-spinner"),n(t).prepend('<div class="mapp-spinner-overlay"><\/div><div class="mapp-spinner-icon"><\/div>')):(n(t).removeClass("mapp-spinner"),n(".mapp-spinner-overlay, .mapp-spinner-icon",t).remove()),t},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var r=n.scrollTop(),i=t.position().top,u=i+t.height();i<r?n.scrollTop(i):u>r&&n.scrollTop(u)}}};mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("$ version is too old: "+n.fn.$);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-canvas",r).each(function(){var i=n(this).attr("id"),t=window[i];t.getResized()||(t.resize(),t.initCenter())})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;(this.sel=n(t),this.opts=n.extend({gmap:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length)&&(this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types}),this.autocomplete.bindTo("bounds",this.opts.gmap),google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())}))};mapp.Places.prototype={parse:function(t){var i,u,r=this;if(i=t&&t.name?n.trim(t.name):n.trim(t),this.error(!1),this.sel.blur(),!i)return this.error(!0);if(t&&t.geometry)return google.maps.event.trigger(r,"search",t);if(u=this.parseLatLng(t))return google.maps.event.trigger(r,"search",u);if(i=="geolocate")return this.geolocate();if(i.substring(0,4)=="http")return u=i=="kml"?"http://kml-samples.googlecode.com/svn/trunk/kml/Placemark/placemark.kml":i,google.maps.event.trigger(r,"search",u);this.autocompleteService.getPlacePredictions({input:i,types:this.opts.types,bounds:this.opts.gmap.getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return r.error(!0);r.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return r.error(!0);google.maps.event.trigger(r,"search",n)})})},parseLatLng:function(t){var i,r;return t instanceof google.maps.LatLng?i=t:t&&t.lat&&t.lng?i=new google.maps.LatLng(t.lat,t.lng):(name=t&&t.name?n.trim(t.name):n.trim(t),r=name.split(","),r.length!=2||isNaN(r[0])||isNaN(r[1])||(i=new google.maps.LatLng(r[0],r[1]))),i?{name:i.toUrlValue(),geometry:{location:i}}:null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i=new google.maps.LatLng(t.coords.latitude,t.coords.longitude),r={name:i.toUrlValue(),geometry:{location:i}};n.set("");google.maps.event.trigger(n,"search",r)},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){this.sel.val(n);this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n);this.focus()}}}(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(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},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();n=n?n:this.viewport;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")}};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop(),t=new mapp.Map(n);window[n.name]=t;t.display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
languages/mappress-google-maps-for-wordpress.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the MapPress Easy Google Maps package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: MapPress Easy Google Maps 2.43.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
- "POT-Creation-Date: 2016-07-06 20:32:17+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -20,7 +20,7 @@ msgstr ""
20
  msgid "My location"
21
  msgstr ""
22
 
23
- #: forms/map_editor.php:25 mappress_map.php:523 mappress_settings.php:407
24
  msgid "Center map"
25
  msgstr ""
26
 
@@ -81,7 +81,7 @@ msgstr ""
81
  msgid "Size"
82
  msgstr ""
83
 
84
- #: forms/map_media.php:48 mappress_map.php:485
85
  msgid "Insert into post"
86
  msgstr ""
87
 
@@ -191,7 +191,7 @@ msgstr ""
191
  msgid "Click to change"
192
  msgstr ""
193
 
194
- #: mappress.php:542 mappress_controls.php:141 mappress_map.php:486
195
  msgid "Delete"
196
  msgstr ""
197
 
@@ -223,23 +223,23 @@ msgstr ""
223
  msgid "Map not found"
224
  msgstr ""
225
 
226
- #: mappress_map.php:484
227
  msgid "Edit"
228
  msgstr ""
229
 
230
- #: mappress_map.php:511
231
  msgid "Show map"
232
  msgstr ""
233
 
234
- #: mappress_map.php:532 mappress_settings.php:408
235
  msgid "Reset map"
236
  msgstr ""
237
 
238
- #: mappress_map.php:541 mappress_settings.php:406
239
  msgid "Bigger map"
240
  msgstr ""
241
 
242
- #: mappress_map.php:542
243
  msgid "Smaller map"
244
  msgstr ""
245
 
2
  # This file is distributed under the same license as the MapPress Easy Google Maps package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MapPress Easy Google Maps 2.43.10\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
+ "POT-Creation-Date: 2016-07-14 18:07:46+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
20
  msgid "My location"
21
  msgstr ""
22
 
23
+ #: forms/map_editor.php:25 mappress_map.php:528 mappress_settings.php:407
24
  msgid "Center map"
25
  msgstr ""
26
 
81
  msgid "Size"
82
  msgstr ""
83
 
84
+ #: forms/map_media.php:48 mappress_map.php:490
85
  msgid "Insert into post"
86
  msgstr ""
87
 
191
  msgid "Click to change"
192
  msgstr ""
193
 
194
+ #: mappress.php:542 mappress_controls.php:141 mappress_map.php:491
195
  msgid "Delete"
196
  msgstr ""
197
 
223
  msgid "Map not found"
224
  msgstr ""
225
 
226
+ #: mappress_map.php:489
227
  msgid "Edit"
228
  msgstr ""
229
 
230
+ #: mappress_map.php:516
231
  msgid "Show map"
232
  msgstr ""
233
 
234
+ #: mappress_map.php:537 mappress_settings.php:408
235
  msgid "Reset map"
236
  msgstr ""
237
 
238
+ #: mappress_map.php:546 mappress_settings.php:406
239
  msgid "Bigger map"
240
  msgstr ""
241
 
242
+ #: mappress_map.php:547
243
  msgid "Smaller map"
244
  msgstr ""
245
 
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.9
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
@@ -32,7 +32,7 @@ if (file_exists(dirname( __FILE__ ) . '/pro/mappress_pro.php')) {
32
  include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
33
  }
34
  class Mappress {
35
- const VERSION = '2.43.9';
36
 
37
  static
38
  $baseurl,
@@ -550,8 +550,9 @@ class Mappress {
550
 
551
  // Globals
552
  $l10n['options'] = array(
553
- 'ajaxurl' => admin_url('admin-ajax.php'),
554
  'admin' => current_user_can('administrator'),
 
 
555
  'debug' => Mappress::$debug,
556
  'iconsUrl' => (class_exists('Mappress_Icons')) ? Mappress_Icons::$icons_url : null,
557
  'language' => $this->get_language(),
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.10
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
32
  include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
33
  }
34
  class Mappress {
35
+ const VERSION = '2.43.10';
36
 
37
  static
38
  $baseurl,
550
 
551
  // Globals
552
  $l10n['options'] = array(
 
553
  'admin' => current_user_can('administrator'),
554
+ 'ajaxurl' => admin_url('admin-ajax.php'),
555
+ 'apiKey' => Mappress::$options->apiKey,
556
  'debug' => Mappress::$debug,
557
  'iconsUrl' => (class_exists('Mappress_Icons')) ? Mappress_Icons::$icons_url : null,
558
  'language' => $this->get_language(),
mappress_map.php CHANGED
@@ -157,6 +157,11 @@ class Mappress_Map extends Mappress_Obj {
157
  $maps_table = $wpdb->prefix . 'mappress_maps';
158
  $posts_table = $wpdb->prefix . 'mappress_posts';
159
 
 
 
 
 
 
160
  $map = serialize($this);
161
 
162
  // Update map
157
  $maps_table = $wpdb->prefix . 'mappress_maps';
158
  $posts_table = $wpdb->prefix . 'mappress_posts';
159
 
160
+ // Apply wpautop to POI bodies
161
+ foreach($this->pois as &$poi)
162
+ $poi->body = wpautop($poi->body);
163
+
164
+
165
  $map = serialize($this);
166
 
167
  // Update map
mappress_updater.php CHANGED
@@ -4,7 +4,7 @@ class Mappress_Updater {
4
  $pro_url = 'http://wphostreviews.com/account',
5
  $plugin_name = 'mappress';
6
 
7
- function Mappress_Updater($basename) {
8
  $this->basename = $basename;
9
 
10
  // Plugin actions
4
  $pro_url = 'http://wphostreviews.com/account',
5
  $plugin_name = 'mappress';
6
 
7
+ function __construct($basename) {
8
  $this->basename = $basename;
9
 
10
  // Plugin actions
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
  Requires at least: 3.5
6
  Tested up to: 4.9
7
- Stable tag: 2.43.9
8
 
9
  MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
 
@@ -95,6 +95,14 @@ See full [installation intructions and Documentation](http://www.wphostreviews.c
95
 
96
  == Changelog ==
97
 
 
 
 
 
 
 
 
 
98
  2.43.9
99
  * Added: support for XHTML sites (must be running WP 4.5 or higher)
100
  * Added: server API key for geocoding
4
  Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
  Requires at least: 3.5
6
  Tested up to: 4.9
7
+ Stable tag: 2.43.10
8
 
9
  MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
 
95
 
96
  == Changelog ==
97
 
98
+ 2.43.10
99
+ * Changed: show blank container while loading mashups instead of default map
100
+ * Changed: no alerts for admins on missing map container
101
+ * Changed: apply wpautop to POIs when they are saved (wpautop inserts html tags to format carriage returns)
102
+ * Fixed: bug where mashups were limited to 10 POIs
103
+ * Fixed: polys are now allowed again for mashups
104
+ * Fixed: changed Mappress_Updater constructor for PHP 7
105
+
106
  2.43.9
107
  * Added: support for XHTML sites (must be running WP 4.5 or higher)
108
  * Added: server API key for geocoding