MapPress Easy Google Maps - Version 2.50.5

Version Description

  • Fixed: 2nd style bug preventing map display
Download this release

Release Info

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

Code changes from version 2.50.2 to 2.50.5

js/mappress.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(n){mapp.Map=function(n,t){this.defaults={center:null,editable:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,pois:null,postid:null,query:null,title:null,width:null,zoom:null};this.highlight=null;this.iw=null;this.places=null;this.poi=null;this.settings=t?t:{};this.templates=null;this.dir_=null;this.div={};this.layers_={};this.map_=null;this.pois_=[];this.xhr_;this.zindex_=0;_.extend(this,this.defaults,_.pick(n,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)))};mapp.Map.prototype={display:function(){var t=this,i;this.div.layout=n("#"+this.name+"-layout");n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","search"],function(i,r){t.div[r]=n(".mapp-"+r,t.div.layout)});this.sanity();this.templates=this.editable?{loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?{loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:{loop:"map-loop",item:"map-item",popup:"map-popup"};mappl10n.options.engine=="leaflet"?(i=_.extend({attribution:'Map data © <a href="https://openstreetmap.org">OpenStreetMap<\/a>',minZoom:0,scrollWheelZoom:!1,worldCopyJump:!0,zoomControl:null},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_=new L.Map(this.div.canvas.get(0),i),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),i=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_.setOptions(i),this.toggleMapTypeId(this.mapTypeId,!0),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),mapp.event.addListenerOnce(this.map_,"idle",function(){t.initialOpen()}),this.addLayers());this.addStyles();this.addControls();this.addMenu();this.places=new mapp.Places(n(".mapp-places",this.div.search),{map:t});n(this.places).on("search.mapp",function(n,i){t.search(i)});this.addEvents("click drag",function(){t.close()});this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);this.div.layout.on("click","[data-mapp-action]",function(i){var r=n(this).attr("data-mapp-action");i.preventDefault();t.action(r,n(this).attr("data-mapp-"+r),n(this))});this.div.filters.on("change",function(){t.ajaxQuery(t.getBounds())});n(window).resize(function(){t.resize()});this.query||this.setPois(this.pois);this.places.parse(this.center,function(n){t.query?n?t.search(n):t.ajaxQuery():(n&&n.geometry&&n.geometry.location&&(t.center=n.geometry.location),t.recenter())});mappl10n.options.engine=="leaflet"&&this.initialOpen()},initialOpen:function(){var n=this.pois_.length?this.pois_[0]:null;this.initialOpenDirections?this.openDirections(null,n):n&&this.initialOpenInfo&&n.open()},search:function(n){var i=n.geometry.location?n.geometry.location:null,t=n.geometry.viewport?n.geometry.viewport:null,f,u,r;mappl10n.options.engine=="leaflet"?(f=new L.LatLng(i.lat,i.lng),r=f.toBounds(mappl10n.options.radius*1e3)):(u=new google.maps.Circle({center:i,radius:mappl10n.options.radius*1e3}),r=t?new google.maps.LatLngBounds(new google.maps.LatLng(t.sw.lat,t.sw.lng),new google.maps.LatLng(t.ne.lat,t.ne.lng)).union(u.getBounds()):u.getBounds());this.fitBounds(r,0);this.setView(i);this.ajaxQuery(r)},load:function(n){_.extend(this,this.defaults,n,this.settings);this.toggleMapTypeId(this.mapTypeId,!0);this.toggleView("menu",!1);this.toggleLayer();this.close();this.setPois(this.pois_);this.places.set("")},action:function(t,i,r){var f=this,u;switch(t){case"center":this.toggleView("menu",!1);this.close();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(this.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate(function(n){f.search(n)});break;case"layer":this.toggleLayer(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":u=r.attr("data-mapp-poi");this.open(this.pois_[u]);break;case"show":this.div.layout.show();this.resize();this.initCenter();break;case"view-map":this.toggleView("list",!1);break;case"view-list":this.toggleView("list",!0);break;default:return!0}},dialog:function(n,t){var i=this;n?(this.div.dialog.html(n),this.div.dialog.show(),t&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout(function(){i.dialog(null)},4e3))):this.div.dialog.hide()},addEvents:function(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)mapp.event.addListener(this.map_,n[i],t)},close:function(){mappl10n.options.engine=="leaflet"?this.map_.closePopup():this.iw.close();this.select(null);n(this).triggerHandler("mapp.close")},openDirections:function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";this.dir_||(this.dir_=new mapp.Directions(this.div.directions,this));this.dir_.open(i,r)},sanity:function(){if(!this.div.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);if(mappl10n.options.autoupdate==="tc")return mapp.lib.log("Maps API missing (800001)");if(typeof _=="undefined")return mapp.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if(mappl10n.options.engine=="leaflet"){if(typeof L=="undefined")return mapp.lib.alert("ERROR: Unable to load Leaflet")}else{if(typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("ERROR: Google Maps API Key missing, please check MapPress settings and FAQ");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")})}},select:function(t){if(n("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),t){var r=n.inArray(t,this.pois_),i=n('[data-mapp-poi="'+r+'"]',this.div.list);i.addClass("mapp-selected");mapp.lib.scrollTo(this.div.list,i);t.setZIndex(++this.zindex_)}this.poi=t},setHighlight:function(n){this.highlight&&(mappl10n.options.engine=="leaflet"?this.highlight.remove():this.highlight.setMap(null));n&&(mappl10n.options.engine=="leaflet"?this.highlight=new L.Marker(n.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:n.getPosition()}),this.highlight.setMap(this.map_)))},getMap:function(){return this.map_},renderList:function(){var i=this.getBounds(),r=0,u=this,t;if(!this.editable)for(t=0;t<this.pois_.length;t++)this.pois_[t].visible=this.pois_[t].type!="kml",this.query&&i&&!i.contains(this.pois_[t].getPosition())&&(this.pois_[t].visible=!1),r+=this.pois_[t].visible;this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:r}));this.editable&&n(".mapp-items",u.sel).sortable({axis:"y",cursor:"move",delay:200,update:function(){u.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},getPois:function(){return this.pois_},insertPoi:function(n){var t=this;this.pois_.unshift(n);n.setMap(this);t.renderList();this.select(n)},removePoi:function(t){var r=this,i=n.inArray(t,this.pois_);i!=-1&&(this.pois_[i].setMap(null),this.pois_.splice(i,1),r.renderList())},resetPois:function(){for(i=0;i<this.pois_.length;i++)this.pois_[i].setMap(null);this.pois_=[];this.zindex_=0},setPois:function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+n.length-1-t);this.zindex_+=n.length-1}this.renderList()},sortPois:function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(this.pois_[r])}if(t.length!=this.pois_.length)return!1;this.pois_=t;this.renderList()},open:function(t,i){if(this.close(),this.select(t),mappl10n.options.mashupClick!="poi"&&t.postid&&t.url){window.open(t.url);return}if(this.toggleView("list",!1),this.div.iw.html(t.render("popup")),mappl10n.options.engine=="leaflet")this.iw.setLatLng(t.getPosition()),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw);else{var r=new google.maps.MVCObject;r.setValues({position:t.getPosition(i),anchorPoint:t.getAnchorPoint(i)});this.iw.open(this.map_,r)}n(this).triggerHandler("mapp.open",t)},renderMenu:function(){var t=this;for(layer in this.layers_)this.layers_[layer].getMap()&&n('[data-mapp-layer="'+layer+'"]',this.div.layout).addClass("mapp-active")},addStyles:function(){var e=this,i,o,s,l,a,u,t,h,f;if(mappl10n.options.engine=="leaflet"){for(i=[],o=L.control.layers(),t=0;t<mappl10n.options.baseLayers.length;t++)s=mappl10n.options.baseLayers[t],l=mappl10n.options.providers[s.provider],i.push(n.extend({},l,s));for(a=mappl10n.options.style&&!this.editable&&this.mapTypeId=="streets"?mappl10n.options.style:this.mapTypeId,u=_.findIndex(i,{name:a}),u=u>=0?u:0,t=0;t<i.length;t++)h=L.tileLayer(i[t].url,i[t]),o.addBaseLayer(h,i[t].label),t==u&&h.addTo(this.map_);this.editable&&i.length>1&&o.addTo(this.map_);this.map_.on("baselayerchange",function(n){e.mapTypeId=n.layer.options.name})}else{var r=mappl10n.options.styles,c=mappl10n.options.style,v=["roadmap","satellite","terrain","hybrid"];if(c&&typeof r[c]!="undefined"&&this.map_.setOptions({styles:r[c]}),this.editable){for(f in r)this.map_.mapTypes.set(f,new google.maps.StyledMapType(r[f],{name:f})),v.push(f);this.map_.setOptions({mapTypeControlOptions:{mapTypeIds:v,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else typeof r[this.mapTypeId]!="undefined"&&this.map_.setOptions({styles:r[this.mapTypeId]});mapp.event.addListener(this.map_,"maptypeid_changed",function(){e.mapTypeId=e.map_.getMapTypeId()})}},addControls:function(){var n=this;this.div.controls.html(mapp.lib.template("map-controls",{map:this}))},addLayers:function(){var u,i,t,r;for(this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},u=n.makeArray(this.layers),i=0;i<u.length;i++)t=n.trim(u[i]),r=t.split(".").pop(),this.layers_[t]?this.toggleLayer(t):r=="kml"||r=="kmz"?this.layers_[t]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:t}):r=="json"&&(this.layers_[t]=new google.maps.Data({map:this.map_}).loadGeoJson(t))},addMenu:function(){var t=this;n("body").on("click",function(i){var r=n(i.target),u=r.attr("data-mapp-action");r==t.div.filters||u=="filters-toggle"||r.closest(t.div.filters).length||t.toggleView("filters",!1);r==t.div.menu||u=="menu-toggle"||r.closest(t.div.menu).length||t.toggleView("menu",!1)})},toggleLayer:function(t,i){var r=this;i=typeof i!="undefined"?i:this.layers_[t].getMap()==null;n.each(["traffic","bicycling","transit"],function(n,t){r.layers_[t].setMap(null)});i&&this.layers_[t].setMap(this.map_)},toggleMapTypeId:function(t,i){var u=this,r=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(this.getMapTypeId()==t);t=u.editable?i&&(r||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":r?t:"roadmap";this.map_.setMapTypeId(t)},togglePois:function(n){n=!!n;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(n)},toggleView:function(n,t){t=typeof t=="undefined"?!this.div.layout.hasClass("mapp-view-"+n):t;this.div.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&this.renderMenu();n=="directions"&&(this.close(),this.resize())},resize:function(){var n=this.getCenter();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);mappl10n.options.engine=="leaflet"?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize");this.setView(n)},recenter:function(){var r=this.center&&this.center.lat&&this.center.lng?this.center:null,n=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,t,i;if(r){this.setView(r,n?n:1);return}if(this.pois_.length==0){this.setView({lat:0,lng:0},n?n:1);return}if(this.pois_.length==1){this.pois_[0].center(n);return}for(bounds=mappl10n.options.engine=="leaflet"?new L.LatLngBounds:new google.maps.LatLngBounds,t=0;t<this.pois_.length;t++)i=this.pois_[t].getBounds(),bounds=i?mappl10n.options.engine=="leaflet"?bounds.extend(i):bounds.union(i):bounds.extend(this.pois_[t].getPosition());this.fitBounds(bounds,0)},toJSON:function(){var n;for(this.pois=[],n=0;n<this.pois_.length;n++)this.pois.push(this.pois_[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}},ajaxSave:function(n){var t=this,i=JSON.stringify(this),r=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:i,postid:r},callback:function(i){i.status=="OK"&&(t.mapid=i.data.mapid,n(i.data))}})},fitBounds:function(n){return this.map_.fitBounds(n)},getBounds:function(){try{return this.map_.getBounds()}catch(n){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(n){return null}},getMapTypeId:function(n){return mappl10n.options.engine=="leaflet"?"roadmap":this.map_.getMapTypeId(n)},setView:function(n,t,i){mappl10n.options.engine=="leaflet"?(t==null&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(n,t,i)):(n&&this.map_.setCenter(n),t&&this.map_.setZoom(t))}};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){this.sel=n(t);this.map=i;this.directionsRenderer=null;this.directionsService=null;this.placesService=null;var r=this;this.sel.on("keydown",function(n){n.which==13?(r.getDirections(),n.preventDefault()):n.which==27&&r.close()});this.sel.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action"),u=n(".mapp-dir-daddr",r.sel).val(),f=n(".mapp-dir-saddr",r.sel).val();t.preventDefault();switch(i){case"dir-cancel":r.close();break;case"dir-get":r.getDirections();break;case"dir-myloc":r.map.places.geolocate(function(t){n(".mapp-dir-saddr",r.sel).val(t.name);r.getDirections()});break;case"dir-swap":n(".mapp-dir-saddr",r.sel).val(u);n(".mapp-dir-daddr",r.sel).val(f);r.getDirections()}});this.open=function(t,i){if(mappl10n.options.directions=="google"){this.openGoogle(t,i);return}this.map.toggleView("directions",!0);n(".mapp-dir-addr",this.sel).removeClass("mapp-error");n(".mapp-dir-saddr",this.sel).val(t);n(".mapp-dir-daddr",this.sel).val(i);n(".mapp-dir-get",this.sel).focus();n(".mapp-dir-saddr",this.sel).focus()};this.close=function(){this.map.toggleView("directions",!1);this.directionsRenderer&&(this.directionsRenderer.setPanel(null),this.directionsRenderer.getMap()&&(this.directionsRenderer.setMap(null),this.map.togglePois(!0)))};this.getDirections=function(){this.map.close();this.openGoogle(n(".mapp-dir-saddr",this.sel).val(),n(".mapp-dir-daddr",this.sel).val());return};this.openGoogle=function(n,t){var i=mappl10n.options.directionsServer;i.toLowerCase().indexOf("http")==-1&&(i="https://"+i);i+="?saddr="+encodeURIComponent(n);i+="&daddr="+encodeURIComponent(t);window.open(i)}}}(jQuery);mapp=window.mapp||{};mapp.geocoders={};+function(){mapp.geocoders.Algolia=function(n){this.map=n;this.places=algoliasearch.initPlaces()};mapp.geocoders.Algolia.prototype={geocode:function(n,t){var i=this;this.getPredictions(n,function(i){i&&i.hits.length?t({formatted_address:i.hits[0].locale_names[0],name:n,geometry:{location:{lat:i.hits[0]._geoloc.lat,lng:i.hits[0]._geoloc.lng}}}):t(null)})},getDetails:function(n,t){t({formatted_address:n.value,name:n.name,geometry:{location:n.latlng}})},getPredictions:function(n,t){this.places.search({query:n,language:mappl10n.options.language},function(n,i){n||!i?t(null):t(i)})}}}(jQuery);+function(n){mapp.geocoders.Google=function(t){this.map=t;this.token=null;this.types=this.map.editable?null:["geocode"];var i=n('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0));this.autocompleteService=new google.maps.places.AutocompleteService;i.remove()};mapp.geocoders.Google.prototype={geocode:function(t,i){var r=this;this.getPredictions(t,function(t){t&&n.isArray(t)?r.getDetails(t[0],function(n){i(n)}):i(null)})},getDetails:function(n,t){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;this.token=null;var i={placeId:n.place_id,sessionToken:this.token};this.placesService.getDetails(i,function(n,i){if(i=="OK"&&n&&n.geometry){if(n.geometry.location&&(n.geometry.location=n.geometry.location.toJSON()),n.geometry.viewport){var r=n.geometry.viewport.toJSON();n.geometry.viewport={sw:{lat:r.south,lng:r.west},ne:{lat:r.north,lng:r.east}}}t(n)}else t(null)})},getPredictions:function(n,t){var i,r;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;i=this.map.getMap().getBounds();i=i?i:new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180));r={input:n,bounds:i,sessionToken:this.token,types:this.types};this.autocompleteService.getPlacePredictions(r,function(n,i){i=="OK"&&n&&n.length?t(n):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),t(null))})}}}(jQuery);mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){var n="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return mappl10n.options.engine=="leaflet"?L.icon({iconUrl:n,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:n}};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({border:20},i),u=null,r=null,o,e=this;r=n('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib" tabindex="0"><\/div><div class="mapp-ib-tip"><\/div><\/div>').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){e.close()});r.on("keydown",function(n){n.which==27&&e.close()});r.on("click",".mapp-close",function(){e.close()});this.getContent=function(){return n(".mapp-ib",r)};this.setContent=function(t){n(".mapp-ib",r).empty().append(t)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){o=!1;var t=n(":input",r);r.show();t.length?t.first().focus():r.focus();google.maps.event.trigger(e,"domready")};this.draw=function(){var l=this.getMap(),a=n(".mapp-ib-body",r),s=this.getProjection().fromLatLngToContainerPixel(u.position),t,h,c,i,e;o||(o=!0,t={width:n(":first-child",l.getDiv()).width(),height:n(":first-child",l.getDiv()).height()},r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"}),h=r.outerWidth(!0),c=r.outerHeight(!0),c>t.height+u.anchorPoint.y-2*f.border&&(c=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":c+2})),i=s.x,e=s.y,i+h/2>t.width&&(i=t.width-h/2),i-h/2<0&&(i=h/2),e-c+u.anchorPoint.y<f.border&&(e=c-u.anchorPoint.y+f.border),e>t.height&&(e=t.height),(s.x-i||s.y-e)&&l.panBy(s.x-i,s.y-e),r.css({left:i-h/2,bottom:t.height-e-u.anchorPoint.y}))};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.hide()}};mappl10n.options.engine!="leaflet"&&(mapp.InfoBox.prototype=new google.maps.OverlayView)}(jQuery);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}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}};mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).find(".mapp-canvas").attr("id"),t=window[i];t.resize();t.recenter()})})}(jQuery);+function(){mappl10n.options.engine=="leaflet"&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(this.lat*1e6)/1e6+", "+Math.round(this.lng*1e6)/1e6});mapp.event={addListener:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.on(t,i);else google.maps.event.addListener(n,t,i)},addListenerOnce:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.once(t,i);else google.maps.event.addListenerOnce(n,t,i)},clearInstanceListeners:function(n){mappl10n.options.engine=="leaflet"?n.off():google.maps.event.clearInstanceListeners(n)},clearListeners:function(n,t){mappl10n.options.engine=="leaflet"?n.off(t):google.maps.event.clearListeners(n,"rightclick")},trigger:function(n,t,i){mappl10n.options.engine=="leaflet"?n.fire(t,i):google.maps.event.trigger(n,t,i)}}}(jQuery);mapp=window.mapp||{};jQuery.fn.AlgoliaAutocomplete=jQuery.fn.autocomplete.noConflict();+function(n){mapp.Places=function(t,i){var r=this;this.sel=n(t);this.opts=n.extend({map:null},i);this.geocoder=mappl10n.options.engine=="leaflet"?new mapp.geocoders.Algolia(this.opts.map):new mapp.geocoders.Google(this.opts.map);this.sel.on("keydown",function(t){if(t.which==13){t.preventDefault();var i=r.parseLatLng(r.sel.val());i&&(n(r).triggerHandler("search.mapp",i),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation())}});this.autocomplete();this.sel.focus()};mapp.Places.prototype={parse:function(t,i){var f=this,u=t&&t.name?n.trim(t.name):n.trim(t),r;if(!u){i(null);return}if(u=="user"){this.geolocate(function(n){i(n)});return}if(t&&t.geometry){i(t);return}if(r=this.parseLatLng(t),r){i(r);return}this.geocoder.geocode(t,function(n){i(n)})},parseLatLng:function(t){var i,u,r;return t.lat&&t.lng?i=t:(u=t&&t.name?n.trim(t.name):n.trim(t),r=u.split(","),r.length!=2||isNaN(r[0])||isNaN(r[1])||(i={lat:r[0],lng:r[1]})),i?{name:i.lat+", "+i.lng,geometry:{location:i}}:null},geolocate:function(n){var t=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};n({name:i.lat+", "+i.lng,geometry:{location:i}})},function(t){var i=t&&t.message?" : "+t.message:"";alert(mappl10n.no_geolocate+i);n(null)},{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4})},autocomplete:function(){var t=this,r,i,u;this.sel.on("autocomplete:selected",function(i,r){t.geocoder.getDetails(r,function(i){t.parse(i,function(i){i&&n(t).triggerHandler("search.mapp",i)})})});r={empty:'<div class="list-group search-results-dropdown"><div class="list-group-item">'+mappl10n.no_results+"<\/div><\/div>",header:'<div class="list-group search-results-dropdown">'};mappl10n.options.engine=="leaflet"?(i={algoliasearch:algoliasearch,templates:r},mappl10n.options.country&&(i.countries=[mappl10n.options.country]),mappl10n.options.language&&(i.language=mappl10n.options.language),u=placesAutocompleteDataset(i)):u={display:"description",source:function(n,i){t.geocoder.getPredictions(n,function(n){matches=n;i(matches)})},templates:r};this.sel.AlgoliaAutocomplete({autoselect:!0,cssClasses:{prefix:"mapp-aa"},debug:!1,hint:!0,highlight:!0,minLength:1},u)}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var u,f,r,o,i,e,h,s;if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),mappl10n.options.engine=="leaflet"&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&(u=t.viewport.sw,f=t.viewport.ne,this.viewport=mappl10n.options.engine=="leaflet"?new L.LatLngBounds(L.latLng(u.lat,u.lng),L.latLng(f.lat,f.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(u.lat,u.lng),new google.maps.LatLng(f.lat,f.lng))),r=[],o=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],e=0;e<t.poly.paths[i].length;e++)r.push(new google.maps.LatLng(t.poly.paths[i][e].lat,t.poly.paths[i][e].lng));o.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":h=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:h,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":s=t.kml&&t.kml.url?t.kml.url:"";this.overlay=mappl10n.options.engine=="leaflet"?omnivore.kml(s):new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:this.overlay=mappl10n.options.engine=="leaflet"?L.marker([t.point.lat,t.point.lng]):new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng)})}t.type||this.setIcon(t.iconid)};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},u=this.getPosition(),i,t,r;if(n.point=u.toJSON(),i=this.viewport?this.viewport:this.getBounds(),i&&(t=i.toJSON(),n.viewport={sw:{lat:t.south,lng:t.west},ne:{lat:t.north,lng:t.east}}),this.type=="kml"&&(n.kml=this.kml),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(t.toJSON())});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push(n.toJSON())});n.poly.paths.push(i)});break;case"rectangle":r=this.overlay.getBounds();n.viewport={sw:r.getSouthWest().toJSON(),ne:r.getNorthEast().toJSON()}}}return n},setMap:function(t){var i=this;if(this.map=t,mapp.event.clearInstanceListeners(this.overlay),t==null){mappl10n.options.engine=="leaflet"?this.overlay.remove():this.overlay.setMap(null);return}this.type=="kml"&&(mappl10n.options.engine=="leaflet"?(mapp.event.addListenerOnce(this.overlay,"ready",function(){i.viewport=i.overlay.getBounds()}),mapp.event.addListenerOnce(this.overlay,"error",function(){alert(mappl10n.kml_error)})):(mapp.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),mapp.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)})));mapp.event.addListener(this.overlay,"click",function(n){i.open(n)});this.setTitle(n("<div>").html(this.title).text());this.setEditable(this.map.editable);mappl10n.options.engine=="leaflet"?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())},setEditable:function(n){var t=this;this.type!="kml"&&(mappl10n.options.engine=="leaflet"?this.overlay.options.draggable=n:this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),n&&(mapp.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.close()}),(this.type=="polygon"||this.type=="polyline")&&mapp.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},setTitle:function(n){this.type||(mappl10n.options.engine=="leaflet"?this.overlay.title=n:this.overlay.setTitle(n))},setZIndex:function(n){mappl10n.options.engine=="leaflet"?this.type||this.overlay.setZIndexOffset(n):this.overlay.set("zIndex",n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.iconid=n,mappl10n.options.engine=="leaflet"?this.overlay.setIcon(mapp.Icons.get(n)):(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(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)},setTemplateColors:function(n,t,i){var r=this.type=="polyline"?{strokeColor:n,strokeOpacity:t/100,strokeWeight:i}:{fillColor:n,fillOpacity:t/100,strokeColor:n,strokeWeight:i,strokeOpacity:1};this.setColors(r)},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},getTemplateColors:function(){var n=this.getColors();return this.type=="polyline"?{color:n.strokeColor,opacity:n.strokeOpacity*100,weight:n.strokeWeight}:{color:n.fillColor,opacity:n.fillOpacity*100,weight:n.strokeWeight}},center:function(n){var t=this.getBounds();if(typeof n=="number"){this.map.setView(this.getPosition(),n);return}if(!t){this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));return}this.map.fitBounds(t);this.map.setView(this.getPosition(),n)},open:function(n){this.map.open(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;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=mappl10n.options.engine=="leaflet"?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport}return n},getPosition:function(n){if(!this.type)return mappl10n.options.engine=="leaflet"?this.overlay.getLatLng():this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():mappl10n.options.engine=="leaflet"?new L.latLng(0,0):new google.maps.LatLng(0,0)},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){var t=this.isPoly()?"poly":this.type;switch(t){case"kml":return mappl10n.options.engine=="leaflet"?[0,0]:n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0);case"poly":return mappl10n.options.engine=="leaflet"?[0,0]:new google.maps.Point(0,0);default:return mappl10n.options.engine=="leaflet"?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}},render:function(n){return this.icon=mapp.Icons.getUrl(this.iconid),mapp.lib.template(this.map.templates[n],{poi:this,colors:this.getTemplateColors()})}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(n){mapp.widgets.Grid=function(t,i){this.el=n(t);this.options=jQuery.extend({action:null,sortable:!1},i);var r=this;this.table=n("table",this.el);this.template=n("script",this.el).html().replace(new RegExp("'","g"),'"');this.el.on("click",function(t){var u=n(t.target),i=u.attr("data-mapp-action");i&&(r[i](t),t.preventDefault())})};mapp.widgets.Grid.prototype={add:function(){this.table.show();var t=n(this.template).appendTo(this.table);n(":input:eq(0)",t).focus()},remove:function(t){var i=n(t.target).closest("tr").remove();n("tbody > tr",this.table).length||this.table.hide()}}}(jQuery);+function(n){mapp.widgets.Popup=function(t,i){var r,u;if(this.activeToggle=null,this.content=t,this.el=null,r=this,this.options=n.extend({max:!1,modal:!1,position:null,toggle:null},i),this.options.modal?this.el=this.content.addClass("mapp-popup-fixed"):(this.el=n('<div class="mapp-popup">'),this.setContent(t)),this.el.attr("tabindex",0),this.options.max&&this.el.addClass("mapp-popup-max"),this.el.hide(),!this.options.modal)n(document).on("click.mapp.popup",function(t){n.contains(r.el.get(0),t.target)||r.el.get(0)==t.target||r.close()});if(this.options.toggle){u=typeof this.options.toggle=="string"?this.options.toggle:this.options.toggle.selector;n(document).on("click",u,function(t){r.activeToggle=n(this);r.open();t.stopPropagation()})}this.el.on("click",".mapp-close",function(){r.close()});this.el.on("keydown",function(n){n.which==27&&r.close()});return this};mapp.widgets.Popup.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.backdrop&&(this.backdrop.remove(),n("body").removeClass("mapp-popup-modal")),this.el.hide(),this.activeToggle&&this.activeToggle.focus(),this.el.trigger("closed.mapp.popup"))},open:function(){var t=this;this.options.modal||this.el.parent().length||this.el.appendTo("body");this.el.show();this.options.modal?(this.backdrop=n('<div class="mapp-popup-backdrop"><\/div>'),this.el.after(this.backdrop),n("body").addClass("mapp-popup-modal")):this.el.position(n.extend({my:"center bottom",at:"center top-5",of:this.activeToggle,collision:"flipfit"},this.options.position));this.el.focus();this.el.trigger("open.mapp.popup")},setContent:function(n){this.el.empty();this.el.append('<span class="mapp-close">').append(n)},toggle:function(){this.el.is(":visible")?this.close():this.open()}}}(jQuery);+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
1
+ var mapp=window.mapp||{};+function(n){mapp.Map=function(n,t){this.defaults={center:null,editable:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,mapOpts:null,name:null,pois:null,postid:null,query:null,title:null,width:null,zoom:null};this.highlight=null;this.iw=null;this.places=null;this.poi=null;this.settings=t?t:{};this.templates=null;this.dir_=null;this.div={};this.layers_={};this.map_=null;this.pois_=[];this.xhr_;this.zindex_=0;_.extend(this,this.defaults,_.pick(n,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)))};mapp.Map.prototype={display:function(){var t=this,i;this.div.layout=n("#"+this.name+"-layout");n.each(["canvas","controls","dialog","directions","filters","iw","list","menu","search"],function(i,r){t.div[r]=n(".mapp-"+r,t.div.layout)});this.sanity();this.templates=this.editable?{loop:"edit-loop",item:"edit-item",popup:"edit-popup"}:this.query?{loop:"map-loop",item:"mashup-item",popup:"mashup-popup"}:{loop:"map-loop",item:"map-item",popup:"map-popup"};mappl10n.options.engine=="leaflet"?(i=_.extend({attribution:'Map data © <a href="https://openstreetmap.org">OpenStreetMap<\/a>',minZoom:0,scrollWheelZoom:!1,worldCopyJump:!0,zoomControl:null},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_=new L.Map(this.div.canvas.get(0),i),L.control.zoom({position:"bottomright",zoomInTitle:"",zoomOutTitle:""}).addTo(this.map_),this.iw=L.popup(),this.iw.setContent(this.div.iw.get(0))):(this.map_=new google.maps.Map(this.div.canvas.get(0),{mapTypeId:"roadmap",zoom:1}),i=_.extend({backgroundColor:"transparent",clickableIcons:!1,fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query},this.mapOpts),i.minZoom=isNaN(parseInt(i.minZoom))?0:parseInt(i.minZoom),this.map_.setOptions(i),this.toggleMapTypeId(this.mapTypeId,!0),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.iw.setContent(this.div.iw.get(0)),mapp.event.addListenerOnce(this.map_,"idle",function(){t.initialOpen()}),this.addLayers());this.addStyles();this.addControls();this.addMenu();this.places=new mapp.Places(n(".mapp-places",this.div.search),{map:t});n(this.places).on("search.mapp",function(n,i){t.search(i)});this.addEvents("click drag",function(){t.close()});this.query&&mappl10n.options.search&&!this.editable&&this.addSearchMove();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);this.div.layout.on("click","[data-mapp-action]",function(i){var r=n(this).attr("data-mapp-action");i.preventDefault();t.action(r,n(this).attr("data-mapp-"+r),n(this))});this.div.filters.on("change",function(){t.ajaxQuery(t.getBounds())});n(window).resize(function(){t.resize()});this.query||this.setPois(this.pois);this.places.parse(this.center,function(n){t.query?n?t.search(n):t.ajaxQuery():(n&&n.geometry&&n.geometry.location&&(t.center=n.geometry.location),t.recenter())});mappl10n.options.engine=="leaflet"&&this.initialOpen()},initialOpen:function(){var n=this.pois_.length?this.pois_[0]:null;this.initialOpenDirections?this.openDirections(null,n):n&&this.initialOpenInfo&&n.open()},search:function(n){var i=n.geometry.location?n.geometry.location:null,t=n.geometry.viewport?n.geometry.viewport:null,f,u,r;mappl10n.options.engine=="leaflet"?(f=new L.LatLng(i.lat,i.lng),r=f.toBounds(mappl10n.options.radius*1e3)):(u=new google.maps.Circle({center:i,radius:mappl10n.options.radius*1e3}),r=t?new google.maps.LatLngBounds(new google.maps.LatLng(t.sw.lat,t.sw.lng),new google.maps.LatLng(t.ne.lat,t.ne.lng)).union(u.getBounds()):u.getBounds());this.fitBounds(r,0);this.setView(i);this.ajaxQuery(r)},load:function(n){_.extend(this,this.defaults,n,this.settings);this.toggleMapTypeId(this.mapTypeId,!0);this.toggleView("menu",!1);this.toggleLayer();this.close();this.setPois(this.pois_);this.places.set("")},action:function(t,i,r){var f=this,u;switch(t){case"center":this.toggleView("menu",!1);this.close();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":this.div.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(this.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate(function(n){f.search(n)});break;case"layer":this.toggleLayer(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":u=r.attr("data-mapp-poi");this.open(this.pois_[u]);break;case"show":this.div.layout.show();this.resize();this.initCenter();break;case"view-map":this.toggleView("list",!1);break;case"view-list":this.toggleView("list",!0);break;default:return!0}},dialog:function(n,t){var i=this;n?(this.div.dialog.html(n),this.div.dialog.show(),t&&(clearTimeout(this.dialog.fade),this.dialog.fade=setTimeout(function(){i.dialog(null)},4e3))):this.div.dialog.hide()},addEvents:function(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)mapp.event.addListener(this.map_,n[i],t)},close:function(){mappl10n.options.engine=="leaflet"?this.map_.closePopup():this.iw.close();this.select(null);n(this).triggerHandler("mapp.close")},openDirections:function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";this.dir_||(this.dir_=new mapp.Directions(this.div.directions,this));this.dir_.open(i,r)},sanity:function(){if(!this.div.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);if(mappl10n.options.autoupdate==="tc")return mapp.lib.log("Maps API missing (800001)");if(typeof _=="undefined")return mapp.lib.alert("ERROR: underscore.js not loaded. Check cacheing / optimizing plugins.");if(mappl10n.options.engine=="leaflet"){if(typeof L=="undefined")return mapp.lib.alert("ERROR: Unable to load Leaflet")}else{if(typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")})}},select:function(t){if(n("[data-mapp-poi]",this.div.list).removeClass("mapp-selected"),t){var r=n.inArray(t,this.pois_),i=n('[data-mapp-poi="'+r+'"]',this.div.list);i.addClass("mapp-selected");mapp.lib.scrollTo(this.div.list,i);t.setZIndex(++this.zindex_)}this.poi=t},setHighlight:function(n){this.highlight&&(mappl10n.options.engine=="leaflet"?this.highlight.remove():this.highlight.setMap(null));n&&(mappl10n.options.engine=="leaflet"?this.highlight=new L.Marker(n.getPosition()).addTo(this.map_):(this.highlight=new google.maps.Marker({position:n.getPosition()}),this.highlight.setMap(this.map_)))},getMap:function(){return this.map_},renderList:function(){var i=this.getBounds(),r=0,u=this,t;if(!this.editable)for(t=0;t<this.pois_.length;t++)this.pois_[t].visible=this.pois_[t].type!="kml",this.query&&i&&!i.contains(this.pois_[t].getPosition())&&(this.pois_[t].visible=!1),r+=this.pois_[t].visible;this.div.list.html(mapp.lib.template(this.templates.loop,{map:this,pois:this.pois_,count:r}));this.editable&&n(".mapp-items",u.sel).sortable({axis:"y",cursor:"move",delay:200,update:function(){u.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})},getPois:function(){return this.pois_},insertPoi:function(n){var t=this;this.pois_.unshift(n);n.setMap(this);t.renderList();this.select(n)},removePoi:function(t){var r=this,i=n.inArray(t,this.pois_);i!=-1&&(this.pois_[i].setMap(null),this.pois_.splice(i,1),r.renderList())},resetPois:function(){for(i=0;i<this.pois_.length;i++)this.pois_[i].setMap(null);this.pois_=[];this.zindex_=0},setPois:function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),this.pois_.push(i),i.id=this.pois_.length-1,i.setMap(this),i.setZIndex(this.zindex_+n.length-1-t);this.zindex_+=n.length-1}this.renderList()},sortPois:function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(this.pois_[r])}if(t.length!=this.pois_.length)return!1;this.pois_=t;this.renderList()},open:function(t,i){if(this.close(),this.select(t),mappl10n.options.mashupClick!="poi"&&t.postid&&t.url){window.open(t.url);return}if(this.toggleView("list",!1),this.div.iw.html(t.render("popup")),mappl10n.options.engine=="leaflet")this.iw.setLatLng(t.getPosition()),this.iw.options.offset=t.getAnchorPoint(),this.map_.openPopup(this.iw);else{var r=new google.maps.MVCObject;r.setValues({position:t.getPosition(i),anchorPoint:t.getAnchorPoint(i)});this.iw.open(this.map_,r)}n(this).triggerHandler("mapp.open",t)},renderMenu:function(){var t=this;for(layer in this.layers_)this.layers_[layer].getMap()&&n('[data-mapp-layer="'+layer+'"]',this.div.layout).addClass("mapp-active")},addStyles:function(){var e=this,i,o,s,l,a,u,t,h,f;if(mappl10n.options.engine=="leaflet"){for(i=[],o=L.control.layers(),t=0;t<mappl10n.options.baseLayers.length;t++)s=mappl10n.options.baseLayers[t],l=mappl10n.options.providers[s.provider],i.push(n.extend({},l,s));for(a=mappl10n.options.style&&!this.editable&&this.mapTypeId=="streets"?mappl10n.options.style:this.mapTypeId,u=_.findIndex(i,{name:a}),u=u>=0?u:0,t=0;t<i.length;t++)h=L.tileLayer(i[t].url,i[t]),o.addBaseLayer(h,i[t].label),t==u&&h.addTo(this.map_);this.editable&&i.length>1&&o.addTo(this.map_);this.map_.on("baselayerchange",function(n){e.mapTypeId=n.layer.options.name})}else{var r=mappl10n.options.styles?mappl10n.options.styles:[],c=mappl10n.options.style,v=["roadmap","satellite","terrain","hybrid"];if(c&&typeof r[c]!="undefined"&&this.map_.setOptions({styles:r[c]}),this.editable){for(f in r)this.map_.mapTypes.set(f,new google.maps.StyledMapType(r[f],{name:f})),v.push(f);this.map_.setOptions({mapTypeControlOptions:{mapTypeIds:v,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else this.mapTypeId&&typeof r[this.mapTypeId]!="undefined"&&this.map_.setOptions({styles:r[this.mapTypeId]});mapp.event.addListener(this.map_,"maptypeid_changed",function(){e.mapTypeId=e.map_.getMapTypeId()})}},addControls:function(){var n=this;this.div.controls.html(mapp.lib.template("map-controls",{map:this}))},addLayers:function(){var u,i,t,r;for(this.layers_={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},u=n.makeArray(this.layers),i=0;i<u.length;i++)t=n.trim(u[i]),r=t.split(".").pop(),this.layers_[t]?this.toggleLayer(t):r=="kml"||r=="kmz"?this.layers_[t]=new google.maps.KmlLayer({map:this.map_,preserveViewport:!0,url:t}):r=="json"&&(this.layers_[t]=new google.maps.Data({map:this.map_}).loadGeoJson(t))},addMenu:function(){var t=this;n("body").on("click",function(i){var r=n(i.target),u=r.attr("data-mapp-action");r==t.div.filters||u=="filters-toggle"||r.closest(t.div.filters).length||t.toggleView("filters",!1);r==t.div.menu||u=="menu-toggle"||r.closest(t.div.menu).length||t.toggleView("menu",!1)})},toggleLayer:function(t,i){var r=this;i=typeof i!="undefined"?i:this.layers_[t].getMap()==null;n.each(["traffic","bicycling","transit"],function(n,t){r.layers_[t].setMap(null)});i&&this.layers_[t].setMap(this.map_)},toggleMapTypeId:function(t,i){var u=this,r=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(this.getMapTypeId()==t);t=u.editable?i&&(r||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":r?t:"roadmap";this.map_.setMapTypeId(t)},togglePois:function(n){n=!!n;for(var t=0;t<this.pois_.length;t++)this.pois_[t].setVisible(n)},toggleView:function(n,t){t=typeof t=="undefined"?!this.div.layout.hasClass("mapp-view-"+n):t;this.div.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&this.renderMenu();n=="directions"&&(this.close(),this.resize())},resize:function(){var n=this.getCenter();this.toggleView("mini",this.div.layout.width()<mappl10n.options.mini);mappl10n.options.engine=="leaflet"?this.map_.invalidateSize():mapp.event.trigger(this.map_,"resize");this.setView(n)},recenter:function(){var r=this.center&&this.center.lat&&this.center.lng?this.center:null,n=this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,t,i;if(r){this.setView(r,n?n:1);return}if(this.pois_.length==0){this.setView({lat:0,lng:0},n?n:1);return}if(this.pois_.length==1){this.pois_[0].center(n);return}for(bounds=mappl10n.options.engine=="leaflet"?new L.LatLngBounds:new google.maps.LatLngBounds,t=0;t<this.pois_.length;t++)i=this.pois_[t].getBounds(),bounds=i?mappl10n.options.engine=="leaflet"?bounds.extend(i):bounds.union(i):bounds.extend(this.pois_[t].getPosition());this.fitBounds(bounds,0)},toJSON:function(){var n;for(this.pois=[],n=0;n<this.pois_.length;n++)this.pois.push(this.pois_[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:this.mapTypeId,metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}},ajaxSave:function(n){var t=this,i=JSON.stringify(this),r=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:i,postid:r},callback:function(i){i.status=="OK"&&(t.mapid=i.data.mapid,n(i.data))}})},fitBounds:function(n){return this.map_.fitBounds(n)},getBounds:function(){try{return this.map_.getBounds()}catch(n){return null}},getCenter:function(){try{return this.map_.getCenter()}catch(n){return null}},getMapTypeId:function(n){return mappl10n.options.engine=="leaflet"?"roadmap":this.map_.getMapTypeId(n)},setView:function(n,t,i){mappl10n.options.engine=="leaflet"?(t==null&&(t=this.map_.getZoom()?this.map_.getZoom():0),this.map_.setView(n,t,i)):(n&&this.map_.setCenter(n),t&&this.map_.setZoom(t))}};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){this.sel=n(t);this.map=i;this.directionsRenderer=null;this.directionsService=null;this.placesService=null;var r=this;this.sel.on("keydown",function(n){n.which==13?(r.getDirections(),n.preventDefault()):n.which==27&&r.close()});this.sel.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action"),u=n(".mapp-dir-daddr",r.sel).val(),f=n(".mapp-dir-saddr",r.sel).val();t.preventDefault();switch(i){case"dir-cancel":r.close();break;case"dir-get":r.getDirections();break;case"dir-myloc":r.map.places.geolocate(function(t){n(".mapp-dir-saddr",r.sel).val(t.name);r.getDirections()});break;case"dir-swap":n(".mapp-dir-saddr",r.sel).val(u);n(".mapp-dir-daddr",r.sel).val(f);r.getDirections()}});this.open=function(t,i){if(mappl10n.options.directions=="google"){this.openGoogle(t,i);return}this.map.toggleView("directions",!0);n(".mapp-dir-addr",this.sel).removeClass("mapp-error");n(".mapp-dir-saddr",this.sel).val(t);n(".mapp-dir-daddr",this.sel).val(i);n(".mapp-dir-get",this.sel).focus();n(".mapp-dir-saddr",this.sel).focus()};this.close=function(){this.map.toggleView("directions",!1);this.directionsRenderer&&(this.directionsRenderer.setPanel(null),this.directionsRenderer.getMap()&&(this.directionsRenderer.setMap(null),this.map.togglePois(!0)))};this.getDirections=function(){this.map.close();this.openGoogle(n(".mapp-dir-saddr",this.sel).val(),n(".mapp-dir-daddr",this.sel).val());return};this.openGoogle=function(n,t){var i=mappl10n.options.directionsServer;i.toLowerCase().indexOf("http")==-1&&(i="https://"+i);i+="?saddr="+encodeURIComponent(n);i+="&daddr="+encodeURIComponent(t);window.open(i)}}}(jQuery);mapp=window.mapp||{};mapp.geocoders={};+function(){mapp.geocoders.Algolia=function(n){this.map=n;this.places=algoliasearch.initPlaces()};mapp.geocoders.Algolia.prototype={geocode:function(n,t){var i=this;this.getPredictions(n,function(i){i&&i.hits.length?t({formatted_address:i.hits[0].locale_names[0],name:n,geometry:{location:{lat:i.hits[0]._geoloc.lat,lng:i.hits[0]._geoloc.lng}}}):t(null)})},getDetails:function(n,t){t({formatted_address:n.value,name:n.name,geometry:{location:n.latlng}})},getPredictions:function(n,t){this.places.search({query:n,language:mappl10n.options.language},function(n,i){n||!i?t(null):t(i)})}}}(jQuery);+function(n){mapp.geocoders.Google=function(t){this.map=t;this.token=null;this.types=this.map.editable?null:["geocode"];var i=n('<div style="display:none">').appendTo("body");this.placesService=new google.maps.places.PlacesService(i.get(0));this.autocompleteService=new google.maps.places.AutocompleteService;i.remove()};mapp.geocoders.Google.prototype={geocode:function(t,i){var r=this;this.getPredictions(t,function(t){t&&n.isArray(t)?r.getDetails(t[0],function(n){i(n)}):i(null)})},getDetails:function(n,t){this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;this.token=null;var i={placeId:n.place_id,sessionToken:this.token};this.placesService.getDetails(i,function(n,i){if(i=="OK"&&n&&n.geometry){if(n.geometry.location&&(n.geometry.location=n.geometry.location.toJSON()),n.geometry.viewport){var r=n.geometry.viewport.toJSON();n.geometry.viewport={sw:{lat:r.south,lng:r.west},ne:{lat:r.north,lng:r.east}}}t(n)}else t(null)})},getPredictions:function(n,t){var i,r;this.token=this.token?this.token:new google.maps.places.AutocompleteSessionToken;i=this.map.getMap().getBounds();i=i?i:new google.maps.LatLngBounds(new google.maps.LatLng(85,-180),new google.maps.LatLng(-85,180));r={input:n,bounds:i,sessionToken:this.token,types:this.types};this.autocompleteService.getPlacePredictions(r,function(n,i){i=="OK"&&n&&n.length?t(n):(i==google.maps.places.PlacesServiceStatus.REQUEST_DENIED?alert("Google Maps API Key error: please enable the Places API in the Google Developer Console."):i==google.maps.places.PlacesServiceStatus.OVER_QUERY_LIMIT&&alert("Google Maps API Key has exceeded its query limit"),t(null))})}}}(jQuery);mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){var n="https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png";return mappl10n.options.engine=="leaflet"?L.icon({iconUrl:n,iconAnchor:[16,32],iconSize:[32,32],popupAnchor:[0,-32]}):{url:n}};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({border:20},i),u=null,r=null,o,e=this;r=n('<div class="mapp-ib-wrapper" tabindex="0"><div class="mapp-ib" tabindex="0"><\/div><div class="mapp-ib-tip"><\/div><\/div>').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){e.close()});r.on("keydown",function(n){n.which==27&&e.close()});r.on("click",".mapp-close",function(){e.close()});this.getContent=function(){return n(".mapp-ib",r)};this.setContent=function(t){n(".mapp-ib",r).empty().append(t)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){o=!1;var t=n(":input",r);r.show();t.length?t.first().focus():r.focus();google.maps.event.trigger(e,"domready")};this.draw=function(){var l=this.getMap(),a=n(".mapp-ib-body",r),s=this.getProjection().fromLatLngToContainerPixel(u.position),t,h,c,i,e;o||(o=!0,t={width:n(":first-child",l.getDiv()).width(),height:n(":first-child",l.getDiv()).height()},r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"}),h=r.outerWidth(!0),c=r.outerHeight(!0),c>t.height+u.anchorPoint.y-2*f.border&&(c=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":c+2})),i=s.x,e=s.y,i+h/2>t.width&&(i=t.width-h/2),i-h/2<0&&(i=h/2),e-c+u.anchorPoint.y<f.border&&(e=c-u.anchorPoint.y+f.border),e>t.height&&(e=t.height),(s.x-i||s.y-e)&&l.panBy(s.x-i,s.y-e),r.css({left:i-h/2,bottom:t.height-e-u.anchorPoint.y}))};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.hide()}};mappl10n.options.engine!="leaflet"&&(mapp.InfoBox.prototype=new google.maps.OverlayView)}(jQuery);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}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}};mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).find(".mapp-canvas").attr("id"),t=window[i];t.resize();t.recenter()})})}(jQuery);+function(){mappl10n.options.engine=="leaflet"&&(L.LatLng.prototype.toJSON=function(){return{lat:this.lat,lng:this.lng}},L.LatLngBounds.prototype.toJSON=function(){return{south:this.getSouth(),west:this.getWest(),north:this.getNorth(),east:this.getEast()}},L.LatLng.prototype.toUrlValue=function(){return Math.round(this.lat*1e6)/1e6+", "+Math.round(this.lng*1e6)/1e6});mapp.event={addListener:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.on(t,i);else google.maps.event.addListener(n,t,i)},addListenerOnce:function(n,t,i){if(mappl10n.options.engine=="leaflet")n.once(t,i);else google.maps.event.addListenerOnce(n,t,i)},clearInstanceListeners:function(n){mappl10n.options.engine=="leaflet"?n.off():google.maps.event.clearInstanceListeners(n)},clearListeners:function(n,t){mappl10n.options.engine=="leaflet"?n.off(t):google.maps.event.clearListeners(n,"rightclick")},trigger:function(n,t,i){mappl10n.options.engine=="leaflet"?n.fire(t,i):google.maps.event.trigger(n,t,i)}}}(jQuery);mapp=window.mapp||{};jQuery.fn.AlgoliaAutocomplete=jQuery.fn.autocomplete.noConflict();+function(n){mapp.Places=function(t,i){var r=this;this.sel=n(t);this.opts=n.extend({map:null},i);this.geocoder=mappl10n.options.engine=="leaflet"?new mapp.geocoders.Algolia(this.opts.map):new mapp.geocoders.Google(this.opts.map);this.sel.on("keydown",function(t){if(t.which==13){t.preventDefault();var i=r.parseLatLng(r.sel.val());i&&(n(r).triggerHandler("search.mapp",i),r.sel.AlgoliaAutocomplete("close"),t.stopImmediatePropagation())}});this.autocomplete();this.sel.focus()};mapp.Places.prototype={parse:function(t,i){var f=this,u=t&&t.name?n.trim(t.name):n.trim(t),r;if(!u){i(null);return}if(u=="user"){this.geolocate(function(n){i(n)});return}if(t&&t.geometry){i(t);return}if(r=this.parseLatLng(t),r){i(r);return}this.geocoder.geocode(t,function(n){i(n)})},parseLatLng:function(t){var i,u,r;return t.lat&&t.lng?i=t:(u=t&&t.name?n.trim(t.name):n.trim(t),r=u.split(","),r.length!=2||isNaN(r[0])||isNaN(r[1])||(i={lat:r[0],lng:r[1]})),i?{name:i.lat+", "+i.lng,geometry:{location:i}}:null},geolocate:function(n){var t=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){var i={lat:t.coords.latitude,lng:t.coords.longitude};n({name:i.lat+", "+i.lng,geometry:{location:i}})},function(t){var i=t&&t.message?" : "+t.message:"";alert(mappl10n.no_geolocate+i);n(null)},{timeout:15e3,enableHighAccuracy:!0,maximumAge:3e4})},autocomplete:function(){var t=this,r,i,u;this.sel.on("autocomplete:selected",function(i,r){t.geocoder.getDetails(r,function(i){t.parse(i,function(i){i&&n(t).triggerHandler("search.mapp",i)})})});r={empty:'<div class="list-group search-results-dropdown"><div class="list-group-item">'+mappl10n.no_results+"<\/div><\/div>",header:'<div class="list-group search-results-dropdown">'};mappl10n.options.engine=="leaflet"?(i={algoliasearch:algoliasearch,templates:r},mappl10n.options.country&&(i.countries=[mappl10n.options.country]),mappl10n.options.language&&(i.language=mappl10n.options.language),u=placesAutocompleteDataset(i)):u={display:"description",source:function(n,i){t.geocoder.getPredictions(n,function(n){matches=n;i(matches)})},templates:r};this.sel.AlgoliaAutocomplete({autoselect:!0,cssClasses:{prefix:"mapp-aa"},debug:!1,hint:!0,highlight:!0,minLength:1},u)}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var u,f,r,o,i,e,h,s;if(this.defaults={address:null,body:null,iconid:null,kml:null,map:null,overlay:null,postid:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),mappl10n.options.engine=="leaflet"&&this.isPoly()&&(this.type=null),t.viewport&&t.viewport.sw&&t.viewport.ne&&(u=t.viewport.sw,f=t.viewport.ne,this.viewport=mappl10n.options.engine=="leaflet"?new L.LatLngBounds(L.latLng(u.lat,u.lng),L.latLng(f.lat,f.lng)):new google.maps.LatLngBounds(new google.maps.LatLng(u.lat,u.lng),new google.maps.LatLng(f.lat,f.lng))),r=[],o=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],e=0;e<t.poly.paths[i].length;e++)r.push(new google.maps.LatLng(t.poly.paths[i][e].lat,t.poly.paths[i][e].lng));o.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":h=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:h,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":s=t.kml&&t.kml.url?t.kml.url:"";this.overlay=mappl10n.options.engine=="leaflet"?omnivore.kml(s):new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:this.overlay=mappl10n.options.engine=="leaflet"?L.marker([t.point.lat,t.point.lng]):new google.maps.Marker({position:new google.maps.LatLng(t.point.lat,t.point.lng)})}t.type||this.setIcon(t.iconid)};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},u=this.getPosition(),i,t,r;if(n.point=u.toJSON(),i=this.viewport?this.viewport:this.getBounds(),i&&(t=i.toJSON(),n.viewport={sw:{lat:t.south,lng:t.west},ne:{lat:t.north,lng:t.east}}),this.type=="kml"&&(n.kml=this.kml),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(t.toJSON())});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push(n.toJSON())});n.poly.paths.push(i)});break;case"rectangle":r=this.overlay.getBounds();n.viewport={sw:r.getSouthWest().toJSON(),ne:r.getNorthEast().toJSON()}}}return n},setMap:function(t){var i=this;if(this.map=t,mapp.event.clearInstanceListeners(this.overlay),t==null){mappl10n.options.engine=="leaflet"?this.overlay.remove():this.overlay.setMap(null);return}this.type=="kml"&&(mappl10n.options.engine=="leaflet"?(mapp.event.addListenerOnce(this.overlay,"ready",function(){i.viewport=i.overlay.getBounds()}),mapp.event.addListenerOnce(this.overlay,"error",function(){alert(mappl10n.kml_error)})):(mapp.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),mapp.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)})));mapp.event.addListener(this.overlay,"click",function(n){i.open(n)});this.setTitle(n("<div>").html(this.title).text());this.setEditable(this.map.editable);mappl10n.options.engine=="leaflet"?this.overlay.addTo(t.getMap()):this.overlay.setMap(t.getMap())},setEditable:function(n){var t=this;this.type!="kml"&&(mappl10n.options.engine=="leaflet"?this.overlay.options.draggable=n:this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),mapp.event.clearListeners(this.overlay,"rightclick"),mapp.event.clearListeners(this.overlay,"dragstart"),n&&(mapp.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.close()}),(this.type=="polygon"||this.type=="polyline")&&mapp.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},setTitle:function(n){this.type||(mappl10n.options.engine=="leaflet"?this.overlay.title=n:this.overlay.setTitle(n))},setZIndex:function(n){mappl10n.options.engine=="leaflet"?this.type||this.overlay.setZIndexOffset(n):this.overlay.set("zIndex",n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.iconid=n,mappl10n.options.engine=="leaflet"?this.overlay.setIcon(mapp.Icons.get(n)):(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(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)},setTemplateColors:function(n,t,i){var r=this.type=="polyline"?{strokeColor:n,strokeOpacity:t/100,strokeWeight:i}:{fillColor:n,fillOpacity:t/100,strokeColor:n,strokeWeight:i,strokeOpacity:1};this.setColors(r)},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},getTemplateColors:function(){var n=this.getColors();return this.type=="polyline"?{color:n.strokeColor,opacity:n.strokeOpacity*100,weight:n.strokeWeight}:{color:n.fillColor,opacity:n.fillOpacity*100,weight:n.strokeWeight}},center:function(n){var t=this.getBounds();if(typeof n=="number"){this.map.setView(this.getPosition(),n);return}if(!t){this.map.setView(this.getPosition(),parseInt(mappl10n.options.poiZoom));return}this.map.fitBounds(t);this.map.setView(this.getPosition(),n)},open:function(n){this.map.open(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;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=mappl10n.options.engine=="leaflet"?this.overlay.getBounds().isValid()?this.overlay.getBounds():null:this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport}return n},getPosition:function(n){if(!this.type)return mappl10n.options.engine=="leaflet"?this.overlay.getLatLng():this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():mappl10n.options.engine=="leaflet"?new L.latLng(0,0):new google.maps.LatLng(0,0)},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){var t=this.isPoly()?"poly":this.type;switch(t){case"kml":return mappl10n.options.engine=="leaflet"?[0,0]:n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0);case"poly":return mappl10n.options.engine=="leaflet"?[0,0]:new google.maps.Point(0,0);default:return mappl10n.options.engine=="leaflet"?this.overlay.options.icon.options.popupAnchor?this.overlay.options.icon.options.popupAnchor:[0,-32]:typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}},render:function(n){return this.icon=mapp.Icons.getUrl(this.iconid),mapp.lib.template(this.map.templates[n],{poi:this,colors:this.getTemplateColors()})}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(n){mapp.widgets.Grid=function(t,i){this.el=n(t);this.options=jQuery.extend({action:null,sortable:!1},i);var r=this;this.table=n("table",this.el);this.template=n("script",this.el).html().replace(new RegExp("'","g"),'"');this.el.on("click",function(t){var u=n(t.target),i=u.attr("data-mapp-action");i&&(r[i](t),t.preventDefault())})};mapp.widgets.Grid.prototype={add:function(){this.table.show();var t=n(this.template).appendTo(this.table);n(":input:eq(0)",t).focus()},remove:function(t){var i=n(t.target).closest("tr").remove();n("tbody > tr",this.table).length||this.table.hide()}}}(jQuery);+function(n){mapp.widgets.Popup=function(t,i){var r,u;if(this.activeToggle=null,this.content=t,this.el=null,r=this,this.options=n.extend({max:!1,modal:!1,position:null,toggle:null},i),this.options.modal?this.el=this.content.addClass("mapp-popup-fixed"):(this.el=n('<div class="mapp-popup">'),this.setContent(t)),this.el.attr("tabindex",0),this.options.max&&this.el.addClass("mapp-popup-max"),this.el.hide(),!this.options.modal)n(document).on("click.mapp.popup",function(t){n.contains(r.el.get(0),t.target)||r.el.get(0)==t.target||r.close()});if(this.options.toggle){u=typeof this.options.toggle=="string"?this.options.toggle:this.options.toggle.selector;n(document).on("click",u,function(t){r.activeToggle=n(this);r.open();t.stopPropagation()})}this.el.on("click",".mapp-close",function(){r.close()});this.el.on("keydown",function(n){n.which==27&&r.close()});return this};mapp.widgets.Popup.prototype={close:function(){this.el&&this.el.is(":visible")&&(this.backdrop&&(this.backdrop.remove(),n("body").removeClass("mapp-popup-modal")),this.el.hide(),this.activeToggle&&this.activeToggle.focus(),this.el.trigger("closed.mapp.popup"))},open:function(){var t=this;this.options.modal||this.el.parent().length||this.el.appendTo("body");this.el.show();this.options.modal?(this.backdrop=n('<div class="mapp-popup-backdrop"><\/div>'),this.el.after(this.backdrop),n("body").addClass("mapp-popup-modal")):this.el.position(n.extend({my:"center bottom",at:"center top-5",of:this.activeToggle,collision:"flipfit"},this.options.position));this.el.focus();this.el.trigger("open.mapp.popup")},setContent:function(n){this.el.empty();this.el.append('<span class="mapp-close">').append(n)},toggle:function(){this.el.is(":visible")?this.close():this.open()}}}(jQuery);+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
js/mappress_editor.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(n){mapp.Media=function(){this.editor=null;this.map=null;this.settings=null;this.tplEditor=null;this.sel=n(".mapp-media");this.list=[];var t=this;this.initialize=function(){this.find();n(".mapp-media-list-type",this.sel).on("change",function(){var i=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-search").val("");n(".mapp-media-search").toggle(i=="all");t.find()});var i=_.debounce(function(){t.find()});n(".mapp-media-search").keydown(function(){i();console.log("search")});this.settings={editable:!0,name:"mapp0"};this.sel.on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media");t[r]()});n(".mapp-media-list .mapp-item",this.sel).on("click",function(){n(".mapp-media-list .mapp-item",this.sel).removeClass("mapp-active");n(this).addClass("mapp-active")});n(".mapp-media-list",this.sel).on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media"),u=n(this).closest(".mapp-item"),f=u.attr("data-mapp-mapid");return t[r](f),!1});this.sel.on("change",".mapp-media-viewport",function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())});n(".mapp-media-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n(".mapp-media-width").val(i);n(".mapp-media-height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){t.save()});n(".mapp-media-title").keydown(function(n){n.which==13&&(n.preventDefault(),t.save())})};this.add=function(){var n=new mapp.Map(this.settings);n.width=mappl10n.options.sizes[mappl10n.options.size].width;n.height=mappl10n.options.sizes[mappl10n.options.size].height;t.open(n)};this.cancel=function(){t.closeEditor()};this.closeEditor=function(){this.editor.close();this.map=null;this.editor=null;n(".mapp-media-edit-panel").hide();n(".mapp-media-list-panel").show()};this.edit=function(n){mapp.Map.ajaxGet(n,this.settings,function(n){t.open(n)})};this.find=function(t){var i=this,r=n(".mapp-media-list-type",this.sel).val(),u=n(".mapp-media-search").val();n('[data-mapp-media="more"]',this.sel).prop("disabled",!0);n(".spinner",this.sel).css("visibility","visible");mapp.lib.ajax({type:"GET",data:{action:"mapp_find",type:r,page:t,postid:mappl10n.options.postid,search:u},callback:function(t){t.status=="OK"&&(n('[data-mapp-media="more"]',this.sel).prop("disabled",!1),n(".spinner",this.sel).css("visibility","hidden"),i.list=t.data,i.renderList())}})};this.insert=function(n){n=n?n:this.map.mapid;var t='[mappress mapid="'+n+'"]';send_to_editor(t)};this.more=function(){this.find(this.list.page+1)};this.open=function(t){this.map=t;n(".mapp-edit",this.sel).html(mapp.lib.template("edit-map"));var i=this.map.mapid;i?n(".mapp-media-mapid").text(i):n(".mapp-media-mapid").text("");n(".mapp-media-title").val(this.map.title);n(".mapp-media-width").val(this.map.width);n(".mapp-media-height").val(this.map.height);n(".mapp-media-viewport").prop("checked",!!(this.map.center&&this.map.zoom));n(".mapp-media-edit-panel").show();n(".mapp-media-list-panel").hide();this.editor=new mapp.Editor(this.map)};this.remove=function(n){if(confirm(mappl10n.delete_map_prompt)){var t=_.findIndex(this.list.items,{mapid:n});t>-1&&(this.list.items.splice(t,1),mapp.Map.ajaxDelete(n),this.renderList())}};this.renderList=function(){var t=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-list",this.sel).html(mapp.lib.template("media-list",{list:this.list,type:t}))};this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-media-title").val()),this.map.width=n(".mapp-media-width").val(),this.map.height=n(".mapp-media-height").val(),n(".mapp-media-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave(function(n){var i=_.findIndex(t.list.items,{mapid:t.map.mapid});i==-1?t.list.items.unshift(n):t.list.items[i]=n;t.renderList();t.closeEditor()}))};this.initialize.apply(this)}}(jQuery);+function(n){mapp.Editor=function(t){this.drawingManager=null;this.map=t;this.poiEditor=null;this.sel=n(".mapp-edit");var i=this;this.initialize=function(){this.map.display();this.poiEditor=new mapp.PoiEditor(this.map);this.initDrawingManager();n(this.map.places).off("search.mapp");n(this.map.places).on("search.mapp",function(n,t){i.insertPoi(t)});this.sel.on("click","[data-mapp-editor]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-editor");i[r]()})};this.close=function(){this.map.close()};this.insertPoi=function(n){var t;if(n)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.close(),n.geometry){var i=n.formatted_address?n.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,r=n.name==i?"":i,t=new mapp.Poi({address:i,body:r,iconid:this.poiEditor.lastIcon,point:n.geometry.location,title:n.name,viewport:n.geometry.viewport?n.geometry.viewport:null});this.map.insertPoi(t);t.center()}else n.overlay&&(t=new mapp.Poi({body:"",iconid:n.type=="marker"?null:"poly",overlay:n.overlay,title:n.type=="marker"?n.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:n.type=="marker"?null:n.type}),this.map.insertPoi(t))};this.initDrawingManager=function(){};this.layer=function(){var n=window.prompt(mappl10n.layer);n&&i.insertPoi(n)};this.initialize.apply(this)};mapp.PoiEditor=function(t){this.map=t;this.poi=null;this.sel=null;this.lastIcon=null;var i=this;this.initialize=function(){this.sel=n(this.map.iw.getContent());n(this.map).on("mapp.open",function(n,t){i.render(t)});n(this.map).on("mapp.close",function(){i.mce(!1)});this.sel.on("click","[data-mapp-poi]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-poi");i[r]()});this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",function(){var t=n(this).hasClass("mapp-poi-visual");i.mce(t)});this.sel.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),i.save())});this.sel.on("change","[data-mapp-iconpicker]",function(){i.poi.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));i.lastIcon=i.poi.iconid;i.map.renderList()});this.sel.on("change","[data-mapp-colorpicker]",function(){i.poi.setTemplateColors(n("[data-mapp-colorpicker]").attr("data-mapp-color"),n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),n("[data-mapp-colorpicker]").attr("data-mapp-weight"));i.map.renderList()})};this.cancel=function(){this.map.close()};this.initMCE=function(){var n,t,i;typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(n="en",typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,n=typeof t.language!="undefined"?t.language:"en"),i={mode:"none",height:"75px",convert_urls:!1,language:n,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""},tinyMCE.init(i),this.mce(!0))};this.mce=function(t){var r=t?"mceAddEditor":"mceRemoveEditor";typeof tinyMCE!="undefined"&&tinyMCE.execCommand(r,!1,"mapp-poi-body");n(".mapp-poi-visual, .mapp-poi-html",i.sel).removeClass("mapp-active");t?n(".mapp-poi-visual",i.sel).addClass("mapp-active"):n(".mapp-poi-html",i.sel).addClass("mapp-active")};this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.close(),this.map.removePoi(this.poi))};this.render=function(t){this.poi=t;n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh");this.initMCE()};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();this.poi.title=n(".mapp-poi-title").val();this.poi.body=n(".mapp-poi-body").val();this.map.renderList();this.map.close()};this.initialize.apply(this)}}(jQuery)
1
+ var mapp=window.mapp||{};+function(n){mapp.Media=function(){this.editor=null;this.map=null;this.settings=null;this.tplEditor=null;this.sel=n(".mapp-media");this.list=[];var t=this;this.initialize=function(){this.find();n(".mapp-media-list-type",this.sel).on("change",function(){var i=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-search").val("");n(".mapp-media-search").toggle(i=="all");t.find()});var i=_.debounce(function(){t.find()});n(".mapp-media-search").keydown(function(){i();console.log("search")});this.settings={editable:!0,name:"mapp0"};this.sel.on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media");t[r]()});n(".mapp-media-list .mapp-item",this.sel).on("click",function(){n(".mapp-media-list .mapp-item",this.sel).removeClass("mapp-active");n(this).addClass("mapp-active")});n(".mapp-media-list",this.sel).on("click","[data-mapp-media]",function(i){i.preventDefault();var r=n(this).attr("data-mapp-media"),u=n(this).closest(".mapp-item"),f=u.attr("data-mapp-mapid");return t[r](f),!1});this.sel.on("change",".mapp-media-viewport",function(){n(this).is(":checked")||(t.map.center=t.map.zoom=null,t.map.recenter())});n(".mapp-media-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n(".mapp-media-width").val(i);n(".mapp-media-height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){t.save()});n(".mapp-media-title").keydown(function(n){n.which==13&&(n.preventDefault(),t.save())})};this.add=function(){var n=new mapp.Map(this.settings);n.width=mappl10n.options.sizes[mappl10n.options.size].width;n.height=mappl10n.options.sizes[mappl10n.options.size].height;t.open(n)};this.cancel=function(){t.closeEditor()};this.closeEditor=function(){this.editor.close();this.map=null;this.editor=null;n(".mapp-media-edit-panel").hide();n(".mapp-media-list-panel").show()};this.edit=function(n){mapp.Map.ajaxGet(n,this.settings,function(n){t.open(n)})};this.find=function(t){var i=this,r=n(".mapp-media-list-type",this.sel).val(),u=n(".mapp-media-search").val();n(".spinner",this.sel).css("visibility","visible");mapp.lib.ajax({type:"GET",data:{action:"mapp_find",type:r,page:t,postid:mappl10n.options.postid,search:u},callback:function(t){t.status=="OK"&&(n(".spinner",this.sel).css("visibility","hidden"),i.list=t.data,i.renderList())}})};this.insert=function(n){n=n?n:this.map.mapid;var t='[mappress mapid="'+n+'"]';send_to_editor(t)};this.open=function(t){this.map=t;n(".mapp-edit",this.sel).html(mapp.lib.template("edit-map"));var i=this.map.mapid;i?n(".mapp-media-mapid").text(i):n(".mapp-media-mapid").text("");n(".mapp-media-title").val(this.map.title);n(".mapp-media-width").val(this.map.width);n(".mapp-media-height").val(this.map.height);n(".mapp-media-viewport").prop("checked",!!(this.map.center&&this.map.zoom));n(".mapp-media-edit-panel").show();n(".mapp-media-list-panel").hide();this.editor=new mapp.Editor(this.map)};this.remove=function(n){if(confirm(mappl10n.delete_map_prompt)){var t=_.findIndex(this.list.items,{mapid:n});t>-1&&(this.list.items.splice(t,1),mapp.Map.ajaxDelete(n),this.renderList())}};this.renderList=function(){var t=n(".mapp-media-list-type",this.sel).val();n(".mapp-media-list",this.sel).html(mapp.lib.template("media-list",{list:this.list,type:t}))};this.save=function(){var t=this;this.map&&(this.map.title=n.trim(n(".mapp-media-title").val()),this.map.width=n(".mapp-media-width").val(),this.map.height=n(".mapp-media-height").val(),n(".mapp-media-viewport").prop("checked")?(this.map.center=this.map.getMap().getCenter().toJSON(),this.map.zoom=this.map.getMap().getZoom()):(this.map.center=null,this.map.zoom=null),this.map.ajaxSave(function(n){var i=_.findIndex(t.list.items,{mapid:t.map.mapid});i==-1?t.list.items.unshift(n):t.list.items[i]=n;t.renderList();t.closeEditor()}))};this.initialize.apply(this)}}(jQuery);+function(n){mapp.Editor=function(t){this.drawingManager=null;this.map=t;this.poiEditor=null;this.sel=n(".mapp-edit");var i=this;this.initialize=function(){this.map.display();this.poiEditor=new mapp.PoiEditor(this.map);this.initDrawingManager();n(this.map.places).off("search.mapp");n(this.map.places).on("search.mapp",function(n,t){i.insertPoi(t)});this.sel.on("click","[data-mapp-editor]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-editor");i[r]()})};this.close=function(){this.map.close()};this.insertPoi=function(n){var t;if(n)if(this.drawingManager&&this.drawingManager.setDrawingMode(null),this.map.close(),n.geometry){var i=n.formatted_address?n.formatted_address.replace(/, United States of America/i,"").replace(/, United States/i,"").replace(/, USA/i,""):null,r=n.name==i?"":i,t=new mapp.Poi({address:i,body:r,iconid:this.poiEditor.lastIcon,point:n.geometry.location,title:n.name,viewport:n.geometry.viewport?n.geometry.viewport:null});this.map.insertPoi(t);t.center()}else n.overlay&&(t=new mapp.Poi({body:"",iconid:n.type=="marker"?null:"poly",overlay:n.overlay,title:n.type=="marker"?n.overlay.getPosition().toUrlValue(6):mappl10n.shape,type:n.type=="marker"?null:n.type}),this.map.insertPoi(t))};this.initDrawingManager=function(){};this.layer=function(){var n=window.prompt(mappl10n.layer);n&&i.insertPoi(n)};this.initialize.apply(this)};mapp.PoiEditor=function(t){this.map=t;this.poi=null;this.sel=null;this.lastIcon=null;var i=this;this.initialize=function(){this.sel=n(this.map.iw.getContent());n(this.map).on("mapp.open",function(n,t){i.render(t)});n(this.map).on("mapp.close",function(){i.mce(!1)});this.sel.on("click","[data-mapp-poi]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-poi");i[r]()});this.sel.on("click",".mapp-poi-visual, .mapp-poi-html",function(){var t=n(this).hasClass("mapp-poi-visual");i.mce(t)});this.sel.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),i.save())});this.sel.on("change","[data-mapp-iconpicker]",function(){i.poi.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));i.lastIcon=i.poi.iconid;i.map.renderList()});this.sel.on("change","[data-mapp-colorpicker]",function(){i.poi.setTemplateColors(n("[data-mapp-colorpicker]").attr("data-mapp-color"),n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),n("[data-mapp-colorpicker]").attr("data-mapp-weight"));i.map.renderList()})};this.cancel=function(){this.map.close()};this.initMCE=function(){var n,t,i;typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(n="en",typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(t=window.tinyMCEPreInit.mceInit.content,n=typeof t.language!="undefined"?t.language:"en"),i={mode:"none",height:"75px",convert_urls:!1,language:n,menubar:!1,plugins:"wordpress,paste,wplink,textcolor,image",relative_urls:!1,remove_script_host:!1,statusbar:!1,theme:"modern",toolbar1:"bold,italic,link,unlink,image",toolbar2:"",toolbar3:"",toolbar4:""},tinyMCE.init(i),this.mce(!0))};this.mce=function(t){var r=t?"mceAddEditor":"mceRemoveEditor";typeof tinyMCE!="undefined"&&tinyMCE.execCommand(r,!1,"mapp-poi-body");n(".mapp-poi-visual, .mapp-poi-html",i.sel).removeClass("mapp-active");t?n(".mapp-poi-visual",i.sel).addClass("mapp-active"):n(".mapp-poi-html",i.sel).addClass("mapp-active")};this.remove=function(){confirm(mappl10n.delete_prompt)&&(this.map.close(),this.map.removePoi(this.poi))};this.render=function(t){this.poi=t;n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh");this.initMCE()};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();this.poi.title=n(".mapp-poi-title").val();this.poi.body=n(".mapp-poi-body").val();this.map.renderList();this.map.close()};this.initialize.apply(this)}}(jQuery)
languages/mappress-google-maps-for-wordpress.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the MapPress Maps for WordPress package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: MapPress Maps for WordPress 2.50.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
- "POT-Creation-Date: 2018-08-18 00:36:33+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -62,7 +62,7 @@ msgid "Map Title"
62
  msgstr ""
63
 
64
  #: forms/map_media.php:26 forms/map_media.php:62 forms/map_media.php:66
65
- #: mappress.php:644
66
  msgid "Untitled"
67
  msgstr ""
68
 
@@ -103,7 +103,7 @@ msgstr ""
103
  msgid "Editor"
104
  msgstr ""
105
 
106
- #: forms/template_editor.php:28 mappress_settings.php:183
107
  msgid "Default"
108
  msgstr ""
109
 
@@ -147,79 +147,71 @@ msgstr ""
147
  msgid "MapPress Settings"
148
  msgstr ""
149
 
150
- #: mappress.php:474
151
- msgid "here"
152
- msgstr ""
153
-
154
- #: mappress.php:475
155
- msgid "MapPress %s uses new templates. Please update your custom templates %s"
156
- msgstr ""
157
-
158
- #: mappress.php:634
159
  msgid "Are you sure you want to delete?"
160
  msgstr ""
161
 
162
- #: mappress.php:635
163
  msgid "Delete this map?"
164
  msgstr ""
165
 
166
- #: mappress.php:636
167
  msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
168
  msgstr ""
169
 
170
- #: mappress.php:637
171
  msgid "Error reading KML file"
172
  msgstr ""
173
 
174
- #: mappress.php:638
175
  msgid "URL for KML file"
176
  msgstr ""
177
 
178
- #: mappress.php:639
179
  msgid "Loading"
180
  msgstr ""
181
 
182
- #: mappress.php:640
183
  msgid "Unable to get your location"
184
  msgstr ""
185
 
186
- #: mappress.php:641
187
  msgid "No results"
188
  msgstr ""
189
 
190
- #: mappress.php:642
191
  msgid "Save changes?"
192
  msgstr ""
193
 
194
- #: mappress.php:643
195
  msgid "Shape"
196
  msgstr ""
197
 
198
- #: mappress.php:669
199
  msgid "Improve this map"
200
  msgstr ""
201
 
202
- #: mappress.php:685
203
  msgid "Streets"
204
  msgstr ""
205
 
206
- #: mappress.php:686
207
  msgid "Outdoors"
208
  msgstr ""
209
 
210
- #: mappress.php:687
211
  msgid "Light"
212
  msgstr ""
213
 
214
- #: mappress.php:688
215
  msgid "Dark"
216
  msgstr ""
217
 
218
- #: mappress.php:689
219
  msgid "Satellite"
220
  msgstr ""
221
 
222
- #: mappress.php:690
223
  msgid "Satellite Streets"
224
  msgstr ""
225
 
@@ -227,236 +219,236 @@ msgstr ""
227
  msgid "Add"
228
  msgstr ""
229
 
230
- #: mappress_map.php:92 mappress_settings.php:301
231
  msgid "MapPress"
232
  msgstr ""
233
 
234
- #: mappress_map.php:182
235
  msgid "Map not found"
236
  msgstr ""
237
 
238
- #: mappress_map.php:440 pro/mappress_pro_settings.php:33
239
  msgid "Filter"
240
  msgstr ""
241
 
242
- #: mappress_map.php:473
243
  msgid "Show map"
244
  msgstr ""
245
 
246
- #: mappress_map.php:477
247
  msgid "Map"
248
  msgstr ""
249
 
250
- #: mappress_map.php:478
251
  msgid "List"
252
  msgstr ""
253
 
254
- #: mappress_settings.php:84
255
  msgid "Sample Map"
256
  msgstr ""
257
 
258
- #: mappress_settings.php:86
259
  msgid "Basic Settings"
260
  msgstr ""
261
 
262
- #: mappress_settings.php:87
263
  msgid "Mapping Engine"
264
  msgstr ""
265
 
266
- #: mappress_settings.php:90
267
  msgid "Mapbox access token"
268
  msgstr ""
269
 
270
- #: mappress_settings.php:92
271
  msgid "Google API key"
272
  msgstr ""
273
 
274
- #: mappress_settings.php:96
275
  msgid "License"
276
  msgstr ""
277
 
278
- #: mappress_settings.php:98
279
  msgid "Map Settings"
280
  msgstr ""
281
 
282
- #: mappress_settings.php:99
283
  msgid "Post types"
284
  msgstr ""
285
 
286
- #: mappress_settings.php:100
287
  msgid "Automatic display"
288
  msgstr ""
289
 
290
- #: mappress_settings.php:101
291
  msgid "Map alignment"
292
  msgstr ""
293
 
294
- #: mappress_settings.php:102 templates/map-popup.php:3
295
  #: templates/mashup-popup.php:6
296
  msgid "Directions"
297
  msgstr ""
298
 
299
- #: mappress_settings.php:104
300
  msgid "POI Settings"
301
  msgstr ""
302
 
303
- #: mappress_settings.php:105
304
  msgid "Default zoom"
305
  msgstr ""
306
 
307
- #: mappress_settings.php:106 mappress_settings.php:245
308
  msgid "Open first POI"
309
  msgstr ""
310
 
311
- #: mappress_settings.php:109
312
  msgid "Mashups"
313
  msgstr ""
314
 
315
- #: mappress_settings.php:110
316
  msgid "Icons"
317
  msgstr ""
318
 
319
- #: mappress_settings.php:111
320
  msgid "Styled Maps"
321
  msgstr ""
322
 
323
- #: mappress_settings.php:112
324
  msgid "Geocoding"
325
  msgstr ""
326
 
327
- #: mappress_settings.php:113
328
  msgid "Templates"
329
  msgstr ""
330
 
331
- #: mappress_settings.php:116
332
  msgid "Localization"
333
  msgstr ""
334
 
335
- #: mappress_settings.php:117
336
  msgid "Language"
337
  msgstr ""
338
 
339
- #: mappress_settings.php:118
340
  msgid "Country"
341
  msgstr ""
342
 
343
- #: mappress_settings.php:119
344
  msgid "Directions server"
345
  msgstr ""
346
 
347
- #: mappress_settings.php:121
348
  msgid "Miscellaneous"
349
  msgstr ""
350
 
351
- #: mappress_settings.php:123
352
  msgid "Compatiblity"
353
  msgstr ""
354
 
355
- #: mappress_settings.php:124
356
  msgid "Scripts"
357
  msgstr ""
358
 
359
- #: mappress_settings.php:125
360
  msgid "Map sizes"
361
  msgstr ""
362
 
363
- #: mappress_settings.php:184
364
  msgid "Center"
365
  msgstr ""
366
 
367
- #: mappress_settings.php:185
368
  msgid "Left"
369
  msgstr ""
370
 
371
- #: mappress_settings.php:186
372
  msgid "Right"
373
  msgstr ""
374
 
375
- #: mappress_settings.php:200
376
  msgid "Top of post"
377
  msgstr ""
378
 
379
- #: mappress_settings.php:201
380
  msgid "Bottom of post"
381
  msgstr ""
382
 
383
- #: mappress_settings.php:202
384
  msgid "None"
385
  msgstr ""
386
 
387
- #: mappress_settings.php:209 mappress_settings.php:250
388
  msgid "(list)"
389
  msgstr ""
390
 
391
- #: mappress_settings.php:211
392
  msgid "Country code for searches"
393
  msgstr ""
394
 
395
- #: mappress_settings.php:215
396
  msgid "Prevent other plugins/themes from loading the Google Maps API"
397
  msgstr ""
398
 
399
- #: mappress_settings.php:219 mappress_settings.php:228
400
  msgid "Google"
401
  msgstr ""
402
 
403
- #: mappress_settings.php:219
404
  msgid "Inline"
405
  msgstr ""
406
 
407
- #: mappress_settings.php:228
408
  msgid "Leaflet"
409
  msgstr ""
410
 
411
- #: mappress_settings.php:230
412
  msgid "Leaflet is free and requires no API key. Google requires an API key and has strict usage limits."
413
  msgstr ""
414
 
415
- #: mappress_settings.php:236 mappress_settings.php:239
416
  msgid "Output scripts in footer"
417
  msgstr ""
418
 
419
- #: mappress_settings.php:237
420
  msgid "Disabled because Jetpack Infinite Scroll is active"
421
  msgstr ""
422
 
423
- #: mappress_settings.php:240
424
  msgid "disable if maps are output using AJAX"
425
  msgstr ""
426
 
427
- #: mappress_settings.php:252
428
  msgid "Language for map controls"
429
  msgstr ""
430
 
431
- #: mappress_settings.php:256
432
  msgid "Enter token to use Mapbox map tiles"
433
  msgstr ""
434
 
435
- #: mappress_settings.php:263
436
  msgid "Default zoom when displaying a single POI"
437
  msgstr ""
438
 
439
- #: mappress_settings.php:276
440
  msgid "Easy Google Maps"
441
  msgstr ""
442
 
443
- #: mappress_settings.php:284
444
  msgid "Width (px or %)"
445
  msgstr ""
446
 
447
- #: mappress_settings.php:284
448
  msgid "Height (px)"
449
  msgstr ""
450
 
451
- #: mappress_settings.php:284
452
  msgid "Default size"
453
  msgstr ""
454
 
455
- #: mappress_settings.php:308
456
  msgid "Save Changes"
457
  msgstr ""
458
 
459
- #: mappress_settings.php:309
460
  msgid "Reset Defaults"
461
  msgstr ""
462
 
@@ -489,7 +481,7 @@ msgid "custom field"
489
  msgstr ""
490
 
491
  #: pro/mappress_filter.php:93 pro/mappress_filter.php:142
492
- #: pro/mappress_pro_settings.php:138
493
  msgid "Post type"
494
  msgstr ""
495
 
@@ -501,7 +493,7 @@ msgstr ""
501
  msgid "Post field"
502
  msgstr ""
503
 
504
- #: pro/mappress_filter.php:129 pro/mappress_pro_settings.php:262
505
  msgid "Custom Field"
506
  msgstr ""
507
 
@@ -629,203 +621,203 @@ msgstr ""
629
  msgid "Force resize"
630
  msgstr ""
631
 
632
- #: pro/mappress_pro_settings.php:125
633
  msgid "more info"
634
  msgstr ""
635
 
636
- #: pro/mappress_pro_settings.php:126
637
  msgid "API key secured by IP address for geocoding (optional)"
638
  msgstr ""
639
 
640
- #: pro/mappress_pro_settings.php:145
641
  msgid "Value"
642
  msgstr ""
643
 
644
- #: pro/mappress_pro_settings.php:145 pro/mappress_pro_settings.php:257
645
  msgid "Icon"
646
  msgstr ""
647
 
648
- #: pro/mappress_pro_settings.php:160
649
  msgid "Enable updates for beta versions"
650
  msgstr ""
651
 
652
- #: pro/mappress_pro_settings.php:173
653
  msgid "Checkboxes"
654
  msgstr ""
655
 
656
- #: pro/mappress_pro_settings.php:173
657
  msgid "Select"
658
  msgstr ""
659
 
660
- #: pro/mappress_pro_settings.php:180
661
  msgid "Key"
662
  msgstr ""
663
 
664
- #: pro/mappress_pro_settings.php:180
665
  msgid "Format"
666
  msgstr ""
667
 
668
- #: pro/mappress_pro_settings.php:195
669
  msgid "Permanently resize existing maps"
670
  msgstr ""
671
 
672
- #: pro/mappress_pro_settings.php:197
673
  msgid "from %s to %s"
674
  msgstr ""
675
 
676
- #: pro/mappress_pro_settings.php:198
677
  msgid "Force Resize"
678
  msgstr ""
679
 
680
- #: pro/mappress_pro_settings.php:211
681
  msgid "Standard"
682
  msgstr ""
683
 
684
- #: pro/mappress_pro_settings.php:212
685
  msgid "InfoBox"
686
  msgstr ""
687
 
688
- #: pro/mappress_pro_settings.php:219
689
  msgid "Below map"
690
  msgstr ""
691
 
692
- #: pro/mappress_pro_settings.php:220
693
  msgid "Left of map"
694
  msgstr ""
695
 
696
- #: pro/mappress_pro_settings.php:226
697
  msgid "Enter license to enable automatic updates"
698
  msgstr ""
699
 
700
- #: pro/mappress_pro_settings.php:236
701
  msgid "Communication error, please try again later"
702
  msgstr ""
703
 
704
- #: pro/mappress_pro_settings.php:238
705
  msgid "Active"
706
  msgstr ""
707
 
708
- #: pro/mappress_pro_settings.php:240
709
  msgid "License is invalid or expired"
710
  msgstr ""
711
 
712
- #: pro/mappress_pro_settings.php:244
713
  msgid "POI title + body"
714
  msgstr ""
715
 
716
- #: pro/mappress_pro_settings.php:244
717
  msgid "Post title + excerpt"
718
  msgstr ""
719
 
720
- #: pro/mappress_pro_settings.php:249
721
  msgid "Open POI"
722
  msgstr ""
723
 
724
- #: pro/mappress_pro_settings.php:249
725
  msgid "Open post"
726
  msgstr ""
727
 
728
- #: pro/mappress_pro_settings.php:249
729
  msgid "Open post in new tab"
730
  msgstr ""
731
 
732
- #: pro/mappress_pro_settings.php:256
733
  msgid "Address line "
734
  msgstr ""
735
 
736
- #: pro/mappress_pro_settings.php:257
737
  msgid "Latitude"
738
  msgstr ""
739
 
740
- #: pro/mappress_pro_settings.php:257
741
  msgid "Longitude"
742
  msgstr ""
743
 
744
- #: pro/mappress_pro_settings.php:257
745
  msgid "Title"
746
  msgstr ""
747
 
748
- #: pro/mappress_pro_settings.php:257
749
  msgid "Body"
750
  msgstr ""
751
 
752
- #: pro/mappress_pro_settings.php:257
753
  msgid "Zoom"
754
  msgstr ""
755
 
756
- #: pro/mappress_pro_settings.php:262
757
  msgid "Map Field"
758
  msgstr ""
759
 
760
- #: pro/mappress_pro_settings.php:275
761
  msgid "Overwrite maps when posts are saved"
762
  msgstr ""
763
 
764
- #: pro/mappress_pro_settings.php:279
765
  msgid "Show a list of POIs with each map"
766
  msgstr ""
767
 
768
- #: pro/mappress_pro_settings.php:283
769
  msgid "Enable search"
770
  msgstr ""
771
 
772
- #: pro/mappress_pro_settings.php:287
773
  msgid "Sort POI list by title"
774
  msgstr ""
775
 
776
- #: pro/mappress_pro_settings.php:293
777
  msgid "No styles have been defined yet"
778
  msgstr ""
779
 
780
- #: pro/mappress_pro_settings.php:302
781
  msgid "Styled Maps Wizard"
782
  msgstr ""
783
 
784
- #: pro/mappress_pro_settings.php:303
785
  msgid "JSON from Google's %s"
786
  msgstr ""
787
 
788
- #: pro/mappress_pro_settings.php:307 pro/mappress_pro_settings.php:323
789
  msgid "Style name"
790
  msgstr ""
791
 
792
- #: pro/mappress_pro_settings.php:319
793
  msgid "Mapbox Studio"
794
  msgstr ""
795
 
796
- #: pro/mappress_pro_settings.php:320
797
  msgid "Enter styles from %s"
798
  msgstr ""
799
 
800
- #: pro/mappress_pro_settings.php:338
801
  msgid "Only admins or multisite super-admins can edit templates"
802
  msgstr ""
803
 
804
- #: pro/mappress_pro_settings.php:343
805
  msgid "WordPress 4.9 or higher is needed to use the template editor."
806
  msgstr ""
807
 
808
- #: pro/mappress_pro_settings.php:349
809
  msgid "Map popup"
810
  msgstr ""
811
 
812
- #: pro/mappress_pro_settings.php:350
813
  msgid "Map list item"
814
  msgstr ""
815
 
816
- #: pro/mappress_pro_settings.php:351
817
  msgid "Mashup popup"
818
  msgstr ""
819
 
820
- #: pro/mappress_pro_settings.php:352
821
  msgid "Mashup list item"
822
  msgstr ""
823
 
824
- #: pro/mappress_pro_settings.php:366
825
  msgid "or "
826
  msgstr ""
827
 
828
- #: pro/mappress_pro_settings.php:374
829
  msgid "Show featured image thumbnails in mashup POIs"
830
  msgstr ""
831
 
2
  # This file is distributed under the same license as the MapPress Maps for WordPress package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MapPress Maps for WordPress 2.50.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
+ "POT-Creation-Date: 2018-08-23 20:47:05+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
62
  msgstr ""
63
 
64
  #: forms/map_media.php:26 forms/map_media.php:62 forms/map_media.php:66
65
+ #: mappress.php:632
66
  msgid "Untitled"
67
  msgstr ""
68
 
103
  msgid "Editor"
104
  msgstr ""
105
 
106
+ #: forms/template_editor.php:28 mappress_settings.php:182
107
  msgid "Default"
108
  msgstr ""
109
 
147
  msgid "MapPress Settings"
148
  msgstr ""
149
 
150
+ #: mappress.php:622
 
 
 
 
 
 
 
 
151
  msgid "Are you sure you want to delete?"
152
  msgstr ""
153
 
154
+ #: mappress.php:623
155
  msgid "Delete this map?"
156
  msgstr ""
157
 
158
+ #: mappress.php:624
159
  msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
160
  msgstr ""
161
 
162
+ #: mappress.php:625
163
  msgid "Error reading KML file"
164
  msgstr ""
165
 
166
+ #: mappress.php:626
167
  msgid "URL for KML file"
168
  msgstr ""
169
 
170
+ #: mappress.php:627
171
  msgid "Loading"
172
  msgstr ""
173
 
174
+ #: mappress.php:628
175
  msgid "Unable to get your location"
176
  msgstr ""
177
 
178
+ #: mappress.php:629
179
  msgid "No results"
180
  msgstr ""
181
 
182
+ #: mappress.php:630
183
  msgid "Save changes?"
184
  msgstr ""
185
 
186
+ #: mappress.php:631
187
  msgid "Shape"
188
  msgstr ""
189
 
190
+ #: mappress.php:656
191
  msgid "Improve this map"
192
  msgstr ""
193
 
194
+ #: mappress.php:672
195
  msgid "Streets"
196
  msgstr ""
197
 
198
+ #: mappress.php:673
199
  msgid "Outdoors"
200
  msgstr ""
201
 
202
+ #: mappress.php:674
203
  msgid "Light"
204
  msgstr ""
205
 
206
+ #: mappress.php:675
207
  msgid "Dark"
208
  msgstr ""
209
 
210
+ #: mappress.php:676
211
  msgid "Satellite"
212
  msgstr ""
213
 
214
+ #: mappress.php:677
215
  msgid "Satellite Streets"
216
  msgstr ""
217
 
219
  msgid "Add"
220
  msgstr ""
221
 
222
+ #: mappress_map.php:92 mappress_settings.php:300
223
  msgid "MapPress"
224
  msgstr ""
225
 
226
+ #: mappress_map.php:183
227
  msgid "Map not found"
228
  msgstr ""
229
 
230
+ #: mappress_map.php:441 pro/mappress_pro_settings.php:33
231
  msgid "Filter"
232
  msgstr ""
233
 
234
+ #: mappress_map.php:474
235
  msgid "Show map"
236
  msgstr ""
237
 
238
+ #: mappress_map.php:478
239
  msgid "Map"
240
  msgstr ""
241
 
242
+ #: mappress_map.php:479
243
  msgid "List"
244
  msgstr ""
245
 
246
+ #: mappress_settings.php:83
247
  msgid "Sample Map"
248
  msgstr ""
249
 
250
+ #: mappress_settings.php:85
251
  msgid "Basic Settings"
252
  msgstr ""
253
 
254
+ #: mappress_settings.php:86
255
  msgid "Mapping Engine"
256
  msgstr ""
257
 
258
+ #: mappress_settings.php:89
259
  msgid "Mapbox access token"
260
  msgstr ""
261
 
262
+ #: mappress_settings.php:91
263
  msgid "Google API key"
264
  msgstr ""
265
 
266
+ #: mappress_settings.php:95
267
  msgid "License"
268
  msgstr ""
269
 
270
+ #: mappress_settings.php:97
271
  msgid "Map Settings"
272
  msgstr ""
273
 
274
+ #: mappress_settings.php:98
275
  msgid "Post types"
276
  msgstr ""
277
 
278
+ #: mappress_settings.php:99
279
  msgid "Automatic display"
280
  msgstr ""
281
 
282
+ #: mappress_settings.php:100
283
  msgid "Map alignment"
284
  msgstr ""
285
 
286
+ #: mappress_settings.php:101 templates/map-popup.php:3
287
  #: templates/mashup-popup.php:6
288
  msgid "Directions"
289
  msgstr ""
290
 
291
+ #: mappress_settings.php:103
292
  msgid "POI Settings"
293
  msgstr ""
294
 
295
+ #: mappress_settings.php:104
296
  msgid "Default zoom"
297
  msgstr ""
298
 
299
+ #: mappress_settings.php:105 mappress_settings.php:244
300
  msgid "Open first POI"
301
  msgstr ""
302
 
303
+ #: mappress_settings.php:108
304
  msgid "Mashups"
305
  msgstr ""
306
 
307
+ #: mappress_settings.php:109
308
  msgid "Icons"
309
  msgstr ""
310
 
311
+ #: mappress_settings.php:110
312
  msgid "Styled Maps"
313
  msgstr ""
314
 
315
+ #: mappress_settings.php:111
316
  msgid "Geocoding"
317
  msgstr ""
318
 
319
+ #: mappress_settings.php:112
320
  msgid "Templates"
321
  msgstr ""
322
 
323
+ #: mappress_settings.php:115
324
  msgid "Localization"
325
  msgstr ""
326
 
327
+ #: mappress_settings.php:116
328
  msgid "Language"
329
  msgstr ""
330
 
331
+ #: mappress_settings.php:117
332
  msgid "Country"
333
  msgstr ""
334
 
335
+ #: mappress_settings.php:118
336
  msgid "Directions server"
337
  msgstr ""
338
 
339
+ #: mappress_settings.php:120
340
  msgid "Miscellaneous"
341
  msgstr ""
342
 
343
+ #: mappress_settings.php:122
344
  msgid "Compatiblity"
345
  msgstr ""
346
 
347
+ #: mappress_settings.php:123
348
  msgid "Scripts"
349
  msgstr ""
350
 
351
+ #: mappress_settings.php:124
352
  msgid "Map sizes"
353
  msgstr ""
354
 
355
+ #: mappress_settings.php:183
356
  msgid "Center"
357
  msgstr ""
358
 
359
+ #: mappress_settings.php:184
360
  msgid "Left"
361
  msgstr ""
362
 
363
+ #: mappress_settings.php:185
364
  msgid "Right"
365
  msgstr ""
366
 
367
+ #: mappress_settings.php:199
368
  msgid "Top of post"
369
  msgstr ""
370
 
371
+ #: mappress_settings.php:200
372
  msgid "Bottom of post"
373
  msgstr ""
374
 
375
+ #: mappress_settings.php:201
376
  msgid "None"
377
  msgstr ""
378
 
379
+ #: mappress_settings.php:208 mappress_settings.php:249
380
  msgid "(list)"
381
  msgstr ""
382
 
383
+ #: mappress_settings.php:210
384
  msgid "Country code for searches"
385
  msgstr ""
386
 
387
+ #: mappress_settings.php:214
388
  msgid "Prevent other plugins/themes from loading the Google Maps API"
389
  msgstr ""
390
 
391
+ #: mappress_settings.php:218 mappress_settings.php:227
392
  msgid "Google"
393
  msgstr ""
394
 
395
+ #: mappress_settings.php:218
396
  msgid "Inline"
397
  msgstr ""
398
 
399
+ #: mappress_settings.php:227
400
  msgid "Leaflet"
401
  msgstr ""
402
 
403
+ #: mappress_settings.php:229
404
  msgid "Leaflet is free and requires no API key. Google requires an API key and has strict usage limits."
405
  msgstr ""
406
 
407
+ #: mappress_settings.php:235 mappress_settings.php:238
408
  msgid "Output scripts in footer"
409
  msgstr ""
410
 
411
+ #: mappress_settings.php:236
412
  msgid "Disabled because Jetpack Infinite Scroll is active"
413
  msgstr ""
414
 
415
+ #: mappress_settings.php:239
416
  msgid "disable if maps are output using AJAX"
417
  msgstr ""
418
 
419
+ #: mappress_settings.php:251
420
  msgid "Language for map controls"
421
  msgstr ""
422
 
423
+ #: mappress_settings.php:255
424
  msgid "Enter token to use Mapbox map tiles"
425
  msgstr ""
426
 
427
+ #: mappress_settings.php:262
428
  msgid "Default zoom when displaying a single POI"
429
  msgstr ""
430
 
431
+ #: mappress_settings.php:275
432
  msgid "Easy Google Maps"
433
  msgstr ""
434
 
435
+ #: mappress_settings.php:283
436
  msgid "Width (px or %)"
437
  msgstr ""
438
 
439
+ #: mappress_settings.php:283
440
  msgid "Height (px)"
441
  msgstr ""
442
 
443
+ #: mappress_settings.php:283
444
  msgid "Default size"
445
  msgstr ""
446
 
447
+ #: mappress_settings.php:307
448
  msgid "Save Changes"
449
  msgstr ""
450
 
451
+ #: mappress_settings.php:308
452
  msgid "Reset Defaults"
453
  msgstr ""
454
 
481
  msgstr ""
482
 
483
  #: pro/mappress_filter.php:93 pro/mappress_filter.php:142
484
+ #: pro/mappress_pro_settings.php:139
485
  msgid "Post type"
486
  msgstr ""
487
 
493
  msgid "Post field"
494
  msgstr ""
495
 
496
+ #: pro/mappress_filter.php:129 pro/mappress_pro_settings.php:263
497
  msgid "Custom Field"
498
  msgstr ""
499
 
621
  msgid "Force resize"
622
  msgstr ""
623
 
624
+ #: pro/mappress_pro_settings.php:126
625
  msgid "more info"
626
  msgstr ""
627
 
628
+ #: pro/mappress_pro_settings.php:127
629
  msgid "API key secured by IP address for geocoding (optional)"
630
  msgstr ""
631
 
632
+ #: pro/mappress_pro_settings.php:146
633
  msgid "Value"
634
  msgstr ""
635
 
636
+ #: pro/mappress_pro_settings.php:146 pro/mappress_pro_settings.php:258
637
  msgid "Icon"
638
  msgstr ""
639
 
640
+ #: pro/mappress_pro_settings.php:161
641
  msgid "Enable updates for beta versions"
642
  msgstr ""
643
 
644
+ #: pro/mappress_pro_settings.php:174
645
  msgid "Checkboxes"
646
  msgstr ""
647
 
648
+ #: pro/mappress_pro_settings.php:174
649
  msgid "Select"
650
  msgstr ""
651
 
652
+ #: pro/mappress_pro_settings.php:181
653
  msgid "Key"
654
  msgstr ""
655
 
656
+ #: pro/mappress_pro_settings.php:181
657
  msgid "Format"
658
  msgstr ""
659
 
660
+ #: pro/mappress_pro_settings.php:196
661
  msgid "Permanently resize existing maps"
662
  msgstr ""
663
 
664
+ #: pro/mappress_pro_settings.php:198
665
  msgid "from %s to %s"
666
  msgstr ""
667
 
668
+ #: pro/mappress_pro_settings.php:199
669
  msgid "Force Resize"
670
  msgstr ""
671
 
672
+ #: pro/mappress_pro_settings.php:212
673
  msgid "Standard"
674
  msgstr ""
675
 
676
+ #: pro/mappress_pro_settings.php:213
677
  msgid "InfoBox"
678
  msgstr ""
679
 
680
+ #: pro/mappress_pro_settings.php:220
681
  msgid "Below map"
682
  msgstr ""
683
 
684
+ #: pro/mappress_pro_settings.php:221
685
  msgid "Left of map"
686
  msgstr ""
687
 
688
+ #: pro/mappress_pro_settings.php:227
689
  msgid "Enter license to enable automatic updates"
690
  msgstr ""
691
 
692
+ #: pro/mappress_pro_settings.php:237
693
  msgid "Communication error, please try again later"
694
  msgstr ""
695
 
696
+ #: pro/mappress_pro_settings.php:239
697
  msgid "Active"
698
  msgstr ""
699
 
700
+ #: pro/mappress_pro_settings.php:241
701
  msgid "License is invalid or expired"
702
  msgstr ""
703
 
704
+ #: pro/mappress_pro_settings.php:245
705
  msgid "POI title + body"
706
  msgstr ""
707
 
708
+ #: pro/mappress_pro_settings.php:245
709
  msgid "Post title + excerpt"
710
  msgstr ""
711
 
712
+ #: pro/mappress_pro_settings.php:250
713
  msgid "Open POI"
714
  msgstr ""
715
 
716
+ #: pro/mappress_pro_settings.php:250
717
  msgid "Open post"
718
  msgstr ""
719
 
720
+ #: pro/mappress_pro_settings.php:250
721
  msgid "Open post in new tab"
722
  msgstr ""
723
 
724
+ #: pro/mappress_pro_settings.php:257
725
  msgid "Address line "
726
  msgstr ""
727
 
728
+ #: pro/mappress_pro_settings.php:258
729
  msgid "Latitude"
730
  msgstr ""
731
 
732
+ #: pro/mappress_pro_settings.php:258
733
  msgid "Longitude"
734
  msgstr ""
735
 
736
+ #: pro/mappress_pro_settings.php:258
737
  msgid "Title"
738
  msgstr ""
739
 
740
+ #: pro/mappress_pro_settings.php:258
741
  msgid "Body"
742
  msgstr ""
743
 
744
+ #: pro/mappress_pro_settings.php:258
745
  msgid "Zoom"
746
  msgstr ""
747
 
748
+ #: pro/mappress_pro_settings.php:263
749
  msgid "Map Field"
750
  msgstr ""
751
 
752
+ #: pro/mappress_pro_settings.php:276
753
  msgid "Overwrite maps when posts are saved"
754
  msgstr ""
755
 
756
+ #: pro/mappress_pro_settings.php:280
757
  msgid "Show a list of POIs with each map"
758
  msgstr ""
759
 
760
+ #: pro/mappress_pro_settings.php:284
761
  msgid "Enable search"
762
  msgstr ""
763
 
764
+ #: pro/mappress_pro_settings.php:288
765
  msgid "Sort POI list by title"
766
  msgstr ""
767
 
768
+ #: pro/mappress_pro_settings.php:294
769
  msgid "No styles have been defined yet"
770
  msgstr ""
771
 
772
+ #: pro/mappress_pro_settings.php:303
773
  msgid "Styled Maps Wizard"
774
  msgstr ""
775
 
776
+ #: pro/mappress_pro_settings.php:304
777
  msgid "JSON from Google's %s"
778
  msgstr ""
779
 
780
+ #: pro/mappress_pro_settings.php:308 pro/mappress_pro_settings.php:324
781
  msgid "Style name"
782
  msgstr ""
783
 
784
+ #: pro/mappress_pro_settings.php:320
785
  msgid "Mapbox Studio"
786
  msgstr ""
787
 
788
+ #: pro/mappress_pro_settings.php:321
789
  msgid "Enter styles from %s"
790
  msgstr ""
791
 
792
+ #: pro/mappress_pro_settings.php:339
793
  msgid "Only admins or multisite super-admins can edit templates"
794
  msgstr ""
795
 
796
+ #: pro/mappress_pro_settings.php:344
797
  msgid "WordPress 4.9 or higher is needed to use the template editor."
798
  msgstr ""
799
 
800
+ #: pro/mappress_pro_settings.php:350
801
  msgid "Map popup"
802
  msgstr ""
803
 
804
+ #: pro/mappress_pro_settings.php:351
805
  msgid "Map list item"
806
  msgstr ""
807
 
808
+ #: pro/mappress_pro_settings.php:352
809
  msgid "Mashup popup"
810
  msgstr ""
811
 
812
+ #: pro/mappress_pro_settings.php:353
813
  msgid "Mashup list item"
814
  msgstr ""
815
 
816
+ #: pro/mappress_pro_settings.php:367
817
  msgid "or "
818
  msgstr ""
819
 
820
+ #: pro/mappress_pro_settings.php:375
821
  msgid "Show featured image thumbnails in mashup POIs"
822
  msgstr ""
823
 
languages/texts.php CHANGED
@@ -32,8 +32,6 @@ __("WARNING: MapPress is not compatible with the WP-Geo plugin. Please deactiva
32
  __("A Google Maps API key is required");
33
  __("Please update your");
34
  __("MapPress Settings");
35
- __("here");
36
- __("MapPress %s uses new templates. Please update your custom templates %s");
37
  __("Are you sure you want to delete?");
38
  __("Delete this map?");
39
  __("Google cannot return directions between those addresses. There is no route between them or the routing information is not available.");
32
  __("A Google Maps API key is required");
33
  __("Please update your");
34
  __("MapPress Settings");
 
 
35
  __("Are you sure you want to delete?");
36
  __("Delete this map?");
37
  __("Google cannot return directions between those addresses. There is no route between them or the routing information is not available.");
mappress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Maps for WordPress
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
- Version: 2.50.2
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/)
@@ -35,7 +35,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
35
  }
36
 
37
  class Mappress {
38
- const VERSION = '2.50.2';
39
 
40
  static
41
  $baseurl,
@@ -463,19 +463,7 @@ class Mappress {
463
  if (self::$options->engine != 'leaflet' && !self::get_api_keys()->browser)
464
  printf($error, sprintf("%s. %s <a href='%s'>%s</a>.", __("A Google Maps API key is required", 'mappress-google-maps-for-wordpress'), __("Please update your", 'mappress-google-maps-for-wordpress'), admin_url('admin.php?page=mappress'), __('MapPress Settings', 'mappress-google-maps-for-wordpress')));
465
 
466
- // Dismissible notices
467
- if (version_compare(self::VERSION, '2.49', '=')) {
468
- $found = false;
469
- foreach(array('map-list', 'map-poi') as $name) {
470
- if (locate_template($name . '.php', false))
471
- $found = true;
472
- }
473
- if ($found) {
474
- $settings_link = sprintf("<a href='%s'>%s</a>", admin_url("admin.php?page=mappress"), __('here', 'mappress-google-maps-for-wordpress'));
475
- $notices['tpl'] = sprintf(__('MapPress %s uses new templates. Please update your custom templates %s', 'mappress-google-maps-for-wordpress'), self::VERSION, $settings_link);
476
- }
477
- }
478
-
479
  if (is_super_admin()) {
480
  $dismissed = get_user_meta(get_current_user_id(), 'mappress-notices', true);
481
  $dismissed = (is_array($dismissed)) ? $dismissed : array();
@@ -648,11 +636,10 @@ class Mappress {
648
  $l10n['options'] = array(
649
  'admin' => current_user_can('administrator'),
650
  'ajaxurl' => admin_url('admin-ajax.php'),
651
- 'apiKey' => (self::get_api_keys()->browser) ? true : false,
652
  'debug' => Mappress::$debug,
653
  'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
654
  'language' => self::get_language(),
655
- 'mapbox' => self::$options->mapbox,
656
  'mini' => 350,
657
  'postid' => ($post) ? $post->ID : null,
658
  'pro' => self::$pro,
@@ -665,7 +652,7 @@ class Mappress {
665
  // Providers
666
  $providers = array(
667
  'mapbox' => array(
668
- 'accessToken' => self::$options->mapbox,
669
  'attribution' => "<a href='https://www.mapbox.com/about/maps/' target='_blank'>&copy; Mapbox &copy; OpenStreetMap</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>" . __('Improve this map', 'mappress-google-maps-for-wordpress') . "</a>",
670
  'fresh' => true, // Fresh = true in order to provide updated studio styles
671
  'url' => "https://api.mapbox.com/styles/v1/{user}/{id}/tiles/256/{z}/{x}/{y}?access_token={accessToken}&fresh={fresh}",
@@ -680,7 +667,7 @@ class Mappress {
680
 
681
  // Baselayers
682
  $baselayers = array();
683
- if (self::$options->mapbox) {
684
  $baselayers = array(
685
  array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'streets-v10', 'name' => 'streets', 'label' => __('Streets', 'mappress-google-maps-for-wordpress')),
686
  array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'outdoors-v10', 'name' => 'outdoors', 'label' => __('Outdoors', 'mappress-google-maps-for-wordpress')),
@@ -713,7 +700,7 @@ class Mappress {
713
  }
714
 
715
  // Global settings
716
- $options = array('autoupdate', 'country', 'defaultIcon', 'directions', 'directionsServer', 'engine', 'iconScale', 'iwType', 'mashupBody', 'mashupClick', 'poiZoom', 'radius', 'search', 'size', 'sizes', 'style', 'styles', 'tiles');
717
  foreach($options as $option)
718
  $l10n['options'][$option] = self::$options->$option;
719
 
@@ -751,11 +738,13 @@ class Mappress {
751
  }
752
 
753
  static function get_api_keys() {
754
- $results = (object) array('browser' => self::$options->apiKey, 'server' => self::$options->apiKeyServer);
755
  if (empty($results->browser) && defined('MAPPRESS_APIKEY'))
756
  $results->browser = MAPPRESS_APIKEY;
757
  if (empty($results->server) && defined('MAPPRESS_APIKEY_SERVER'))
758
  $results->server = MAPPRESS_APIKEY_SERVER;
 
 
759
  return $results;
760
  }
761
 
4
  Plugin URI: https://www.mappresspro.com/mappress
5
  Author URI: https://www.mappresspro.com/chris-contact
6
  Description: MapPress makes it easy to add Google and Leaflet Maps to WordPress
7
+ Version: 2.50.5
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/)
35
  }
36
 
37
  class Mappress {
38
+ const VERSION = '2.50.5';
39
 
40
  static
41
  $baseurl,
463
  if (self::$options->engine != 'leaflet' && !self::get_api_keys()->browser)
464
  printf($error, sprintf("%s. %s <a href='%s'>%s</a>.", __("A Google Maps API key is required", 'mappress-google-maps-for-wordpress'), __("Please update your", 'mappress-google-maps-for-wordpress'), admin_url('admin.php?page=mappress'), __('MapPress Settings', 'mappress-google-maps-for-wordpress')));
465
 
466
+ // Print notices
 
 
 
 
 
 
 
 
 
 
 
 
467
  if (is_super_admin()) {
468
  $dismissed = get_user_meta(get_current_user_id(), 'mappress-notices', true);
469
  $dismissed = (is_array($dismissed)) ? $dismissed : array();
636
  $l10n['options'] = array(
637
  'admin' => current_user_can('administrator'),
638
  'ajaxurl' => admin_url('admin-ajax.php'),
 
639
  'debug' => Mappress::$debug,
640
  'iconsUrl' => (self::$pro) ? Mappress_Icons::$icons_url : null,
641
  'language' => self::get_language(),
642
+ 'mapbox' => self::get_api_keys()->mapbox,
643
  'mini' => 350,
644
  'postid' => ($post) ? $post->ID : null,
645
  'pro' => self::$pro,
652
  // Providers
653
  $providers = array(
654
  'mapbox' => array(
655
+ 'accessToken' => self::get_api_keys()->mapbox,
656
  'attribution' => "<a href='https://www.mapbox.com/about/maps/' target='_blank'>&copy; Mapbox &copy; OpenStreetMap</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>" . __('Improve this map', 'mappress-google-maps-for-wordpress') . "</a>",
657
  'fresh' => true, // Fresh = true in order to provide updated studio styles
658
  'url' => "https://api.mapbox.com/styles/v1/{user}/{id}/tiles/256/{z}/{x}/{y}?access_token={accessToken}&fresh={fresh}",
667
 
668
  // Baselayers
669
  $baselayers = array();
670
+ if (self::get_api_keys()->mapbox) {
671
  $baselayers = array(
672
  array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'streets-v10', 'name' => 'streets', 'label' => __('Streets', 'mappress-google-maps-for-wordpress')),
673
  array('provider' => 'mapbox', 'user' => 'mapbox', 'id' => 'outdoors-v10', 'name' => 'outdoors', 'label' => __('Outdoors', 'mappress-google-maps-for-wordpress')),
700
  }
701
 
702
  // Global settings
703
+ $options = array('autoupdate', 'country', 'defaultIcon', 'directions', 'directionsServer', 'engine', 'iconScale', 'iwType', 'mashupBody', 'mashupClick', 'poiZoom', 'radius', 'search', 'size', 'sizes', 'style', 'tiles');
704
  foreach($options as $option)
705
  $l10n['options'][$option] = self::$options->$option;
706
 
738
  }
739
 
740
  static function get_api_keys() {
741
+ $results = (object) array('browser' => self::$options->apiKey, 'server' => self::$options->apiKeyServer, 'mapbox' => self::$options->mapbox);
742
  if (empty($results->browser) && defined('MAPPRESS_APIKEY'))
743
  $results->browser = MAPPRESS_APIKEY;
744
  if (empty($results->server) && defined('MAPPRESS_APIKEY_SERVER'))
745
  $results->server = MAPPRESS_APIKEY_SERVER;
746
+ if (empty($results->mapbox) && defined('MAPPRESS_APIKEY_MAPBOX'))
747
+ $result->mapbox = MAPPRESS_APIKEY_MAPBOX;
748
  return $results;
749
  }
750
 
mappress_map.php CHANGED
@@ -119,7 +119,8 @@ class Mappress_Map extends Mappress_Obj {
119
 
120
  $where = ($where) ? " WHERE " . implode(' AND ', $where) : '';
121
 
122
- $limit = sprintf(" LIMIT %d, %d", ($args->page - 1) * $args->page_size, $args->page_size);
 
123
  $sql = "SELECT SQL_CALC_FOUND_ROWS $posts_table.mapid FROM $posts_table INNER JOIN $wpdb->posts ON ($wpdb->posts.ID = $posts_table.postid) $where $limit";
124
 
125
  $results = $wpdb->get_results($sql);
119
 
120
  $where = ($where) ? " WHERE " . implode(' AND ', $where) : '';
121
 
122
+ //$limit = sprintf(" LIMIT %d, %d", ($args->page - 1) * $args->page_size, $args->page_size);
123
+ $limit = '';
124
  $sql = "SELECT SQL_CALC_FOUND_ROWS $posts_table.mapid FROM $posts_table INNER JOIN $wpdb->posts ON ($wpdb->posts.ID = $posts_table.postid) $where $limit";
125
 
126
  $results = $wpdb->get_results($sql);
mappress_settings.php CHANGED
@@ -8,7 +8,6 @@ class Mappress_Options extends Mappress_Obj {
8
  $autoupdate,
9
  $apiKey,
10
  $apiKeyServer,
11
- $apiToken,
12
  $autodisplay = 'top',
13
  $betas,
14
  $country,
8
  $autoupdate,
9
  $apiKey,
10
  $apiKeyServer,
 
11
  $autodisplay = 'top',
12
  $betas,
13
  $country,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: leaflet, openstreetmap, osm, mapbox, map box, 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: 4.5
6
  Tested up to: 4.9
7
- Stable tag: 2.50.2
8
 
9
  == Description ==
10
  MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
@@ -86,6 +86,17 @@ Please see the plugin documentation pages:
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
 
 
 
89
  = 2.50.2 =
90
  * Added: easy entry of Mapbox Studio style names in the MapPress settings screen
91
  * Fixed: custom styles are now retained when switching engines
@@ -329,203 +340,4 @@ Please see the plugin documentation pages:
329
  * Removed: settings 'template', 'templatedirections', 'templatepoi', 'templatepoilist'
330
  * Removed: settings 'bicycling', 'traffic', 'transit', 'initialBicycling', 'initialTraffic', 'initialTransit'
331
  * Removed: 'bigger map' and POI 'zoom' functions
332
- * Removed: the 'mapLinks' setting is removed (these functions have been replaced by the new map menu)
333
-
334
-
335
- = 2.44.5 =
336
- * Changed: improved updater
337
-
338
- = 2.44.4 =
339
- * Changed: updates for PHP 7
340
-
341
- = 2.44.3 =
342
- * Changed: plugin repository URL updated
343
-
344
- = 2.44.2 =
345
- * Changed: geocoding module has been updated
346
- * Changed: the Nominatim geocoder has been removed
347
- * Changed: when geocoding an 'address' field in format 'lat,lng' the field is used verbatim rather than mapped to the nearest street address
348
- * Changed: extract removed from helper functions
349
-
350
- = 2.44.1 =
351
- * Changed: added 'footer' option for loading scripts in header/footer (for use in AJAX plugins)
352
- * Changed: added underscore library to loader
353
- * Fixed: default sort applied to mashup with orderby
354
- * Fixed: updated widget to use array field names (since WP 4.4)
355
-
356
- = 2.44 =
357
- * Changed: version updated to 2.44
358
-
359
- = 2.43.10 =
360
- * Changed: show blank container while loading mashups instead of default map
361
- * Changed: no alerts for admins on missing map container
362
- * Changed: apply wpautop to POIs when they are saved (wpautop inserts html tags to format carriage returns)
363
- * Fixed: bug where mashups were limited to 10 POIs
364
- * Fixed: polygons are allowed again in mashup results
365
- * Fixed: changed Mappress_Updater constructor for PHP 7
366
-
367
- = 2.43.9 =
368
- * Added: support for XHTML sites (must be running WP 4.5 or higher)
369
- * Added: server API key for geocoding
370
- * Fixed: debugging functions
371
- * Fixed: removed extra code for api key in geocoder
372
- * Fixed: removed anonymous functions to support hosts still running PHP 5.2
373
-
374
- = 2.43.8 =
375
- * Added: API key checks updated to support Google policy change on 6/22/2016
376
- * Added: automatic icons can now be set by post type as well as by taxonomy
377
- * Changed: KML/KMZ overlays and polygons are no longer included in mashup results
378
- * Changed: map can now display in AJAX calls from other plugins (infinite scrollers, etc.)
379
- * Changed: new map loader for compatibility with plugins/themes that cause jQuery .ready errors
380
- * Changed: text domain changed for compatibility with WordPress language packs
381
- * Changed: support for translate.wordpress.org - language (.mo/.po) files renamed with new plugin slug for language packs
382
- * Changed: datatables support has been removed
383
- * Changed: widget now uses WP 4.3 constructor / anonymous function
384
- * Fixed: a Google API change broke 'my location' in directions and map editor
385
-
386
- = 2.43.7 =
387
- * Fixed: mashups ignoring mashupTitle="poi" and always showing post title (since 2.43.4)
388
-
389
- = 2.43.6 =
390
- * Added: language support for mashup queries
391
- * Fixed: mashups with query="all" or "current" returned no results from 2.43.2
392
- * Fixed: AJAX error when adding autoicons
393
- * Fixed: thumbnail size is output as a style for better infobox sizing
394
-
395
- = 2.43.5 =
396
- * Changed: restored 'adaptive' setting
397
-
398
- = 2.43.4 =
399
- * Added: check for jQuery version
400
- * Changed: to support new geocoding API: removed 'sensor' parameter from geocoding calls, added api key and switched to https
401
- * Changed: restored filter 'mappress_poi_html'
402
- * Changed: removed filters 'mappress_poi_body', 'mappress_poi_links', and 'mappress_poi_links_html'
403
- * Fixed: workaround for WP bug #33393 (deletes text in POI editor when switching visual/html tab)
404
- * Fixed: workaround for hidden tabs calling wrong method to display map
405
- * Fixed: addresses with foreign characters (like umlaut) were incorrect when geocoding custom fields due to double utf8-encoding
406
- * Fixed: when using WPML, mashups with mashupClick="post" were always redirecting to post in base language
407
-
408
- = 2.43.3 =
409
- * Fixed: unable to save POIs in editor
410
- * Fixed: directions not working because Google changed URL structure
411
-
412
- = 2.43.2 =
413
- * Fixed: public variables caused query errors with null queries
414
-
415
- = 2.43.1 =
416
- * Added: wp_query public variables can be included in queries, for example [mashup query="cat=@cat"] to show posts in the current category
417
- * Fixed: drawing manager not showing up in editor
418
-
419
- = 2.43 =
420
- * Added: setting for automatic icons in mashups. Note: filter 'mappress_poi_iconid' will be deprecated, please use the settings instead.
421
- * Added: setting 'icon scaling'. Enter dimensions to scale regular icons, or for scaling high-DPI/retina display icons
422
- * Added: setting 'load scripts in footer'. Uncheck this to show maps in AJAX calls, lightboxes, or infinite scrollers
423
- * Changed: POI z-indexes are now set in reverse order so first POI has top index
424
- * Changed: KML POIs are now suppressed in the poi list by default
425
- * Changed: if initialOpenDirections="true" and no from/to address is provided, the first POI will be used as the "to" address
426
- * Changed: initialOpenInfo="true" is now allowed for the widget
427
- * Changed: new AJAX icon picker
428
- * Changed: new polygon color picker with expanded palette
429
- * Changed: polygon POIs can now be dragged
430
- * Changed: added UTF8 encoding to geocoding requests for special characters
431
- * Fixed: iOS "too many redirects" for directions after Google parameter change
432
- * Fixed: directions 'print' parameters fixed
433
- * Fixed: 'print' button removed on mobile devices where Google does not support print mode
434
- * Fixed: map editor action links not clickable on iPad
435
- * Fixed: don't auto-display maps on password-protected posts
436
- * Fixed: url for Google 'print' directions updated to new value
437
- * Fixed: url incorrect when redirecting to post from POI title
438
- * Fixed: 2015 theme interferes with POI list table layout
439
- * Fixed: incorrect display when editing tables on settings screen
440
- * Removed: icon shadows (shadows are no longer supported by Google)
441
- * Removed: JSON library (all browsers should support it natively)
442
- * Removed: filters: mappress_poi_html, mappress_user_icons
443
- * Removed: iwfix setting (Google has finally fixed API bug 5713 involving infoWindow scrollbars)
444
- * Removed: 'adaptive' setting
445
- * Removed: 'disableAutoPan' setting
446
- * Removed: border setting (add CSS styles to class 'mapp-layout' instead)
447
- * Removed: CDATA in post content
448
-
449
- = 2.42.1 =
450
- * Changed: wider editor infobox for Chrome and WP 3.9
451
- * Fixed: removed warning about border style
452
- * Fixed: removed !important modifier from mapp-iw styles for font weight
453
-
454
- = 2.42 =
455
- * Added: compatibiliy for TinyMCE 4.x in WordPress 3.9+
456
- * Changed: geocoding calls from PHP now use http instead of https to prevent curl errors
457
- * Changed: updated Spanish translation, thanks to Agustin
458
- * Fixed: tinyMCE icons in WordPress 3.8+
459
-
460
- = 2.41.1 =
461
- * Added: polyline and polygon vertices can now be deleted by right-clicking
462
- * Fixed: Mappress_Map::delete is now declared static to prevent warning messages
463
-
464
- = 2.41 =
465
- * Fixed: warning message in save_post action if WordPress is in debug mode and no post ID is provided
466
-
467
- = 2.40.9 =
468
- * Changed: infowindow scrollbar fix is updated and can now be turned off in settings
469
- * Changed: removed $poi->get_post() method
470
- * Changed: CSS for infowindow (.mapp-iw)
471
- * Fixed: use default height for mashups with width but no height
472
-
473
- = 2.40.8 =
474
- * Added: workaround for Google infoWindow sizing bug
475
- * Added: shortcode parameters 'from' and 'to' can be used to set a default for all directions. Use a string or POI number, for example [mappress from="2"] or [mappress from="Mountain View, CA"]
476
- * Fixed: layout style was incorrect if map layout had rounded corners; this also prevented show="hidden" from working.
477
- * Fixed: filter 'mappress_poi_iconid' was being called as 'mapress_poi_iconid' (with one 'p' instead of two)
478
- * Fixed: Google CSS made copyright appear vertical in IE in some themes
479
- * Fixed: Google bug with sizing infoWindows
480
- * Changed: updated Italian translation, thanks to Reberto
481
- * Changed: when dragging a marker originally entered by address, it will keep the address for directions instead of showing the lat/lng coordinates.
482
- * Changed: no check for an active post for the mashup shortcode, to allow mashups on search results pages
483
- * Changed: directions now appear -above- the poi list in the standard template 'layout.php'
484
- * Changed: if option mashupClick="post", the plugin redirects using 'siteurl/?p=1234' instead of the permalink (which speeds up queries)
485
- * Changed: initialopendirections is now a boolean: set it to 'true' or 'false'.
486
-
487
- = 2.40.7 =
488
- * Fixed: workaround for new output buffering issue in latest NextGen 2.0.11
489
-
490
- = 2.40.6 =
491
- * Fixed: warning message on settings screen
492
- * Changed: custom map sizes are now available in all versions of the plugin
493
-
494
- = 2.40.5 =
495
- * Fixed: directions not working after Nextgen workaround
496
-
497
- = 2.40.4 =
498
- * Added: the POI editor now includes the 'paste' tinyMCE plugin to allow pasting from Microsoft Word
499
- * Changed: if you have set the option to link POIs to posts, featured images will also link to the underlying post
500
- * Changed: map sizes (on the settings screen) can be set to % sizes as well as pixels. NOTE: existing sizes are reset, so re-enter them on the 'settings' screen if needed.
501
- * Changed: a default size can now be selected and maps without a specific size will default to that size
502
- * Changed: 'language' setting is now set dynamically
503
- * Changed: up to 6 address lines are now supported
504
- * Fixed: workaround for NextGen plugin bug: reverses order of wp_enqueue_script / wp_print_footer scripts.
505
- * Fixed: tabs activation using new jQuery version in WordPress 3.6
506
- * Fixed: workaround for NextGen plugin bug: admin_enqueue_scripts called without a hook name
507
- * Fixed: some mobile devices did not show the map 'close' buttons correctly (mobile browser could not render 'max-width: auto', 'max-width: 99999px' used instead)
508
- * Fixed: shadows were not appearing for custom icons
509
- * Fixed: added missing localization for 'loading' and 'directions from' message strings
510
- * Fixed: notice message for a static function called non-statically
511
- * Fixed: map are now generated from metadata only if the post type is enabled for maps on the settings screen
512
- * Fixed: update of maps from queued metadata was not working when multiple posts were queued at once
513
-
514
- = 2.40.3 =
515
- * Fixed: widget CSS settings
516
- * Fixed: added missing blue iim2 shadow icon
517
-
518
- = 2.40.2 =
519
- * Fixed: PHP notice in widget
520
- * Fixed: added updated Hungarian translation (thanks to Zsolt A.)
521
-
522
- = 2.40.1 =
523
- * Fixed: % width and % height were not working in the editor since 2.40
524
- * Fixed: PHP notice when upgrade available
525
- * Fixed: removed internal errors from language files
526
-
527
- = 2.40 =
528
- * Added: an 'insert into post' link is now available in the map list as well as the map editor
529
- * Changed: fields in the map editor have been rearranged for clarity
530
- * Changed: the 'letter' icons have been removed from the icon picker. If you need to continue using them, contact me for support.
531
- * Fixed: the icon picker now loads much faster as a single image
4
  Tags: leaflet, openstreetmap, osm, mapbox, map box, 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: 4.5
6
  Tested up to: 4.9
7
+ Stable tag: 2.50.5
8
 
9
  == Description ==
10
  MapPress adds beautiful, interactive Google or Leaflet maps to WordPress.
86
 
87
  == Changelog ==
88
 
89
+ = 2.50.5 =
90
+ * Fixed: 2nd style bug preventing map display
91
+
92
+ = 2.50.4 =
93
+ * Fixed: bug in styles could prevent map from displaying
94
+
95
+ = 2.50.3 =
96
+ * Added: Mapbox token can be set in wp-config.php for multisite with: define('MAPPRESS_APIKEY_MAPBOX')
97
+ * Fixed: editor now shows ALL results when searching for maps
98
+ * Fixed: Google styles were not being applied
99
+
100
  = 2.50.2 =
101
  * Added: easy entry of Mapbox Studio style names in the MapPress settings screen
102
  * Fixed: custom styles are now retained when switching engines
340
  * Removed: settings 'template', 'templatedirections', 'templatepoi', 'templatepoilist'
341
  * Removed: settings 'bicycling', 'traffic', 'transit', 'initialBicycling', 'initialTraffic', 'initialTransit'
342
  * Removed: 'bigger map' and POI 'zoom' functions
343
+ * Removed: the 'mapLinks' setting is removed (these functions have been replaced by the new map menu)