MapPress Easy Google Maps - Version 2.47

Version Description

  • Added: filter dropdown now includes icons from the 'automatic icons' setting (for use as a map legend)
  • Fixed: editor spawner multiple icon color pickers, so popups were sometimes in the wrong position
  • Changed: 'directions' and 'mashupClick' (POI click behavior for mashups) are now global, set them from the settings screen instead of the shortcode
  • Changed: templates 'map.php' and 'map-list.php' were updated, please update any custom templates
  • Changed: list CSS class 'mapp-pois'/'mapp-poi' were changed to 'mapp-items'/'mapp-item'
Download this release

Release Info

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

Code changes from version 2.46.9 to 2.47

css/mappress.css CHANGED
@@ -71,7 +71,7 @@
71
  background-color: white;
72
  border: 1px solid gray;
73
  border-radius: 5px;
74
- display:none;
75
  left: 50%;
76
  padding: 10px 10px 10px 0px;
77
  position: absolute;
@@ -80,16 +80,70 @@
80
  z-index: 1;
81
  }
82
 
 
 
 
 
83
  /*
84
  -----------------------------------------------------------------------------------
85
  Header
86
  -----------------------------------------------------------------------------------
87
  */
88
  .mapp-header {
 
89
  border-bottom: 1px solid lightgray;
90
- height: 29px;
91
  overflow: hidden;
92
- padding: 5px 10px 5px 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  }
94
 
95
  /*
@@ -247,19 +301,18 @@
247
  POI List (new)
248
  Structure:
249
  .mapp-list
250
- .mapp-pois
251
- .mapp-poi (one for each POI)
252
  -----------------------------------------------------------------------------------
253
  */
254
 
255
  .mapp-list {
256
  background-color: white;
257
- overflow: auto;
258
  position: relative; /* Needed to scroll list for selection */
259
  z-index: 1;
260
  }
261
 
262
- .mapp-inline .mapp-list {
263
  border-top: 1px solid lightgray;
264
  max-height: 300px;
265
  }
@@ -272,29 +325,72 @@
272
  width: 35%;
273
  }
274
 
275
- .mapp-pois .mapp-poi {
 
 
 
 
 
276
  border-bottom: 1px solid lightgray;
 
277
  overflow: hidden;
278
  padding: 5px;
279
  }
280
 
281
- .mapp-poi:hover, .mapp-poi.mapp-selected {
282
  background-color: #fafafa;
283
  }
284
 
285
 
286
- .mapp-poi .mapp-title {
287
  overflow: hidden;
288
  vertical-align: middle;
289
  }
290
 
291
- .mapp-poi .mapp-icon {
292
  float: left;
293
  margin-right: 5px;
294
  max-width: 24px !important; /* 2012 tries to override */
295
  max-height: 24px;
296
  }
297
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  /*
299
  -----------------------------------------------------------------------------------
300
  Directions
@@ -441,10 +537,13 @@
441
  */
442
  .mapp-table {
443
  display: table;
 
444
  }
445
 
446
  .mapp-table > div { display: table-row; }
447
- .mapp-table > div > div, .mapp-table > div > label { display: table-cell; }
 
 
448
 
449
  /*
450
  -----------------------------------------------------------------------------------
@@ -499,12 +598,11 @@ img.mapp-icon {
499
  }
500
 
501
  .mapp-spinner {
502
- display: inline-block;
503
  height:16px;
504
  width: 16px;
505
  margin-left: 10px;
506
  margin-right: 10px;
507
- background: transparent url(../images/loading.gif) no-repeat center center;
508
  }
509
 
510
  *[data-mapp-action] {
71
  background-color: white;
72
  border: 1px solid gray;
73
  border-radius: 5px;
74
+ display: none;
75
  left: 50%;
76
  padding: 10px 10px 10px 0px;
77
  position: absolute;
80
  z-index: 1;
81
  }
82
 
83
+ .mapp-dialog .mapp-spinner {
84
+ display: inline-block;
85
+ }
86
+
87
  /*
88
  -----------------------------------------------------------------------------------
89
  Header
90
  -----------------------------------------------------------------------------------
91
  */
92
  .mapp-header {
93
+ background-color: #eee;
94
  border-bottom: 1px solid lightgray;
95
+ height: 40px;
96
  overflow: hidden;
97
+ }
98
+
99
+
100
+ .mapp-header .mapp-filters-toggle {
101
+ line-height: 34px;
102
+ margin-left: 5px;
103
+ padding-left: 10px;
104
+ }
105
+
106
+ .mapp-search-wrapper {
107
+ max-width: 450px;
108
+ padding: 2px;
109
+ }
110
+ /*
111
+ -----------------------------------------------------------------------------------
112
+ Search
113
+ -----------------------------------------------------------------------------------
114
+ */
115
+
116
+ .mapp-search {
117
+ overflow: hidden;
118
+ position: relative;
119
+ }
120
+
121
+ .mapp-search input {
122
+ background: white !important; /* 2016 */
123
+ border: 1px solid lightgray !important;
124
+ box-shadow: none !important;
125
+ color: black !important;
126
+ line-height: 22px;
127
+ margin: 0px !important;
128
+ padding: 5px 28px 5px 5px !important;
129
+ vertical-align: middle;
130
+ width: 100%;
131
+ }
132
+
133
+
134
+ /* Error messages, e.g. invalid address */
135
+ .mapp-search input.mapp-error {
136
+ outline: 1px solid red !important;
137
+ }
138
+
139
+ .mapp-search .mapp-geolocate {
140
+ background: white url('../images/geolocate-2x.png') no-repeat center center;
141
+ background-size: 18px 18px;
142
+ height: 18px;
143
+ margin: -9px 10px;
144
+ position: absolute;
145
+ top: 50%; right:0;
146
+ width: 18px;
147
  }
148
 
149
  /*
301
  POI List (new)
302
  Structure:
303
  .mapp-list
304
+ .mapp-items
305
+ .mapp-item (one for each POI)
306
  -----------------------------------------------------------------------------------
307
  */
308
 
309
  .mapp-list {
310
  background-color: white;
 
311
  position: relative; /* Needed to scroll list for selection */
312
  z-index: 1;
313
  }
314
 
315
+ .mapp-inline .mapp-list .mapp-items {
316
  border-top: 1px solid lightgray;
317
  max-height: 300px;
318
  }
325
  width: 35%;
326
  }
327
 
328
+ .mapp-list .mapp-items {
329
+ height: 100%;
330
+ overflow: auto;
331
+ }
332
+
333
+ .mapp-list .mapp-item {
334
  border-bottom: 1px solid lightgray;
335
+ cursor: pointer;
336
  overflow: hidden;
337
  padding: 5px;
338
  }
339
 
340
+ .mapp-list .mapp-item:hover, .mapp-list .mapp-item.mapp-selected {
341
  background-color: #fafafa;
342
  }
343
 
344
 
345
+ .mapp-list .mapp-item .mapp-title {
346
  overflow: hidden;
347
  vertical-align: middle;
348
  }
349
 
350
+ .mapp-list .mapp-item .mapp-icon {
351
  float: left;
352
  margin-right: 5px;
353
  max-width: 24px !important; /* 2012 tries to override */
354
  max-height: 24px;
355
  }
356
 
357
+ .mapp-list .mapp-item .mapp-actions {
358
+ visibility: hidden;
359
+ }
360
+
361
+ .mapp-list .mapp-item:hover .mapp-actions {
362
+ color: black;
363
+ visibility: visible;
364
+ }
365
+
366
+ .mapp-list .dashicons {
367
+ color: #82878c;
368
+ }
369
+
370
+ .mapp-list-footer {
371
+ margin-top: 10px;
372
+ text-align: center;
373
+ }
374
+
375
+ .mapp-list .mapp-next, .mapp-list .mapp-prev {
376
+ background-color: #f7f7f7;
377
+ border: 1px solid #ccc;
378
+ color: gray;
379
+ cursor: pointer;
380
+ display: inline-block;
381
+ line-height: 1;
382
+ margin: 0 10px 0 10px;
383
+ padding: 5px;
384
+ text-align: center;
385
+ user-select: none;
386
+ }
387
+
388
+ .mapp-list .mapp-next.mapp-active, .mapp-list .mapp-prev.mapp-active {
389
+ background-color: #e8e8e8;
390
+ color: black;
391
+ }
392
+
393
+
394
  /*
395
  -----------------------------------------------------------------------------------
396
  Directions
537
  */
538
  .mapp-table {
539
  display: table;
540
+ width: 100%;
541
  }
542
 
543
  .mapp-table > div { display: table-row; }
544
+ .mapp-table > div > div, .mapp-table > div > label {
545
+ display: table-cell;
546
+ }
547
 
548
  /*
549
  -----------------------------------------------------------------------------------
598
  }
599
 
600
  .mapp-spinner {
601
+ background: transparent url(../images/loading.gif) no-repeat center center;
602
  height:16px;
603
  width: 16px;
604
  margin-left: 10px;
605
  margin-right: 10px;
 
606
  }
607
 
608
  *[data-mapp-action] {
forms/map_editor.php CHANGED
@@ -54,9 +54,9 @@
54
  </script>
55
 
56
  <script type='text/template' id='mapp-tmpl-poi-list'>
57
- <div class='mapp-pois'>
58
  <# _.forEach(pois, function(poi, i) { #>
59
- <div class='mapp-poi' data-mapp-action='open' data-mapp-poi='{{{i}}}'>
60
  <img class='mapp-icon' src='<# print(mapp.Icons.getUrl(poi.iconid)); #>'>
61
  <div class='mapp-title'>{{poi.title}}</div>
62
  </div>
54
  </script>
55
 
56
  <script type='text/template' id='mapp-tmpl-poi-list'>
57
+ <div class='mapp-items'>
58
  <# _.forEach(pois, function(poi, i) { #>
59
+ <div class='mapp-item' data-mapp-action='open' data-mapp-poi='{{{i}}}'>
60
  <img class='mapp-icon' src='<# print(mapp.Icons.getUrl(poi.iconid)); #>'>
61
  <div class='mapp-title'>{{poi.title}}</div>
62
  </div>
js/mappress.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(n){mapp.Map=function(t){function c(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)google.maps.event.addListener(r,n[i],t)}function l(){var u,t;n("[data-mapp-type]",i.menu).removeClass("mapp-active");n('[data-mapp-type="'+r.getMapTypeId()+'"]',i.menu).addClass("mapp-active");for(layer in e)u=!!e[layer].getMap(),n('[data-mapp-layer="'+layer+'"]',i.menu).toggleClass("mapp-active",u);t=!!(f.center&&f.zoom);n('[data-mapp-action="viewport-set"]',i.menu).toggle(!t);n('[data-mapp-action="viewport-reset"]',i.menu).toggle(t)}function a(){var n=mappl10n.options.styles,i=mappl10n.options.style,u=["roadmap","satellite","terrain","hybrid"],t;if(i&&typeof n[i]!="undefined"&&r.setOptions({styles:n[i]}),f.editable){for(t in n)r.mapTypes.set(t,new google.maps.StyledMapType(n[t],{name:t})),u.push(t);r.setOptions({mapTypeControlOptions:{mapTypeIds:u,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else typeof n[f.mapTypeId]!="undefined"&&r.setOptions({styles:n[f.mapTypeId]})}function v(){i.controls.children("[data-mapp-position]").each(function(){var t=n(this).attr("data-mapp-position"),i;t=t?google.maps.ControlPosition[t]:google.maps.ControlPosition.TOP_RIGHT;i=n(this);i.get(0).index=0;r.controls[t].push(i.get(0))})}function y(){var o,i,t,u;for(e={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},o=n.makeArray(f.options.layers),i=0;i<o.length;i++)t=n.trim(o[i]),u=t.split(".").pop(),e[t]?h(t):u=="kml"||u=="kmz"?e[t]=new google.maps.KmlLayer({map:r,preserveViewport:!0,url:t}):u=="json"&&(e[t]=new google.maps.Data({map:r}).loadGeoJson(t))}function h(t,i){i=typeof i!="undefined"?i:e[t].getMap()==null;n.each(["traffic","bicycling","transit"],function(n,t){e[t].setMap(null)});t&&e[t].setMap(i?r:null)}function p(t,i){var u=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(r.getMapTypeId()==t);t=f.editable?i&&(u||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":u?t:"roadmap";r.setMapTypeId(t)}this.center=t.center;this.height=t.height;this.mapid=t.mapid;this.mapTypeId=t.mapTypeId?t.mapTypeId:"roadmap";this.metaKey=t.metaKey;this.name=t.name;this.options=t.options;this.query=t.query;this.title=t.title;this.width=t.width;this.zoom=t.zoom?parseInt(t.zoom,10):null;this.editable=t.options.editable;this.iw=null;this.layers=t.options.layers;this.places=null;this.poi=null;var f=this,o=null,i={},r=null,e={},w=t.options,u=[],s;this.display=function(){if(i.layout=n("#"+this.name),i.canvas=n(".mapp-canvas",i.layout),i.controls=n(".mapp-controls",i.layout),i.dialog=n(".mapp-dialog",i.layout),i.dir=n(".mapp-directions",i.layout),i.filters=n(".mapp-filters",i.layout),i.list=n(".mapp-list",i.layout),i.menu=n(".mapp-menu",i.controls),!i.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);r=new google.maps.Map(i.canvas.get(0),{mapTypeId:"roadmap",zoom:1});s=google.maps.Marker.MAX_ZINDEX;var u={backgroundColor:"transparent",fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:this.options.minZoom?parseInt(this.options.minZoom):0,scaleControl:!0,scrollwheel:!1,streetViewControl:!(this.editable||this.query)};r.setOptions(u);a();v();y();p(this.mapTypeId,!0);this.places=new mapp.Places(null,{gmap:r});google.maps.event.addListener(this.places,"search",function(n){f.search(n)});i.layout.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");t.preventDefault();f.action(i,n(this).attr("data-mapp-"+i),n(this))});i.filters.on("change",function(){f.ajaxQuery(r.getBounds())});c("click drag",function(){f.closeInfoWindow()});i.layout.on("click",function(t){var r=n(t.target),u=r.attr("data-mapp-action");r==i.filters||u=="filters-toggle"||r.closest(i.filters).length||f.toggleView("filters",!1);r==i.menu||u=="menu-toggle"||r.closest(i.menu).length||f.toggleView("menu",!1)});if(n(window).resize(function(){f.resize()}),this.iw=this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,mappl10n.options.directions!="none"&&(o=new mapp.Directions(i.dir,{map:f,directions:mappl10n.options.directions})),this.query){this.options.search?this.places.parse(this.options.search):this.ajaxQuery();return}google.maps.event.addListenerOnce(r,"idle",function(){f.initCenter()});this.setPois(t.pois);this.renderList()};this.action=function(t,f,e){switch(t){case"center":this.toggleView("menu",!1);this.closeInfoWindow();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":i.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(r.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate();break;case"layer":h(f);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var o=e.attr("data-mapp-poi");this.openInfoWindow(u[o]);break;case"show":i.layout.show();this.resize();this.initCenter();break;case"viewport-set":this.center=r.getCenter().toJSON();this.zoom=r.getZoom();this.toggleView("menu",!1);break;case"viewport-reset":this.center=null;this.zoom=null;this.toggleView("menu",!1);break;default:return!0}};this.closeInfoWindow=function(){this.iw.close();this.poiSelect(null)};this.openDirections=function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";o.open(i,r)};this.poiSelect=function(t){if(this.poi=t,n("[data-mapp-poi]",i.list).removeClass("mapp-selected"),t){var f=n.inArray(t,u),r=n('[data-mapp-poi="'+f+'"]',i.list);r.addClass("mapp-selected");mapp.lib.scrollTo(i.list,r);s++;t.setZIndex(s)}};this.getMap=function(){return r};this.renderList=function(){this.editable&&(i.list.html(mapp.lib.template("poi-list",{pois:u})),google.maps.event.trigger(this,"rendered"))};this.getPoi=function(n){return n=typeof n=="string"?parseInt(n,10):n,u[n]};this.getPoiById=function(n){for(var t=0;t<u.length;t++)if(u[t].postid==n)return u[t];return null};this.getPois=function(){return u};this.addPoi=function(n){u.unshift(n);n.setMap(this);f.renderList();this.poiSelect(n)};this.removePoi=function(t){var i=n.inArray(t,u);i!=-1&&(u[i].setMap(null),u.splice(i,1),f.renderList())};this.setPois=function(n){for(var i,t=0;t<u.length;t++)u[t].setMap(null);if(u=[],n){for(t=0;t<n.length;t++)i=new mapp.Poi,i.fromJSON(n[t]),u.push(i),i.setMap(this),i.setZIndex(s+n.length-1-t);s+=n.length-1}};this.sortPois=function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(u[r])}if(t.length!=u.length)return!1;u=t;this.renderList()};this.openInfoWindow=function(n,t){if(this.options.iwType!="none"){if(o&&o.close(),this.iw.close(),this.poiSelect(n),!this.editable){if(this.options.mashupClick=="post"&&n.postid&&n.url){window.location.assign(n.url);return}this.iw.setContent(n.html)}google.maps.event.addListenerOnce(this.iw,"domready",function(){google.maps.event.trigger(f,"poidomready",n)});google.maps.event.trigger(f,"open",n);var i=new google.maps.MVCObject;i.setValues({position:n.getPosition(t),anchorPoint:n.getAnchorPoint(t)});this.iw.open(r,i)}};this.togglePois=function(n){n=!!n;for(var t=0;t<u.length;t++)u[t].setVisible(n)};this.toggleView=function(n,t){t=typeof t=="undefined"?!i.layout.hasClass("mapp-view-"+n):t;i.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&l()};this.resize=function(){var n=r.getCenter();google.maps.event.trigger(r,"resize");r.setCenter(n);return};this.initCenter=function(){var n=u.length?u[0]:null;google.maps.event.addListenerOnce(r,"idle",function(){if(o&&f.options.initialOpenDirections){f.openDirections(null,n);return}n&&f.options.initialOpenInfo&&n.open()});this.recenter()};this.recenter=function(){var f=!this.query&&this.center?new google.maps.LatLng(this.center.lat,this.center.lng):null,t=!this.query&&this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,n,i;if(f){r.setCenter(f);r.setZoom(t?t:1);return}if(u.length==0){r.setCenter(new google.maps.LatLng(0,0));r.setZoom(1);return}if(u.length==1){u[0].center(t);return}for(bounds=new google.maps.LatLngBounds,n=0;n<u.length;n++)i=u[n].getBounds(),bounds=i?bounds.union(i):bounds.extend(u[n].getPosition());r.fitBounds(bounds)};this.toJSON=function(){for(var t={center:this.center,height:this.height,mapid:this.mapid,mapTypeId:r.getMapTypeId(),metaKey:this.metaKey,pois:[],title:this.title,width:this.width,zoom:this.zoom},n=0;n<u.length;n++)t.pois.push(u[n].toJSON());return t};this.ajaxSave=function(n){mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:JSON.stringify(this),postid:mappl10n.options.postid},callback:function(t){t.status=="OK"&&(f.mapid=t.data.mapid,n(t.data))}})}};mapp.Map.ajaxCreate=function(t,i,r){mapp.lib.ajax({type:"GET",data:{action:"mapp_create"},callback:function(u){if(u.status=="OK"){n.extend(u.data.map.options,i);u.data.map.name=t;var f=new mapp.Map(u.data.map);r(f)}}})};mapp.Map.ajaxGet=function(t,i,r,u){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:t},callback:function(t){if(t.status=="OK"){n.extend(t.data.map.options,r);t.data.map.name=i;var f=new mapp.Map(t.data.map);u(f)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){function h(t,i,o){var c=n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var l={travelMode:c,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:t,destination:i},h=n(".mapp-dir-renderer",r).get(0);n(".mapp-dir-renderer",r).empty();s||(s=new google.maps.DirectionsService);s.route(l,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:f.opts.map.togglePois(!1);u?(u.setDirections(n),u.setMap(e),u.setPanel(h)):u=new google.maps.DirectionsRenderer({map:e,panel:h,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_error);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_error);break;default:alert(mappl10n.dir_error+t)}o()})}this.opts=n.extend({map:null,directions:null},i);var r=n(t),e,o,u,s,f=this;e=this.opts.map.getMap();o=new mapp.Geocoder(e);r.on("keydown",function(t){t.which==13?(f.getDirections(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val()),t.preventDefault()):t.which==27&&f.close()});r.on("click","[data-mapp-action]",function(t){var h=n(this).attr("data-mapp-action"),i,u,e,s;t.preventDefault();switch(h){case"dir-cancel":f.close();break;case"dir-get":f.getDirections();break;case"dir-google":i=n(".mapp-dir-saddr",r).val();u=n(".mapp-dir-daddr",r).val();f.openGoogle(i,u);f.close();break;case"dir-myloc":o.geolocate(function(t){t?n(".mapp-dir-saddr",r).val(t.coords.latitude+", "+t.coords.longitude):alert(mappl10n.no_geolocate)});break;case"dir-swap":e=n(".mapp-dir-daddr",r).val();s=n(".mapp-dir-saddr",r).val();n(".mapp-dir-saddr",r).val(e);n(".mapp-dir-daddr",r).val(s)}});this.open=function(t,i){if(this.opts.directions=="google"){this.openGoogle(t,i);return}this.opts.map.toggleView("directions",!0);n(".mapp-dir-saddr",r).val(t);n(".mapp-dir-daddr",r).val(i);n(".mapp-dir-get",r).focus();n(".mapp-dir-saddr",r).focus()};this.close=function(){this.opts.map.toggleView("directions",!1);u&&(u.setPanel(null),u.getMap()&&(u.setMap(null),this.opts.map.togglePois(!0)))};this.getDirections=function(){this.opts.map.closeInfoWindow();n(".mapp-spinner",r).show();var t=n(".mapp-dir-saddr",r),i=n(".mapp-dir-daddr",r),u=n(".mapp-dir-saddr-err",r),f=n(".mapp-dir-daddr-err",r);o.geocodeField(t,u,function(t){o.geocodeField(i,f,function(i){t&&i?h(t,i,function(){n(".mapp-spinner",r).hide();return}):n(".mapp-spinner",r).hide()})})};this.printDirections=function(){var i,t=n(".mapp-travelmode-on > span",r);i=t.hasClass("mapp-dir-walk")?"w":t.hasClass("mapp-dir-bike")?"b":t.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val(),i)};this.openGoogle=function(n,t,i){var r=mappl10n.options.directionsServer;r.toLowerCase().indexOf("http")==-1&&(r="https://"+r);r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}}}(jQuery);mapp=window.mapp||{};mapp.Geocoder=function(n){function r(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function u(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var t,f,i=this;f=n;this.geocode=function(i,r){typeof i=="string"&&i.substring(0,1)=="("&&(split=i.replace(/\(|\)/g,"").split(","),i=new google.maps.LatLng(split[0],split[1]));var u=i instanceof google.maps.LatLng?{location:i}:{address:i,region:mappl10n.options.country,bounds:n.getBounds()};t||(t=new google.maps.Geocoder);t.geocode(u,function(n,t){if(n){for(var i=0;i<n.length;i++)n[i].formatted_address==""&&n.splice(i,1);r(n[0],t)}else r(null,t)})};this.geolocate=function(n){if(!navigator||!navigator.geolocation)return null;navigator.geolocation.getCurrentPosition(function(t){n(t)},function(){n(null)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};this.stringToLatLng=function(n){var t=n.split(",",2),i=Number(t[0]),r=Number(t[1]);return isNaN(i)||isNaN(r)?!1:new google.maps.LatLng(i,r)};this.geocodeField=function(n,t,i){r(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){u(n,t,mappl10n.no_address);i(null);return}if(r&&r.formatted_address){jQuery(n).val(r.formatted_address);i(r.formatted_address);return}i(r);return})};this.autocompleteField=function(n,t,f,e,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(f).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(e).click(function(){return r(n,t),i.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else u(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,f,e){if(r(n,t),f=jQuery.trim(f),f==""){e(null);return}var o=i.stringToLatLng(f);if(o){e(o);return}if(f.substring(0,4)=="http"){e(f);return}i.geocode(f,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){u(n,t,mappl10n.no_address);e(null);return}e(i);return})}};mapp.Geocoder.parseAddress=function(n){return!n||n==""?{firstLine:"",secondLine:""}:(n.lastIndexOf(", USA")>0||n.lastIndexOf(", United States")>0)&&(n.lastIndexOf(", USA")>0&&(n=n.slice(0,n.lastIndexOf(", USA"))),n.lastIndexOf(", United States")>0&&(n=n.slice(0,n.lastIndexOf(", United States"))),n.indexOf(",")==n.lastIndexOf(","))?{firstLine:n,secondLine:""}:n.indexOf(",")==-1?{firstLine:n,secondLine:""}:{firstLine:n.slice(0,n.indexOf(",")),secondLine:n.slice(n.indexOf(", ")+2)}};mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({disableAutoPan:!1,border:20},i),u=null,r=null,e=null,o=this;r=n('<div class="mapp-ib" tabindex="0">').appendTo(t.getMap().getDiv());e=n('<div class="mapp-ib-tip">').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){o.close()});r.on("keydown",function(n){n.which==27&&o.close()});r.on("click",".mapp-close",function(){o.close()});this.getContent=function(){return r};this.setContent=function(n){r.empty().append(n)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){r.show();e.show();var t=n(":input",r);t.length?t.first().focus():r.focus();google.maps.event.trigger(o,"domready")};this.draw=function(){var l=this.getMap(),c=this.getProjection().fromLatLngToContainerPixel(u.position),t={width:n(l.getDiv()).width(),height:n(l.getDiv()).height()},v=n(".mapp-ib-body",r);if(!f.disableAutoPan){r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var s=r.outerWidth(!0),h=r.outerHeight(!0),a=e.outerHeight(!0),i=c.x,o=c.y;i+s/2>t.width&&(i=t.width-s/2);i-s/2<0&&(i=s/2);o-h+u.anchorPoint.y-a<f.border&&(o=h-u.anchorPoint.y+f.border+a);o>t.height&&(o=t.height);l.panBy(c.x-i,c.y-o);h>t.height+u.anchorPoint.y-2*f.border&&(h=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":h+2}));r.css({left:i-s/2,bottom:t.height-o-u.anchorPoint.y+a});e.css({left:i,bottom:t.height-o-u.anchorPoint.y})}};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.hide();e.hide()}};mapp.InfoBox.prototype=new google.maps.OverlayView}(jQuery);mapp=window.mapp||{};+function(n){if(mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.log(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.log(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(n.trim(r),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}},typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("ERROR: Google Maps API Key missing, please check MapPress settings and FAQ");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")});mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).attr("id"),t=window[i];t.resize();t.initCenter()})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;if(this.sel=n(t),this.opts=n.extend({map:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length){this.opts.types||(this.opts.types=[]);this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types});this.autocomplete.bindTo("bounds",this.opts.map.getMap());this.sel.on("keydown",function(n){if(n.which==13)return!1});google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())})}};mapp.Places.prototype={parse:function(t){var u,i=this,r;if(this.error(!1),r=t&&t.name?n.trim(t.name):n.trim(t),!r)return this.error(!0);if(r=="geolocate")return this.geolocate();if(r.substring(0,4)=="http"||r.substring(0,3)=="kml"&&typeof typenow!="undefined"&&typenow=="mappress_map"){google.maps.event.trigger(i,"search",r=="kml"?"http://googlemaps.github.io/js-v2-samples/ggeoxml/cta.kml":r);return}if(t&&t.geometry){t.formatted_address&&this.set(t.formatted_address);google.maps.event.trigger(i,"search",t);return}if(latLngLoc=this.parseLatLng(t)){google.maps.event.trigger(i,"search",latLngLoc);return}this.autocompleteService.getPlacePredictions({input:r,types:this.opts.types,bounds:this.opts.map.getMap().getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return i.error(!0);u=typeof n[0].description!="undefined"?n[0].description:null;i.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return i.error(!0);u=u?u:n.formatted_address;i.set(u);google.maps.event.trigger(i,"search",n)})})},parseLatLng:function(t){var i,r;return t instanceof google.maps.LatLng?i=t:t&&t.lat&&t.lng?i=new google.maps.LatLng(t.lat,t.lng):(name=t&&t.name?n.trim(t.name):n.trim(t),r=name.split(","),r.length!=2||isNaN(r[0])||isNaN(r[1])||(i=new google.maps.LatLng(r[0],r[1]))),i?{name:i.toUrlValue(),geometry:{location:i}}:null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){n.set("");var i=new google.maps.LatLng(t.coords.latitude,t.coords.longitude),r={name:i.toUrlValue(),geometry:{location:i}};google.maps.event.trigger(n,"search",r)},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){n=n.replace(", United States of America","").replace(", USA","").replace(", United States","");this.sel.blur();this.sel.val(n);this.sel.blur();this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n)}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(){this.address=null;this.body=null;this.html=null;this.iconid=null;this.kml=null;this.map=null;this.overlay=null;this.postid=null;this.title="";this.url=null;this.type=null;this.viewport=null;for(var n in arguments[0])typeof arguments[0][n]!="undefined"&&(this[n]=arguments[0][n])};mapp.Poi.prototype={fromJSON:function(n){var u,f,i,o,t,r,s,e;this.address=n.correctedAddress;this.body=n.body;this.correctedAddress=n.correctedAddress;this.html=n.html;this.iconid=n.iconid;this.kml=n.kml;this.postid=n.postid;this.title=n.title;this.type=n.type;this.url=n.url;n.viewport&&n.viewport.sw&&n.viewport.ne&&(u=new google.maps.LatLng(n.viewport.sw.lat,n.viewport.sw.lng),f=new google.maps.LatLng(n.viewport.ne.lat,n.viewport.ne.lng),this.viewport=u.lat()==0&&u.lng()==0&&f.lat()==0&&f.lng()==0?null:new google.maps.LatLngBounds(u,f));i=[];o=[];switch(this.type){case"polygon":if(n.poly&&n.poly.paths)for(t=0;t<n.poly.paths.length;t++){for(i=[],r=0;r<n.poly.paths[t].length;r++)i.push(new google.maps.LatLng(n.poly.paths[t][r].lat,n.poly.paths[t][r].lng));o.push(new google.maps.MVCArray(i))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(o)});this.setColors(n.poly);break;case"polyline":if(n.poly&&n.poly.path)for(t=0;t<n.poly.path.length;t++)i.push(new google.maps.LatLng(n.poly.path[t].lat,n.poly.path[t].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(i)});this.setColors(n.poly);break;case"circle":e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Circle({center:e,radius:parseFloat(n.poly.radius)});this.setColors(n.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(n.poly);break;case"kml":s=n.kml&&n.kml.url?n.kml.url:"";this.overlay=new google.maps.KmlLayer(s,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:e=new google.maps.LatLng(n.point.lat,n.point.lng);this.overlay=new google.maps.Marker({position:e})}},toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},r=this.getPosition(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},setMap:function(t){var i=this;if(google.maps.event.clearInstanceListeners(this.overlay),t==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=t;this.overlay.setMap(t.getMap());this.setEditable(this.map.editable);this.setIcon(this.iconid);this.type||this.overlay.setTitle(n("<div>").html(this.title).text());google.maps.event.addListener(this.overlay,"click",function(n){i.open(n)})},setEditable:function(n){var t=this;this.type!="kml"&&(this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),google.maps.event.clearListeners(this.overlay,"rightclick"),google.maps.event.clearListeners(this.overlay,"dragstart"),n&&(google.maps.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.closeInfoWindow()}),(this.type=="polygon"||this.type=="polyline")&&google.maps.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},getZIndex:function(){return this.type?this.overlay.zIndex:this.overlay.getZIndex()},setZIndex:function(n){this.type?this.overlay.zIndex=n:this.overlay.setZIndex(n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n)),this.iconid=n)},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},center:function(n){var t=this.map.getMap(),i=this.getBounds();if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(parseInt(mappl10n.options.poiZoom)))},open:function(n){this.map.openInfoWindow(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.editable&&this.viewport)return this.viewport;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport?this.viewport:null}return n},getPosition:function(n){if(!this.type)return this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():new google.maps.LatLng(0,0)},click:function(){google.maps.event.trigger(this.overlay,"click")},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){return this.type=="kml"?n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0):this.type?new google.maps.Point(0,0):typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop(),t=new mapp.Map(n);window[n.name]=t;t.display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
1
+ var mapp=window.mapp||{};+function(n){mapp.Map=function(t,r){function v(n,t){n=n.split(" ");for(var i=0;i<n.length;i++)google.maps.event.addListener(u,n[i],t)}function y(){var i,t;n("[data-mapp-type]",e.menu).removeClass("mapp-active");n('[data-mapp-type="'+u.getMapTypeId()+'"]',e.menu).addClass("mapp-active");for(layer in s)i=!!s[layer].getMap(),n('[data-mapp-layer="'+layer+'"]',e.menu).toggleClass("mapp-active",i);t=!!(f.center&&f.zoom);n('[data-mapp-action="viewport-set"]',e.menu).toggle(!t);n('[data-mapp-action="viewport-reset"]',e.menu).toggle(t)}function p(){var n=mappl10n.options.styles,i=mappl10n.options.style,r=["roadmap","satellite","terrain","hybrid"],t;if(i&&typeof n[i]!="undefined"&&u.setOptions({styles:n[i]}),f.editable){for(t in n)u.mapTypes.set(t,new google.maps.StyledMapType(n[t],{name:t})),r.push(t);u.setOptions({mapTypeControlOptions:{mapTypeIds:r,position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}})}else typeof n[f.mapTypeId]!="undefined"&&u.setOptions({styles:n[f.mapTypeId]})}function w(){e.controls.children("[data-mapp-position]").each(function(){var t=n(this).attr("data-mapp-position"),i;t=t?google.maps.ControlPosition[t]:google.maps.ControlPosition.TOP_RIGHT;i=n(this);i.get(0).index=0;u.controls[t].push(i.get(0))})}function b(){var e,i,t,r;for(s={traffic:new google.maps.TrafficLayer,bicycling:new google.maps.BicyclingLayer,transit:new google.maps.TransitLayer},e=n.makeArray(f.layers),i=0;i<e.length;i++)t=n.trim(e[i]),r=t.split(".").pop(),s[t]?l(t):r=="kml"||r=="kmz"?s[t]=new google.maps.KmlLayer({map:u,preserveViewport:!0,url:t}):r=="json"&&(s[t]=new google.maps.Data({map:u}).loadGeoJson(t))}function l(t,i){n.each(["traffic","bicycling","transit"],function(n,t){s[t].setMap(null)});t&&(i=typeof i=="undefined"?s[t].getMap()==null:i,s[t].setMap(i?u:null))}function a(t,i){var r=n.inArray(t,["roadmap","satellite","terrain","hybrid"])!=-1;i=typeof i!="undefined"?i:!(u.getMapTypeId()==t);t=f.editable?i&&(r||typeof mappl10n.options.styles[t]!="undefined")?t:"roadmap":r?t:"roadmap";u.setMapTypeId(t)}this.defaults={center:null,editable:null,geolocate:null,height:null,initialOpenDirections:null,initialOpenInfo:null,layers:null,mapid:null,mapTypeId:null,metaKey:null,minZoom:null,name:null,pois:null,postid:null,query:null,title:null,width:null,zoom:null};this.iw=null;this.places=null;this.poi=null;this.settings=r;var f=this,h=null,e={},u=null,s={},o=[],c;_.extend(this,this.defaults,_.pick(t,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));this.display=function(){if(e.layout=n("#"+this.name),n.each(["canvas","controls","dialog","directions","filters","list","menu","search"],function(t,i){e[i]=n(".mapp-"+i,e.layout)}),!e.canvas.length)return mapp.lib.log("MapPress: Missing map name or container for map: "+this.name);u=new google.maps.Map(e.canvas.get(0),{mapTypeId:"roadmap",zoom:1});var t={backgroundColor:"transparent",fullscreenControl:!1,keyboardShortcuts:!1,mapTypeControl:!0,mapTypeControlOptions:{position:google.maps.ControlPosition.TOP_RIGHT,style:google.maps.MapTypeControlStyle.DROPDOWN_MENU},minZoom:this.minZoom?parseInt(this.minZoom):0,scaleControl:!0,scrollwheel:!1,streetViewControl:!this.editable&&!this.query};u.setOptions(t);p();w();b();a(this.mapTypeId,!0);e.search.length&&(this.places=new mapp.Places(n(".mapp-places",e.search),{map:f}),f.editable||google.maps.event.addListener(this.places,"search",function(n){f.search(n)}));e.layout.on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");t.preventDefault();f.action(i,n(this).attr("data-mapp-"+i),n(this))});e.filters.on("change",function(){f.ajaxQuery(u.getBounds())});v("click drag",function(){f.closeInfoWindow()});e.layout.on("click",function(t){var i=n(t.target),r=i.attr("data-mapp-action");i==e.filters||r=="filters-toggle"||i.closest(e.filters).length||f.toggleView("filters",!1);i==e.menu||r=="menu-toggle"||i.closest(e.menu).length||f.toggleView("menu",!1)});if(n(window).resize(function(){f.resize()}),this.iw=mappl10n.options.iwType=="ib"||this.editable?new mapp.InfoBox(this):new google.maps.InfoWindow,this.query){this.geolocate?this.places.parse("geolocate"):this.ajaxQuery();return}google.maps.event.addListenerOnce(u,"idle",function(){f.initCenter()});this.setPois(this.pois)};this.load=function(n){_.extend(this,this.defaults,_.pick(n,_.keys(this.defaults)),_.pick(this.settings,_.keys(this.defaults)));f.resize();a(this.mapTypeId,!0);this.toggleView("menu",!1);l();this.poiSelect(null);this.setPois(this.pois);this.places&&this.places.set("");f.recenter();google.maps.event.trigger(this,"load")};this.action=function(t,i,r){switch(t){case"center":this.toggleView("menu",!1);this.closeInfoWindow();this.recenter();break;case"dir":this.openDirections(null,this.poi);break;case"dir-from":this.openDirections(this.poi,null);break;case"filters-reset":e.filters.find(":input").each(function(){this.type=="checkbox"||this.type=="radio"?n(this).prop("checked",!1):n(this).val("")});this.ajaxQuery(u.getBounds());break;case"filters-toggle":this.toggleView("filters");break;case"geolocate":this.places.geolocate();break;case"layer":l(i);this.toggleView("menu",!1);break;case"menu-toggle":this.toggleView("menu");break;case"open":var f=r.attr("data-mapp-poi");this.openInfoWindow(o[f]);break;case"show":e.layout.show();this.resize();this.initCenter();break;case"viewport-set":this.center=u.getCenter().toJSON();this.zoom=u.getZoom();this.toggleView("menu",!1);break;case"viewport-reset":this.center=null;this.zoom=null;this.toggleView("menu",!1);this.recenter();break;default:return!0}};this.closeInfoWindow=function(){this.iw.close();this.poiSelect(null)};this.openDirections=function(n,t){var i=n?n.getAddress():"",r=t?t.getAddress():"";h||(h=new mapp.Directions(e.directions,{map:f,directions:mappl10n.options.directions}));h.open(i,r)};this.poiSelect=function(t){if(this.poi=t,n("[data-mapp-poi]",e.list).removeClass("mapp-selected"),t){var r=n.inArray(t,o),i=n('[data-mapp-poi="'+r+'"]',e.list);i.addClass("mapp-selected");mapp.lib.scrollTo(e.list,i);c++;t.setZIndex(c)}};this.getMap=function(){return u};this.renderList=function(){this.editable&&(e.list.html(mapp.lib.template("poi-list",{pois:o})),google.maps.event.trigger(this,"render-list"))};this.getPois=function(){return o};this.addPoi=function(n){o.unshift(n);n.setMap(this);f.renderList();this.poiSelect(n)};this.removePoi=function(t){var i=n.inArray(t,o);i!=-1&&(o[i].setMap(null),o.splice(i,1),f.renderList())};this.resetPois=function(){for(i=0;i<o.length;i++)o[i].setMap(null);o=[];c=google.maps.Marker.MAX_ZINDEX};this.setPois=function(n){var t,i;if(this.resetPois(),n){for(t=0;t<n.length;t++)i=new mapp.Poi(n[t]),o.push(i),i.setMap(this),i.setZIndex(c+n.length-1-t);c+=n.length-1}this.renderList()};this.sortPois=function(n){for(var r,t=Array(),i=0;i<n.length;i++){if(r=parseInt(n[i]),isNaN(r))return!1;t.push(o[r])}if(t.length!=o.length)return!1;o=t;this.renderList()};this.openInfoWindow=function(n,t){if(h&&h.close(),this.iw.close(),this.poiSelect(n),!this.editable){if(mappl10n.options.mashupClick=="post"&&n.postid&&n.url){window.location.assign(n.url);return}this.iw.setContent(n.html)}google.maps.event.addListenerOnce(this.iw,"domready",function(){google.maps.event.trigger(f,"poidomready",n)});google.maps.event.trigger(f,"open",n);var i=new google.maps.MVCObject;i.setValues({position:n.getPosition(t),anchorPoint:n.getAnchorPoint(t)});this.iw.open(u,i)};this.togglePois=function(n){n=!!n;for(var t=0;t<o.length;t++)o[t].setVisible(n)};this.toggleView=function(n,t){t=typeof t=="undefined"?!e.layout.hasClass("mapp-view-"+n):t;e.layout.toggleClass("mapp-view-"+n,t);n=="menu"&&t&&y();n=="directions"&&this.resize()};this.resize=function(){var n=u.getCenter();google.maps.event.trigger(u,"resize");u.setCenter(n);return};this.initCenter=function(){var n=o.length?o[0]:null;google.maps.event.addListenerOnce(u,"idle",function(){if(f.initialOpenDirections){f.openDirections(null,n);return}n&&f.initialOpenInfo&&n.open()});this.recenter()};this.recenter=function(){var r=!this.query&&this.center?new google.maps.LatLng(this.center.lat,this.center.lng):null,t=!this.query&&this.zoom&&parseInt(this.zoom)?parseInt(this.zoom):null,n,i;if(r){u.setCenter(r);u.setZoom(t?t:1);return}if(o.length==0){u.setCenter(new google.maps.LatLng(0,0));u.setZoom(1);return}if(o.length==1){o[0].center(t);return}for(bounds=new google.maps.LatLngBounds,n=0;n<o.length;n++)i=o[n].getBounds(),bounds=i?bounds.union(i):bounds.extend(o[n].getPosition());u.fitBounds(bounds)};this.toJSON=function(){var n;for(this.pois=[],n=0;n<o.length;n++)this.pois.push(o[n].toJSON());return{center:this.center,height:this.height,mapid:this.mapid,mapTypeId:u.getMapTypeId(),metaKey:this.metaKey,pois:this.pois,title:this.title,width:this.width,zoom:this.zoom}};this.ajaxSave=function(n){var t=JSON.stringify(this),i=!this.mapid||!this.postid?mappl10n.options.postid:this.postid;mapp.lib.ajax({type:"POST",data:{action:"mapp_save",map:t,postid:i},callback:function(t){t.status=="OK"&&(f.mapid=t.data.mapid,n(t.data),google.maps.event.trigger(f,"save"))}})}};mapp.Map.ajaxCreate=function(n,t){mapp.lib.ajax({type:"GET",data:{action:"mapp_create"},callback:function(i){if(i.status=="OK"){var r=new mapp.Map(i.data.map,n);t(r)}}})};mapp.Map.ajaxGet=function(n,t,i){mapp.lib.ajax({type:"GET",data:{action:"mapp_get",mapid:n},callback:function(n){if(n.status=="OK"){var r=new mapp.Map(n.data.map,t);i(r)}}})};mapp.Map.ajaxDelete=function(n,t){mapp.lib.ajax({type:"POST",data:{action:"mapp_delete",mapid:n},callback:function(n){n.status=="OK"&&t&&t()}})}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Directions=function(t,i){function h(t,i,o){var c=n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-walk")?google.maps.DirectionsTravelMode.WALKING:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-transit")?google.maps.DirectionsTravelMode.TRANSIT:n(".mapp-travelmode-on > span",r).hasClass("mapp-dir-bike")?google.maps.DirectionsTravelMode.BICYCLING:google.maps.DirectionsTravelMode.DRIVING;var l={travelMode:c,transitOptions:{departureTime:null},provideRouteAlternatives:!0,origin:t,destination:i},h=n(".mapp-dir-renderer",r).get(0);n(".mapp-dir-renderer",r).empty();s||(s=new google.maps.DirectionsService);s.route(l,function(n,t){switch(t){case google.maps.DirectionsStatus.OK:f.opts.map.togglePois(!1);u?(u.setDirections(n),u.setMap(e),u.setPanel(h)):u=new google.maps.DirectionsRenderer({map:e,panel:h,directions:n,hideRouteList:!1,draggable:!0});break;case google.maps.DirectionsStatus.NOT_FOUND:alert(mappl10n.dir_error);break;case google.maps.DirectionsStatus.ZERO_RESULTS:alert(mappl10n.dir_error);break;default:alert(mappl10n.dir_error+t)}o()})}this.opts=n.extend({map:null,directions:null},i);var r=n(t),e,o,u,s,f=this;e=this.opts.map.getMap();o=new mapp.Geocoder(e);r.on("keydown",function(t){t.which==13?(f.getDirections(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val()),t.preventDefault()):t.which==27&&f.close()});r.on("click","[data-mapp-action]",function(t){var h=n(this).attr("data-mapp-action"),i,u,e,s;t.preventDefault();switch(h){case"dir-cancel":f.close();break;case"dir-get":f.getDirections();break;case"dir-google":i=n(".mapp-dir-saddr",r).val();u=n(".mapp-dir-daddr",r).val();f.openGoogle(i,u);f.close();break;case"dir-myloc":o.geolocate(function(t){t?n(".mapp-dir-saddr",r).val(t.coords.latitude+", "+t.coords.longitude):alert(mappl10n.no_geolocate)});break;case"dir-swap":e=n(".mapp-dir-daddr",r).val();s=n(".mapp-dir-saddr",r).val();n(".mapp-dir-saddr",r).val(e);n(".mapp-dir-daddr",r).val(s)}});this.open=function(t,i){if(this.opts.directions=="google"){this.openGoogle(t,i);return}this.opts.map.toggleView("directions",!0);n(".mapp-dir-saddr",r).val(t);n(".mapp-dir-daddr",r).val(i);n(".mapp-dir-get",r).focus();n(".mapp-dir-saddr",r).focus()};this.close=function(){this.opts.map.toggleView("directions",!1);u&&(u.setPanel(null),u.getMap()&&(u.setMap(null),this.opts.map.togglePois(!0)))};this.getDirections=function(){this.opts.map.closeInfoWindow();n(".mapp-spinner",r).show();var t=n(".mapp-dir-saddr",r),i=n(".mapp-dir-daddr",r),u=n(".mapp-dir-saddr-err",r),f=n(".mapp-dir-daddr-err",r);o.geocodeField(t,u,function(t){o.geocodeField(i,f,function(i){t&&i?h(t,i,function(){n(".mapp-spinner",r).hide();return}):n(".mapp-spinner",r).hide()})})};this.printDirections=function(){var i,t=n(".mapp-travelmode-on > span",r);i=t.hasClass("mapp-dir-walk")?"w":t.hasClass("mapp-dir-bike")?"b":t.hasClass("mapp-dir-transit")?"r":"d";this.openGoogle(n(".mapp-dir-saddr",r).val(),n(".mapp-dir-daddr",r).val(),i)};this.openGoogle=function(n,t,i){var r=mappl10n.options.directionsServer;r.toLowerCase().indexOf("http")==-1&&(r="https://"+r);r+="?saddr="+encodeURIComponent(n);r+="&daddr="+encodeURIComponent(t);i&&(r+="&dirflg="+i);window.open(r)}}}(jQuery);mapp=window.mapp||{};mapp.Geocoder=function(n){function r(n,t){jQuery(n).removeClass("mapp-error");jQuery(t).hide()}function u(n,t,i){jQuery(n).addClass("mapp-error");jQuery(t).html(i);jQuery(t).show()}var t,f,i=this;f=n;this.geocode=function(i,r){typeof i=="string"&&i.substring(0,1)=="("&&(split=i.replace(/\(|\)/g,"").split(","),i=new google.maps.LatLng(split[0],split[1]));var u=i instanceof google.maps.LatLng?{location:i}:{address:i,region:mappl10n.options.country,bounds:n.getBounds()};t||(t=new google.maps.Geocoder);t.geocode(u,function(n,t){if(n){for(var i=0;i<n.length;i++)n[i].formatted_address==""&&n.splice(i,1);r(n[0],t)}else r(null,t)})};this.geolocate=function(n){if(!navigator||!navigator.geolocation)return null;navigator.geolocation.getCurrentPosition(function(t){n(t)},function(){n(null)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})};this.stringToLatLng=function(n){var t=n.split(",",2),i=Number(t[0]),r=Number(t[1]);return isNaN(i)||isNaN(r)?!1:new google.maps.LatLng(i,r)};this.geocodeField=function(n,t,i){r(n,t);checkAddress(n,t,jQuery(n).val(),function(r){if(!r){u(n,t,mappl10n.no_address);i(null);return}if(r&&r.formatted_address){jQuery(n).val(r.formatted_address);i(r.formatted_address);return}i(r);return})};this.autocompleteField=function(n,t,f,e,o){jQuery(n).keypress(function(i){i.which==13&&(checkAddress(n,t,jQuery(n).val(),o),i.preventDefault())});jQuery(f).click(function(){return checkAddress(n,t,jQuery(n).val(),o),!1});jQuery(e).click(function(){return r(n,t),i.geolocate(function(i){if(i){var r="("+i.coords.latitude+", "+i.coords.longitude+")";jQuery(n).val("");checkAddress(n,t,r,o)}else u(n,t,mappl10n.no_geolocate);return}),!1})};checkAddress=function(n,t,f,e){if(r(n,t),f=jQuery.trim(f),f==""){e(null);return}var o=i.stringToLatLng(f);if(o){e(o);return}if(f.substring(0,4)=="http"){e(f);return}i.geocode(f,function(i,r){if(!i||r!=google.maps.GeocoderStatus.OK){u(n,t,mappl10n.no_address);e(null);return}e(i);return})}};mapp.Geocoder.parseAddress=function(n){return!n||n==""?{firstLine:"",secondLine:""}:(n.lastIndexOf(", USA")>0||n.lastIndexOf(", United States")>0)&&(n.lastIndexOf(", USA")>0&&(n=n.slice(0,n.lastIndexOf(", USA"))),n.lastIndexOf(", United States")>0&&(n=n.slice(0,n.lastIndexOf(", United States"))),n.indexOf(",")==n.lastIndexOf(","))?{firstLine:n,secondLine:""}:n.indexOf(",")==-1?{firstLine:n,secondLine:""}:{firstLine:n.slice(0,n.indexOf(",")),secondLine:n.slice(n.indexOf(", ")+2)}};mapp=window.mapp||{};mapp.Icons={};mapp.Icons.get=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp.Icons.getUrl=function(){return"https://maps.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png"};mapp=window.mapp||{};+function(n){mapp.InfoBox=function(t,i){var f=n.extend({disableAutoPan:!1,border:20},i),u=null,r=null,e=null,o=this;r=n('<div class="mapp-ib" tabindex="0">').appendTo(t.getMap().getDiv());e=n('<div class="mapp-ib-tip">').appendTo(t.getMap().getDiv());jQuery(window).resize(function(){o.close()});r.on("keydown",function(n){n.which==27&&o.close()});r.on("click",".mapp-close",function(){o.close()});this.getContent=function(){return r};this.setContent=function(n){r.empty().append(n)};this.open=function(n,t){u=t;this.setMap(n)};this.onAdd=function(){r.show();e.show();var t=n(":input",r);t.length?t.first().focus():r.focus();google.maps.event.trigger(o,"domready")};this.draw=function(){var l=this.getMap(),c=this.getProjection().fromLatLngToContainerPixel(u.position),t={width:n(l.getDiv()).width(),height:n(l.getDiv()).height()},v=n(".mapp-ib-body",r);if(!f.disableAutoPan){r.css({"max-height":"9999px",left:0,bottom:0,top:"auto",right:"auto"});var s=r.outerWidth(!0),h=r.outerHeight(!0),a=e.outerHeight(!0),i=c.x,o=c.y;i+s/2>t.width&&(i=t.width-s/2);i-s/2<0&&(i=s/2);o-h+u.anchorPoint.y-a<f.border&&(o=h-u.anchorPoint.y+f.border+a);o>t.height&&(o=t.height);l.panBy(c.x-i,c.y-o);h>t.height+u.anchorPoint.y-2*f.border&&(h=t.height+u.anchorPoint.y-2*f.border,r.css({"max-height":h+2}));r.css({left:i-s/2,bottom:t.height-o-u.anchorPoint.y+a});e.css({left:i,bottom:t.height-o-u.anchorPoint.y})}};this.close=function(){r.is(":visible")&&(this.setMap(null),google.maps.event.trigger(this,"closed"))};this.onRemove=function(){r.empty();r.hide();e.hide()}};mapp.InfoBox.prototype=new google.maps.OverlayView}(jQuery);mapp=window.mapp||{};+function(n){if(mapp.lib={ajax:function(t){var r=this,u,i;if(n.extend({type:"GET",cache:!1,data:null,spinner:null,callback:n.noop},t),t.cache)for(typeof mapp.lib.ajax.cache=="undefined"&&(mapp.lib.ajax.cache=[]),u=JSON.stringify(t.data),i=0;i<mapp.lib.ajax.cache.length;i++)if(mapp.lib.ajax.cache[i].hash==u){t.callback(mapp.lib.ajax.cache[i].response);return}return t.spinner&&t.spinner.show(),n.ajax({type:t.type,cache:!1,url:mappl10n.options.ajaxurl,data:t.data,success:function(n,i,u){if(t.spinner&&t.spinner.hide(),n.output){r.alert("AJAX Error\r\n"+n.output);return}if(n.status=="OK"){t.cache&&mapp.lib.ajax.cache.push({hash:JSON.stringify(t.data),response:n});t.callback&&t.callback(n,u);return}var f=typeof n=="object"?n.status:n;r.alert("AJAX ERROR\r\nResponse="+f+" TextStatus="+i+"\r\nResponseText="+u.responseText)},error:function(n,i,u){(t.spinner&&t.spinner.hide(),i!="cancel")&&typeof u!="undefined"&&u!=""&&r.alert("AJAX ERROR\r\nTextStatus="+i+"\r\nError="+u+"\r\nResponseText="+n.responseText)}})},alert:function(n){mappl10n.options.admin||mappl10n.options.debug?alert(n):window.console&&console.error(n)},jqVersionCheck:function(t){if(typeof n=="undefined"||typeof t=="undefined")return!1;for(t=t.split("."),v=n.fn.jquery.split("."),i=0;i<t.length;i++){var r=parseInt(t[i]),u=typeof v[i]!="undefined"?parseInt(v[i]):0;if(u!=r)return u>r}return!0},log:function(n){window.console&&console.error(n)},scrollTo:function(n,t){if(n&&t&&n.length&&t.length){var i=n.scrollTop(),u=n.height(),r=i+t.position().top,f=r+t.outerHeight(!0);r<i?n.scrollTop(r):f>i+u&&n.scrollTop(f-u)}},template:function(t,i){if(mapp.lib.templates=mapp.lib.templates?mapp.lib.templates:{},!mapp.lib.templates[t]){var r=mappl10n.options.templates?mappl10n.options.template[t]:n("#mapp-tmpl-"+t).html();if(r)mapp.lib.templates[t]=_.template(r.replace(/[\n\r\t]/g,""),null,{evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g});else return""}return mapp.lib.templates[t](i)}},typeof google=="undefined")return mapp.lib.alert("ERROR: Google Maps API not loaded");if(!mappl10n.options.apiKey)return mapp.lib.alert("ERROR: Google Maps API Key missing, please check MapPress settings and FAQ");n(document).ready(function(){n('script[src*="https://maps.googleapis.com/maps/api/js?v=3"]').length>1&&mapp.lib.alert("ERROR: Google Maps API key loaded multiple times, please see MapPress FAQ.")});mapp.lib.jqVersionCheck("1.7")||mapp.lib.alert("jQuery version is too old: "+n.fn.jquery);n("body").on("tabsactivate tabsshow",function(t,i){var r=i.newPanel?i.newPanel:i.panel;r&&n(".mapp-layout",r).each(function(){var i=n(this).attr("id"),t=window[i];t.resize();t.initCenter()})})}(jQuery);mapp=window.mapp||{};+function(n){mapp.Places=function(t,i){var u=this,r;if(this.sel=n(t),this.opts=n.extend({map:null,types:[]},i),r=n('<div style="display:none">').appendTo("body"),this.placesService=new google.maps.places.PlacesService(r.get(0)),this.autocompleteService=new google.maps.places.AutocompleteService,this.sel.length){this.opts.types||(this.opts.types=[]);this.autocomplete=new google.maps.places.Autocomplete(this.sel.get(0),{types:this.opts.types});this.autocomplete.bindTo("bounds",this.opts.map.getMap());this.sel.on("keydown",function(n){n.which==13&&n.preventDefault()});google.maps.event.addListener(this.autocomplete,"place_changed",function(){u.parse(this.getPlace())})}};mapp.Places.prototype={parse:function(t){var u,i=this,r,f;if(this.error(!1),r=t&&t.name?n.trim(t.name):n.trim(t),!r)return this.error(!0);if(r=="geolocate")return this.geolocate();if(r.substring(0,4)=="http"){google.maps.event.trigger(i,"search",r);return}if(t&&t.geometry){t.formatted_address&&this.set(t.formatted_address);google.maps.event.trigger(i,"search",t);return}if(f=this.parseLatLng(t),f){google.maps.event.trigger(i,"search",f);return}this.autocompleteService.getPlacePredictions({input:r,types:this.opts.types,bounds:this.opts.map.getMap().getBounds()},function(n,t){if(t!="OK"||n==null||n.length==0)return i.error(!0);u=typeof n[0].description!="undefined"?n[0].description:null;i.placesService.getDetails({placeId:n[0].place_id},function(n,t){if(t!="OK"||!n||!n.geometry)return i.error(!0);u=u?u:n.formatted_address;i.set(u);google.maps.event.trigger(i,"search",n)})})},parseLatLng:function(t){var r,i;return t instanceof google.maps.LatLng?t:t&&t.lat&&t.lng?new google.maps.LatLng(t.lat,t.lng):(r=t&&t.name?n.trim(t.name):n.trim(t),i=r.split(","),i.length==2&&!isNaN(i[0])&&!isNaN(i[1]))?new google.maps.LatLng(i[0],i[1]):null},geolocate:function(){var n=this;if(!navigator||!navigator.geolocation){alert(mappl10n.no_geolocate);return}navigator.geolocation.getCurrentPosition(function(t){n.set("");google.maps.event.trigger(n,"search",new google.maps.LatLng(t.coords.latitude,t.coords.longitude))},function(){alert(mappl10n.no_geolocate)},{timeout:1e4,enableHighAccuracy:!0,maximumAge:3e4})},set:function(n){n=n.replace(", United States of America","").replace(", USA","").replace(", United States","");this.sel.val(n);this.error(!1)},get:function(){return n.trim(this.sel.val())},focus:function(){this.sel.focus()},error:function(n){this.sel.toggleClass("mapp-error",!!n)},destroy:function(){this.autocomplete.unbindAll();google.maps.event.clearInstanceListeners(this.sel.get(0))}}}(jQuery);mapp=window.mapp||{};+function(n){mapp.Poi=function(t){var f,e,r,s,i,u,h,o;if(this.defaults={address:null,body:null,html:null,iconid:null,kml:null,map:null,overlay:null,postid:null,title:"",url:null,type:null,viewport:null},n.extend(this,this.defaults,t),t&&t.correctedAddress&&(this.address=t.correctedAddress),t.viewport&&t.viewport.sw&&t.viewport.ne&&(f=new google.maps.LatLng(t.viewport.sw.lat,t.viewport.sw.lng),e=new google.maps.LatLng(t.viewport.ne.lat,t.viewport.ne.lng),this.viewport=f.lat()==0&&f.lng()==0&&e.lat()==0&&e.lng()==0?null:new google.maps.LatLngBounds(f,e)),r=[],s=[],!t.overlay)switch(this.type){case"polygon":if(t.poly&&t.poly.paths)for(i=0;i<t.poly.paths.length;i++){for(r=[],u=0;u<t.poly.paths[i].length;u++)r.push(new google.maps.LatLng(t.poly.paths[i][u].lat,t.poly.paths[i][u].lng));s.push(new google.maps.MVCArray(r))}this.overlay=new google.maps.Polygon({paths:new google.maps.MVCArray(s)});this.setColors(t.poly);break;case"polyline":if(t.poly&&t.poly.path)for(i=0;i<t.poly.path.length;i++)r.push(new google.maps.LatLng(t.poly.path[i].lat,t.poly.path[i].lng));this.overlay=new google.maps.Polyline({path:new google.maps.MVCArray(r)});this.setColors(t.poly);break;case"circle":o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Circle({center:o,radius:parseFloat(t.poly.radius)});this.setColors(t.poly);break;case"rectangle":this.overlay=new google.maps.Rectangle({bounds:this.viewport});this.setColors(t.poly);break;case"kml":h=t.kml&&t.kml.url?t.kml.url:"";this.overlay=new google.maps.KmlLayer(h,{preserveViewport:!0,suppressInfoWindows:!0});break;case"":default:o=new google.maps.LatLng(t.point.lat,t.point.lng);this.overlay=new google.maps.Marker({position:o})}};mapp.Poi.prototype={toJSON:function(){var n={address:this.address,body:this.body,correctedAddress:this.address,iconid:this.iconid,point:null,poly:null,title:this.title,type:this.type,viewport:null},r=this.getPosition(),t,i;if(n.point={lat:r.lat(),lng:r.lng()},t=this.viewport?this.viewport:this.getBounds(),t&&(n.viewport={sw:{lat:t.getSouthWest().lat(),lng:t.getSouthWest().lng()},ne:{lat:t.getNorthEast().lat(),lng:t.getNorthEast().lng()}}),this.type=="kml"&&(n.kml={url:this.overlay.getUrl()}),this.isPoly()){n.poly=this.getColors();switch(this.type){case"circle":n.poly.radius=this.overlay.getRadius();break;case"polyline":n.poly.path=[];this.overlay.getPath().forEach(function(t){n.poly.path.push({lat:t.lat(),lng:t.lng()})});break;case"polygon":n.poly.paths=[];this.overlay.getPaths().forEach(function(t){var i=[];t.forEach(function(n){i.push({lat:n.lat(),lng:n.lng()})});n.poly.paths.push(i)});break;case"rectangle":i=this.overlay.getBounds();n.viewport={sw:{lat:i.getSouthWest().lat(),lng:i.getSouthWest().lng()},ne:{lat:i.getNorthEast().lat(),lng:i.getNorthEast().lng()}}}}return n},setMap:function(t){var i=this;if(google.maps.event.clearInstanceListeners(this.overlay),t==null){this.overlay.setMap(null);return}this.type=="kml"&&(google.maps.event.addListener(this.overlay,"defaultviewport_changed",function(){i.viewport=i.overlay.getDefaultViewport()}),google.maps.event.addListener(this.overlay,"status_changed",function(){var n=i.overlay.getStatus();n!="OK"&&mappl10n.ajaxErrors&&alert(mappl10n.kml_error+":"+n)}));this.map=t;this.overlay.setMap(t.getMap());this.setEditable(this.map.editable);this.setIcon(this.iconid);this.type||this.overlay.setTitle(n("<div>").html(this.title).text());google.maps.event.addListener(this.overlay,"click",function(n){i.open(n)})},setEditable:function(n){var t=this;this.type!="kml"&&(this.overlay.setDraggable(n),this.isPoly()&&this.overlay.setEditable(n),google.maps.event.clearListeners(this.overlay,"rightclick"),google.maps.event.clearListeners(this.overlay,"dragstart"),n&&(google.maps.event.addListener(this.overlay,"dragstart",function(){t.viewport=null;t.map.closeInfoWindow()}),(this.type=="polygon"||this.type=="polyline")&&google.maps.event.addListener(this.overlay,"rightclick",function(n){n.vertex!=null&&t.overlay.getPath().getLength()>2&&t.overlay.getPath().removeAt(n.vertex)})))},getZIndex:function(){return this.type?this.overlay.zIndex:this.overlay.getZIndex()},setZIndex:function(n){this.type?this.overlay.zIndex=n:this.overlay.setZIndex(n)},setIcon:function(n){this.type||typeof mapp.Icons=="undefined"||(this.overlay.setIcon(null),this.overlay.setIcon(mapp.Icons.get(n)),this.iconid=n)},setVisible:function(n){typeof this.overlay.setVisible!="undefined"&&this.overlay.setVisible(n)},setColors:function(n){var i={};for(var t in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})n&&typeof n[t]!="undefined"&&(i[t]=n[t]);this.overlay.setOptions(i)},getColors:function(){var t={};for(var n in{strokeColor:"",strokeOpacity:"",strokeWeight:"",fillColor:"",fillOpacity:""})typeof this.overlay[n]!="undefined"&&(t[n]=this.overlay[n]);return t},center:function(n){var t=this.map.getMap(),i=this.getBounds();if(typeof n=="number"){t.setCenter(this.getPosition());t.setZoom(n);return}i?(t.fitBounds(i),t.setCenter(this.getPosition())):(t.setCenter(this.getPosition()),t.setZoom(parseInt(mappl10n.options.poiZoom)))},open:function(n){this.map.openInfoWindow(this,n)},isPoly:function(){return jQuery.inArray(this.type,["polyline","polygon","circle","rectangle"])!=-1},getBounds:function(){var n;if(!this.map.editable&&this.viewport)return this.viewport;switch(this.type){case"polyline":n=new google.maps.LatLngBounds;this.overlay.getPath().forEach(function(t){n.extend(t)});break;case"polygon":n=new google.maps.LatLngBounds;this.overlay.getPaths().forEach(function(t){t.forEach(function(t){n.extend(t)})});break;case"rectangle":case"circle":n=this.overlay.getBounds();break;case"kml":n=this.overlay.getDefaultViewport();n=n?n:this.viewport;break;default:return this.viewport?this.viewport:null}return n},getPosition:function(n){if(!this.type)return this.overlay.getPosition();if(this.type=="kml"&&n&&n.latLng)return n.latLng;var t=this.getBounds();return t?t.getCenter():new google.maps.LatLng(0,0)},click:function(){google.maps.event.trigger(this.overlay,"click")},getAddress:function(){return this.address?this.address:this.type=="kml"?this.kml.url:this.getPosition().toUrlValue()},getAnchorPoint:function(n){return this.type=="kml"?n&&n.pixelOffset?new google.maps.Point(n.pixelOffset.width,n.pixelOffset.height):new google.maps.Point(0,0):this.type?new google.maps.Point(0,0):typeof this.overlay.anchorPoint!="undefined"?this.overlay.anchorPoint:new google.maps.Point(0,-32)}}}(jQuery);mapp=window.mapp||{};mapp.widgets={};+function(){mapp.load=function(){if(typeof mapp!="undefined"&&mapp.data)while(mapp.data.length){var n=mapp.data.pop();window[n.name]=new mapp.Map(n);window[n.name].display()}}}(jQuery);typeof mapp.Media!="undefined"?window.mappEditor=new mapp.Media:mapp.load()
js/mappress_editor.min.js CHANGED
@@ -1 +1 @@
1
- var mapp=window.mapp||{};+function(n){mapp.Media=function(){function f(r){t=r;n(".mapp-edit").empty();n(".mapp-edit").append(u.clone());var f=t.mapid;f?n("#mapp_m_mapid").text(f):n("#mapp_m_mapid").text("");n("#mapp_m_title").val(t.title);n("#mapp_m_width").val(t.width);n("#mapp_m_height").val(t.height);n("#mapp_m_edit_panel").show();n("#mapp_m_list_panel").hide();i=new mapp.Editor(t)}function e(){i.close();t=null;i=null;n("#mapp_m_edit_panel").hide();n("#mapp_m_list_panel").show()}function s(){mapp.Map.ajaxCreate("mapp0",r,function(n){f(n)})}function h(n){mapp.Map.ajaxGet(n,"mapp0",r,function(n){f(n)})}function c(n){var t='[mappress mapid="'+n+'"]';send_to_editor(t)}function o(){t&&(t.title=n.trim(n("#mapp_m_title").val()),t.width=n("#mapp_m_width").val(),t.height=n("#mapp_m_height").val(),t.ajaxSave(function(t){t.list&&n("#mapp_m_maplist").html(t.list);e()}))}function l(t){confirm(mappl10n.delete_map_prompt)&&(n("#mapp_m_maplist tr[data-mapid='"+t+"']").remove(),mapp.Map.ajaxDelete(t))}var i,t,u,a=n(".mapp-m-panel"),v=this,r;u=n(".mapp-edit").contents().detach();r={directions:"none",editable:!0,initialOpenInfo:!1};n("#mapp_m_list_panel").show();n("#mapp_m_add_map").click(function(n){s();n.preventDefault()});n("#mapp_m_maplist").on("click","tr",function(t){var i=n(this).attr("data-mapid");n(t.target).hasClass("mapp-maplist-edit")&&h(i);n(t.target).hasClass("mapp-maplist-delete")&&l(i);n(t.target).hasClass("mapp-maplist-insert")&&c(i);t.preventDefault()});n(".mapp-m-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n("#mapp_m_width").val(i);n("#mapp_m_height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){o()});n("#mapp_m_save").click(function(n){o();n.preventDefault()});n("#mapp_m_title").keydown(function(t){t.which==13&&(t.preventDefault(),n("#mapp_m_save").click())});n("#mapp_m_cancel").click(function(n){e();n.preventDefault()});n("#mapp_m_insert").click(function(n){var i=t.mapid,r='[mappress mapid="'+t.mapid+'"]';i?send_to_editor(r):alert(mappl10n.save_first);n.preventDefault()});this.getMap=function(){return t}}}(jQuery);+function(n){mapp.Editor=function(t){function o(){google.maps.event.addListener(i,"rendered",function(){n(".mapp-list",e).toggle(!!i.getPois().length);i.resize();n(".mapp-pois",e).sortable({axis:"y",cursor:"move",delay:200,update:function(){i.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})});i.display();r=new mapp.PoiEditor(i);n("#mapp_e_poi_list").on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");me.action(i,n(this).attr("data-mapp-"+i),n(this));t.preventDefault()});_geocoder=new mapp.Geocoder(i.getMap());_geocoder.autocompleteField("#mapp_e_saddr","#mapp_e_saddr_err","#mapp_e_search","#mapp_e_myloc",s);n("#mapp_e_recenter").click(function(n){i.closeInfoWindow();i.autoCenter(!0);n.preventDefault()});google.maps.event.addListener(i.getMap(),"click",function(t){n("#mapp_e_latlng").text(t.latLng.toUrlValue())})}function s(n){if(n){if(n.geometry){var t=mapp.Geocoder.parseAddress(n.formatted_address),i=n.name?n.name:t.firstLine,f=n.name?t.firstLine+", "+t.secondLine:t.secondLine,e=new mapp.Poi({address:n.formatted_address,body:f,iconid:r.lastIcon,overlay:new google.maps.Marker({position:n.geometry.location}),title:i,type:null,viewport:n.geometry.viewport?n.geometry.viewport:null});u(e,!0);return}if(n instanceof google.maps.LatLng)return h(n);alert("Internal error, unable to add location")}}function h(n){poi=new mapp.Poi({body:"",iconid:r.lastIcon,overlay:new google.maps.Marker({position:n}),title:n.toUrlValue(6)});u(poi,!0)}function u(n,t){i.closeInfoWindow();f&&f.setDrawingMode(null);i.addPoi(n);t&&n.center(!0)}var f,i=t,r,e=n(".mapp-edit");this.close=function(){i.closeInfoWindow()};o.apply(this)};mapp.PoiEditor=function(t){function h(){u=i.iw.getContent();google.maps.event.addListener(i,"open",f.render);google.maps.event.addListener(i.iw,"domready",f.domReady);google.maps.event.addListener(i.iw,"closed",function(){s()});u.on("click","[data-mapp-action]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-action");switch(r){case"poi-cancel":i.closeInfoWindow();break;case"poi-html":s();e=!1;break;case"poi-remove":f.remove();break;case"poi-save":f.save();break;case"poi-visual":o();e=!0}});u.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),f.save())});u.on("change","[data-mapp-iconpicker]",function(){r.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));this.lastIcon=r.iconid;i.renderList()});u.on("change","[data-mapp-colorpicker]",function(){var t=n("[data-mapp-colorpicker]").attr("data-mapp-color"),u=n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),f=n("[data-mapp-colorpicker]").attr("data-mapp-weight"),e=r.type=="polyline"?{strokeColor:t,strokeOpacity:u/100,strokeWeight:f}:{fillColor:t,fillOpacity:u/100,strokeColor:t,strokeWeight:f,strokeOpacity:1};r.setColors(e);i.renderList()})}function c(){typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(l(),e&&o())}function l(){var t="en",n,i;typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(n=window.tinyMCEPreInit.mceInit.content,t=typeof n.language!="undefined"?n.language:"en");i={mode:"none",height:"75px",convert_urls:!1,language:t,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)}function o(){typeof tinyMCE!="undefined"&&tinyMCE.execCommand("mceAddEditor",!1,"mapp-poi-body")}function s(){typeof tinyMCE!="undefined"&&tinyMCE.execCommand("mceRemoveEditor",!1,"mapp-poi-body")}var e=!0,i=t,r,u,f;this.lastIcon=null;f=this;this.render=function(){var t;r=i.poi;r.isPoly()&&(t=r.getColors(),t=r.type=="polyline"?{color:t.strokeColor,opacity:t.strokeOpacity*100,weight:t.strokeWeight}:{color:t.fillColor,opacity:t.fillOpacity*100,weight:t.strokeWeight});u.html(mapp.lib.template("poi-edit",{poi:r,colors:t}));n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh")};this.domReady=function(){c()};this.remove=function(){confirm(mappl10n.delete_prompt)&&(i.closeInfoWindow(),i.removePoi(r))};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();r.title=n(".mapp-poi-title").val();r.body=n(".mapp-poi-body").val();i.renderList();i.closeInfoWindow()};h.apply(this)}}(jQuery)
1
+ var mapp=window.mapp||{};+function(n){mapp.Media=function(){function f(r){t=r;n(".mapp-edit").empty();n(".mapp-edit").append(u.clone());var f=t.mapid;f?n("#mapp_m_mapid").text(f):n("#mapp_m_mapid").text("");n("#mapp_m_title").val(t.title);n("#mapp_m_width").val(t.width);n("#mapp_m_height").val(t.height);n("#mapp_m_edit_panel").show();n("#mapp_m_list_panel").hide();i=new mapp.Editor(t)}function e(){i.close();t=null;i=null;n("#mapp_m_edit_panel").hide();n("#mapp_m_list_panel").show()}function s(){mapp.Map.ajaxCreate(r,function(n){f(n)})}function h(n){mapp.Map.ajaxGet(n,r,function(n){f(n)})}function c(n){var t='[mappress mapid="'+n+'"]';send_to_editor(t)}function o(){t&&(t.title=n.trim(n("#mapp_m_title").val()),t.width=n("#mapp_m_width").val(),t.height=n("#mapp_m_height").val(),t.ajaxSave(function(t){t.list&&n("#mapp_m_maplist").html(t.list);e()}))}function l(t){confirm(mappl10n.delete_map_prompt)&&(n("#mapp_m_maplist tr[data-mapid='"+t+"']").remove(),mapp.Map.ajaxDelete(t))}var i,t,u,a=n(".mapp-m-panel"),v=this,r;u=n(".mapp-edit").contents().detach();r={directions:"none",editable:!0,initialOpenInfo:!1,name:"mapp0"};n("#mapp_m_list_panel").show();n("#mapp_m_add_map").click(function(n){s();n.preventDefault()});n("#mapp_m_maplist").on("click","tr",function(t){var i=n(this).attr("data-mapid");n(t.target).hasClass("mapp-maplist-edit")&&h(i);n(t.target).hasClass("mapp-maplist-delete")&&l(i);n(t.target).hasClass("mapp-maplist-insert")&&c(i);t.preventDefault()});n(".mapp-m-size").click(function(t){var i=n(this).data("width"),r=n(this).data("height");n("#mapp_m_width").val(i);n("#mapp_m_height").val(r);t.preventDefault()});n("#publish, #post-preview").click(function(){o()});n("#mapp_m_save").click(function(n){o();n.preventDefault()});n("#mapp_m_title").keydown(function(t){t.which==13&&(t.preventDefault(),n("#mapp_m_save").click())});n("#mapp_m_cancel").click(function(n){e();n.preventDefault()});n("#mapp_m_insert").click(function(n){var i=t.mapid,r='[mappress mapid="'+t.mapid+'"]';i?send_to_editor(r):alert(mappl10n.save_first);n.preventDefault()});this.getMap=function(){return t}}}(jQuery);+function(n){mapp.Editor=function(t){function o(){google.maps.event.addListener(i,"render-list",function(){n(".mapp-list",e).toggle(!!i.getPois().length);i.resize();n(".mapp-items",e).sortable({axis:"y",cursor:"move",delay:200,update:function(){i.sortPois(n(this).sortable("toArray",{attribute:"data-mapp-poi"}))}})});i.display();r=new mapp.PoiEditor(i);n("#mapp_e_poi_list").on("click","[data-mapp-action]",function(t){var i=n(this).attr("data-mapp-action");me.action(i,n(this).attr("data-mapp-"+i),n(this));t.preventDefault()});_geocoder=new mapp.Geocoder(i.getMap());_geocoder.autocompleteField("#mapp_e_saddr","#mapp_e_saddr_err","#mapp_e_search","#mapp_e_myloc",s);n("#mapp_e_recenter").click(function(n){i.closeInfoWindow();i.autoCenter(!0);n.preventDefault()});google.maps.event.addListener(i.getMap(),"click",function(t){n("#mapp_e_latlng").text(t.latLng.toUrlValue())})}function s(n){if(n){if(n.geometry){var t=mapp.Geocoder.parseAddress(n.formatted_address),i=n.name?n.name:t.firstLine,f=n.name?t.firstLine+", "+t.secondLine:t.secondLine,e=new mapp.Poi({address:n.formatted_address,body:f,iconid:r.lastIcon,overlay:new google.maps.Marker({position:n.geometry.location}),title:i,type:null,viewport:n.geometry.viewport?n.geometry.viewport:null});u(e,!0);return}if(n instanceof google.maps.LatLng)return h(n);alert("Internal error, unable to add location")}}function h(n){poi=new mapp.Poi({body:"",iconid:r.lastIcon,overlay:new google.maps.Marker({position:n}),title:n.toUrlValue(6)});u(poi,!0)}function u(n,t){i.closeInfoWindow();f&&f.setDrawingMode(null);i.addPoi(n);t&&n.center(!0)}var f,i=t,r,e=n(".mapp-edit");this.close=function(){i.closeInfoWindow()};o.apply(this)};mapp.PoiEditor=function(t){function h(){u=i.iw.getContent();google.maps.event.addListener(i,"open",f.render);google.maps.event.addListener(i.iw,"domready",f.domReady);google.maps.event.addListener(i.iw,"closed",function(){s()});u.on("click","[data-mapp-action]",function(t){t.preventDefault();var r=n(this).attr("data-mapp-action");switch(r){case"poi-cancel":i.closeInfoWindow();break;case"poi-html":s();e=!1;break;case"poi-remove":f.remove();break;case"poi-save":f.save();break;case"poi-visual":o();e=!0}});u.on("keydown",function(t){t.which==13&&t.target!=n("#mapp-poi-body")&&(t.preventDefault(),f.save())});u.on("change","[data-mapp-iconpicker]",function(){r.setIcon(n("[data-mapp-iconpicker]").attr("data-mapp-iconid"));this.lastIcon=r.iconid;i.renderList()});u.on("change","[data-mapp-colorpicker]",function(){var t=n("[data-mapp-colorpicker]").attr("data-mapp-color"),u=n("[data-mapp-colorpicker]").attr("data-mapp-opacity"),f=n("[data-mapp-colorpicker]").attr("data-mapp-weight"),e=r.type=="polyline"?{strokeColor:t,strokeOpacity:u/100,strokeWeight:f}:{fillColor:t,fillOpacity:u/100,strokeColor:t,strokeWeight:f,strokeOpacity:1};r.setColors(e);i.renderList()})}function c(){typeof tinyMCE!="undefined"&&typeof tinyMCE.init!="undefined"&&(l(),e&&o())}function l(){var t="en",n,i;typeof tinyMCEPreInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit!="undefined"&&typeof window.tinyMCEPreInit.mceInit.content!="undefined"&&(n=window.tinyMCEPreInit.mceInit.content,t=typeof n.language!="undefined"?n.language:"en");i={mode:"none",height:"75px",convert_urls:!1,language:t,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)}function o(){typeof tinyMCE!="undefined"&&tinyMCE.execCommand("mceAddEditor",!1,"mapp-poi-body")}function s(){typeof tinyMCE!="undefined"&&tinyMCE.execCommand("mceRemoveEditor",!1,"mapp-poi-body")}var e=!0,i=t,r,u,f;this.lastIcon=null;f=this;this.render=function(){var t;r=i.poi;r.isPoly()&&(t=r.getColors(),t=r.type=="polyline"?{color:t.strokeColor,opacity:t.strokeOpacity*100,weight:t.strokeWeight}:{color:t.fillColor,opacity:t.fillOpacity*100,weight:t.strokeWeight});u.html(mapp.lib.template("poi-edit",{poi:r,colors:t}));n("[data-mapp-iconpicker]").trigger("refresh");n("[data-mapp-colorpicker]").trigger("refresh")};this.domReady=function(){c()};this.remove=function(){confirm(mappl10n.delete_prompt)&&(i.closeInfoWindow(),i.removePoi(r))};this.save=function(){typeof tinyMCE!="undefined"&&tinyMCE.get("mapp-poi-body")&&tinyMCE.get("mapp-poi-body").save();r.title=n(".mapp-poi-title").val();r.body=n(".mapp-poi-body").val();i.renderList();i.closeInfoWindow()};h.apply(this)}}(jQuery)
js/mappress_settings.min.js CHANGED
@@ -1 +1 @@
1
- +function(n){function t(i){i=i?i:0;i==0&&n(".mapp-log").empty();mapp.lib.ajax({data:{action:"mapp_import"},callback:function(i){n(".mapp-log").append(i.data.log.join("<br/>"),"<br/>");i.data.start>=0?t(i.data.start):n(".mapp-spinner").hide()}})}n(document).ready(function(){n(".mapp-confirm").on("change",function(){var t=n(".mapp-confirm").is(":checked");n(".mapp-import").prop("disabled",!t)});n(".mapp-import").on("click",function(){n(".mapp-confirm, .mapp-import").prop("disabled",!0);t()})})}(jQuery)
1
+ +function(n){function t(i){i=i?i:0;i==0&&n(".mapp-log").empty();mapp.lib.ajax({data:{action:"mapp_import"},callback:function(i){n(".mapp-log").append(i.data.log.join("<br/>"),"<br/>");i.data.start>=0?t(i.data.start):n(".mapp-spinner").hide()}})}n(document).ready(function(){n(document).on("focus",".mapp-expand",function(){n(this).parent().width("100%");n(this).attr("rows",20)});n(document).on("blur",".mapp-expand",function(){n(this).parent().width("auto");n(this).attr("rows",1)});n(".mapp-autoicons").on("change","#mapp-autoicons-key",function(){mapp.lib.ajax({data:{action:"mapp_autoicons_form",key:n(this).val()},callback:function(t){n(".mapp-autoicons").html(t.data);new mapp.widgets.Grid(n("[data-mapp-grid]",".mapp-autoicons"))}})});jQuery("#mapp-filters tbody").sortable({handle:".mapp-handle"});n(".mapp-confirm").on("change",function(){var t=n(".mapp-confirm").is(":checked");n(".mapp-import").prop("disabled",!t)});n(".mapp-import").on("click",function(){n(".mapp-confirm, .mapp-import").prop("disabled",!0);t()})})}(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 Easy Google Maps package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: MapPress Easy Google Maps 2.46.9\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
- "POT-Creation-Date: 2017-09-28 21:07:01+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -37,7 +37,7 @@ msgid "Cancel"
37
  msgstr ""
38
 
39
  #: forms/map_editor.php:51 languages/texts.php:46 mappress_controls.php:102
40
- #: mappress_map.php:490
41
  msgid "Delete"
42
  msgstr ""
43
 
@@ -57,7 +57,7 @@ msgstr ""
57
  msgid "Map Title"
58
  msgstr ""
59
 
60
- #: forms/map_media.php:20 languages/texts.php:51 mappress_map.php:495
61
  msgid "Untitled"
62
  msgstr ""
63
 
@@ -65,7 +65,7 @@ msgstr ""
65
  msgid "Display Size"
66
  msgstr ""
67
 
68
- #: forms/map_media.php:39 languages/texts.php:19 mappress_map.php:489
69
  msgid "Insert into post"
70
  msgstr ""
71
 
@@ -97,19 +97,19 @@ msgstr ""
97
  msgid "Size"
98
  msgstr ""
99
 
100
- #: languages/texts.php:20 mappress.php:136
101
  msgid "Version"
102
  msgstr ""
103
 
104
- #: languages/texts.php:21 mappress.php:144
105
  msgid "Documentation"
106
  msgstr ""
107
 
108
- #: languages/texts.php:22 mappress.php:145
109
  msgid "Support"
110
  msgstr ""
111
 
112
- #: languages/texts.php:23 mappress.php:147
113
  msgid "Upgrade to MapPress Pro"
114
  msgstr ""
115
 
@@ -149,7 +149,7 @@ msgstr ""
149
  msgid "One of the addresses could not be found."
150
  msgstr ""
151
 
152
- #: languages/texts.php:33 mappress.php:551
153
  msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
154
  msgstr ""
155
 
@@ -157,11 +157,11 @@ msgstr ""
157
  msgid "Unknown error, unable to return directions. Status code = "
158
  msgstr ""
159
 
160
- #: languages/texts.php:35 mappress_poi.php:122 mappress_settings.php:102
161
  msgid "Directions"
162
  msgstr ""
163
 
164
- #: languages/texts.php:36 mappress.php:552
165
  msgid "Error reading KML file"
166
  msgstr ""
167
 
@@ -169,11 +169,11 @@ msgstr ""
169
  msgid "Loading..."
170
  msgstr ""
171
 
172
- #: languages/texts.php:38 mappress.php:553
173
  msgid "No matching address"
174
  msgstr ""
175
 
176
- #: languages/texts.php:39 mappress.php:554
177
  msgid "Unable to get your location"
178
  msgstr ""
179
 
@@ -185,7 +185,7 @@ msgstr ""
185
  msgid "Transit"
186
  msgstr ""
187
 
188
- #: languages/texts.php:42 pro/mappress_pro_settings.php:244
189
  #: pro/mappress_widget.php:94
190
  msgid "Zoom"
191
  msgstr ""
@@ -202,11 +202,11 @@ msgstr ""
202
  msgid "Click to change"
203
  msgstr ""
204
 
205
- #: languages/texts.php:47 mappress.php:555
206
  msgid "Delete this POI?"
207
  msgstr ""
208
 
209
- #: languages/texts.php:48 mappress.php:556
210
  msgid "Delete this map?"
211
  msgstr ""
212
 
@@ -214,7 +214,7 @@ msgstr ""
214
  msgid "Please save the map first"
215
  msgstr ""
216
 
217
- #: languages/texts.php:50 mappress.php:557
218
  msgid "Shape"
219
  msgstr ""
220
 
@@ -222,15 +222,15 @@ msgstr ""
222
  msgid "New"
223
  msgstr ""
224
 
225
- #: languages/texts.php:53 mappress_map.php:514
226
  msgid "Map not found"
227
  msgstr ""
228
 
229
- #: languages/texts.php:54 mappress_map.php:488
230
  msgid "Edit"
231
  msgstr ""
232
 
233
- #: languages/texts.php:55 mappress_map.php:362
234
  msgid "Show map"
235
  msgstr ""
236
 
@@ -254,11 +254,11 @@ msgstr ""
254
  msgid "Directions from"
255
  msgstr ""
256
 
257
- #: languages/texts.php:61 mappress_settings.php:95
258
  msgid "Basic Settings"
259
  msgstr ""
260
 
261
- #: languages/texts.php:62 mappress_settings.php:97
262
  msgid "Post types"
263
  msgstr ""
264
 
@@ -298,7 +298,7 @@ msgstr ""
298
  msgid "Map controls"
299
  msgstr ""
300
 
301
- #: languages/texts.php:72 mappress_settings.php:100
302
  msgid "Map Settings"
303
  msgstr ""
304
 
@@ -306,15 +306,15 @@ msgstr ""
306
  msgid "Map links"
307
  msgstr ""
308
 
309
- #: languages/texts.php:74 mappress_settings.php:101
310
  msgid "Map alignment"
311
  msgstr ""
312
 
313
- #: languages/texts.php:75 mappress_settings.php:106 mappress_settings.php:234
314
  msgid "Open first POI"
315
  msgstr ""
316
 
317
- #: languages/texts.php:76 mappress_settings.php:104
318
  msgid "POI Settings"
319
  msgstr ""
320
 
@@ -326,39 +326,39 @@ msgstr ""
326
  msgid "Tooltips"
327
  msgstr ""
328
 
329
- #: languages/texts.php:79 mappress_settings.php:105
330
  msgid "Default zoom"
331
  msgstr ""
332
 
333
- #: languages/texts.php:80 mappress_settings.php:109
334
  msgid "Mashups"
335
  msgstr ""
336
 
337
- #: languages/texts.php:81 mappress_settings.php:110
338
  msgid "Icons"
339
  msgstr ""
340
 
341
- #: languages/texts.php:82 mappress_settings.php:111
342
  msgid "Styled Maps"
343
  msgstr ""
344
 
345
- #: languages/texts.php:83 mappress_settings.php:112
346
  msgid "Geocoding"
347
  msgstr ""
348
 
349
- #: languages/texts.php:84 mappress_settings.php:116
350
  msgid "Localization"
351
  msgstr ""
352
 
353
- #: languages/texts.php:85 mappress_settings.php:117 mappress_settings.php:238
354
  msgid "Language"
355
  msgstr ""
356
 
357
- #: languages/texts.php:86 mappress_settings.php:118
358
  msgid "Country"
359
  msgstr ""
360
 
361
- #: languages/texts.php:87 mappress_settings.php:119
362
  msgid "Directions server"
363
  msgstr ""
364
 
@@ -366,15 +366,15 @@ msgstr ""
366
  msgid "Directions units"
367
  msgstr ""
368
 
369
- #: languages/texts.php:89 mappress_settings.php:121
370
  msgid "Miscellaneous"
371
  msgstr ""
372
 
373
- #: languages/texts.php:90 mappress_settings.php:122
374
  msgid "Map sizes"
375
  msgstr ""
376
 
377
- #: languages/texts.php:91 mappress_settings.php:123
378
  msgid "Scripts"
379
  msgstr ""
380
 
@@ -394,16 +394,16 @@ msgstr ""
394
  msgid "Recenter maps when window is resized"
395
  msgstr ""
396
 
397
- #: languages/texts.php:96 mappress_settings.php:189
398
- #: pro/mappress_pro_settings.php:111
399
  msgid "more info"
400
  msgstr ""
401
 
402
- #: languages/texts.php:97 mappress_settings.php:190
403
  msgid "Required to display maps"
404
  msgstr ""
405
 
406
- #: languages/texts.php:98 mappress_settings.php:225 mappress_settings.php:228
407
  msgid "Output scripts in footer"
408
  msgstr ""
409
 
@@ -451,7 +451,7 @@ msgstr ""
451
  msgid "Use a specific %s for map controls and geocoding"
452
  msgstr ""
453
 
454
- #: languages/texts.php:110 mappress_settings.php:178
455
  msgid "Default"
456
  msgstr ""
457
 
@@ -539,15 +539,15 @@ msgstr ""
539
  msgid "Hybrid"
540
  msgstr ""
541
 
542
- #: languages/texts.php:132 mappress_settings.php:211
543
  msgid "Google"
544
  msgstr ""
545
 
546
- #: languages/texts.php:133 mappress_settings.php:212
547
  msgid "Inline"
548
  msgstr ""
549
 
550
- #: languages/texts.php:134 mappress_settings.php:197 mappress_settings.php:213
551
  msgid "None"
552
  msgstr ""
553
 
@@ -571,27 +571,27 @@ msgstr ""
571
  msgid "Default alignment"
572
  msgstr ""
573
 
574
- #: languages/texts.php:140 mappress_settings.php:179
575
  msgid "Center"
576
  msgstr ""
577
 
578
- #: languages/texts.php:141 mappress_settings.php:180
579
  msgid "Left"
580
  msgstr ""
581
 
582
- #: languages/texts.php:142 mappress_settings.php:181
583
  msgid "Right"
584
  msgstr ""
585
 
586
- #: languages/texts.php:143 mappress_settings.php:246
587
  msgid "Default zoom for POIs entered by lat/lng"
588
  msgstr ""
589
 
590
- #: languages/texts.php:144 mappress_settings.php:195
591
  msgid "Top of post"
592
  msgstr ""
593
 
594
- #: languages/texts.php:145 mappress_settings.php:196
595
  msgid "Bottom of post"
596
  msgstr ""
597
 
@@ -603,7 +603,7 @@ msgstr ""
603
  msgid "Load %s"
604
  msgstr ""
605
 
606
- #: languages/texts.php:148 mappress_settings.php:256
607
  msgid "Default size"
608
  msgstr ""
609
 
@@ -627,11 +627,11 @@ msgstr ""
627
  msgid "%s on WordPress.org"
628
  msgstr ""
629
 
630
- #: languages/texts.php:154 mappress_settings.php:290
631
  msgid "Thanks for your support!"
632
  msgstr ""
633
 
634
- #: languages/texts.php:155 mappress_settings.php:297
635
  msgid "Easy Google Maps"
636
  msgstr ""
637
 
@@ -639,27 +639,27 @@ msgstr ""
639
  msgid "Like this plugin?"
640
  msgstr ""
641
 
642
- #: languages/texts.php:157 mappress_settings.php:309
643
  msgid "Sample Map"
644
  msgstr ""
645
 
646
- #: languages/texts.php:158 mappress_settings.php:330
647
  msgid "Save Changes"
648
  msgstr ""
649
 
650
- #: languages/texts.php:159 mappress_settings.php:331
651
  msgid "Reset Defaults"
652
  msgstr ""
653
 
654
- #: languages/texts.php:160 mappress.php:130
655
  msgid "Settings"
656
  msgstr ""
657
 
658
- #: languages/texts.php:161 pro/mappress_updater.php:133
659
  msgid "download it now"
660
  msgstr ""
661
 
662
- #: languages/texts.php:162 pro/mappress_updater.php:137
663
  msgid "A PRO Version update is available for manual installation: %s"
664
  msgstr ""
665
 
@@ -760,25 +760,25 @@ msgstr ""
760
  msgid "Optional - for geocoding only"
761
  msgstr ""
762
 
763
- #: languages/texts.php:187 pro/mappress_filter.php:57
764
- #: pro/mappress_filter.php:105 pro/mappress_pro_settings.php:124
765
  msgid "Post type"
766
  msgstr ""
767
 
768
- #: languages/texts.php:188 pro/mappress_pro_settings.php:170
769
  msgid "Key"
770
  msgstr ""
771
 
772
- #: languages/texts.php:189 pro/mappress_pro_settings.php:131
773
  msgid "Value"
774
  msgstr ""
775
 
776
- #: languages/texts.php:190 pro/mappress_pro_settings.php:131
777
- #: pro/mappress_pro_settings.php:244
778
  msgid "Icon"
779
  msgstr ""
780
 
781
- #: languages/texts.php:191 pro/mappress_pro_settings.php:266
782
  msgid "Show a list of POIs under each map"
783
  msgstr ""
784
 
@@ -787,16 +787,16 @@ msgid "Show the POI list as a sortable %s"
787
  msgstr ""
788
 
789
  #: languages/texts.php:193 pro/mappress_pro_settings.php:33
790
- #: pro/mappress_pro_settings.php:236
791
  msgid "POI title"
792
  msgstr ""
793
 
794
- #: languages/texts.php:194 pro/mappress_pro_settings.php:236
795
  msgid "Post title"
796
  msgstr ""
797
 
798
  #: languages/texts.php:195 pro/mappress_pro_settings.php:34
799
- #: pro/mappress_pro_settings.php:226
800
  msgid "POI body"
801
  msgstr ""
802
 
@@ -804,7 +804,7 @@ msgstr ""
804
  msgid "Address"
805
  msgstr ""
806
 
807
- #: languages/texts.php:197 pro/mappress_pro_settings.php:226
808
  msgid "Post excerpt"
809
  msgstr ""
810
 
@@ -820,15 +820,15 @@ msgstr ""
820
  msgid "Go directly to the post"
821
  msgstr ""
822
 
823
- #: languages/texts.php:201 pro/mappress_pro_settings.php:201
824
  msgid "Google InfoWindow"
825
  msgstr ""
826
 
827
- #: languages/texts.php:202 pro/mappress_pro_settings.php:202
828
  msgid "InfoBox"
829
  msgstr ""
830
 
831
- #: languages/texts.php:203 pro/mappress_pro_settings.php:315
832
  msgid "Show featured image thumbnails in mashup POIs"
833
  msgstr ""
834
 
@@ -852,11 +852,11 @@ msgstr ""
852
  msgid "Enter JSON for %s from Google's %s"
853
  msgstr ""
854
 
855
- #: languages/texts.php:209 pro/mappress_pro_settings.php:290
856
  msgid "Style name"
857
  msgstr ""
858
 
859
- #: languages/texts.php:210 pro/mappress_pro_settings.php:276
860
  msgid "No styles have been defined yet"
861
  msgstr ""
862
 
@@ -884,19 +884,19 @@ msgstr ""
884
  msgid "Address Line 6"
885
  msgstr ""
886
 
887
- #: languages/texts.php:217 pro/mappress_pro_settings.php:244
888
  msgid "Latitude"
889
  msgstr ""
890
 
891
- #: languages/texts.php:218 pro/mappress_pro_settings.php:244
892
  msgid "Longitude"
893
  msgstr ""
894
 
895
- #: languages/texts.php:219 pro/mappress_pro_settings.php:244
896
  msgid "Title"
897
  msgstr ""
898
 
899
- #: languages/texts.php:220 pro/mappress_pro_settings.php:244
900
  msgid "Body"
901
  msgstr ""
902
 
@@ -908,8 +908,8 @@ msgstr ""
908
  msgid "Map"
909
  msgstr ""
910
 
911
- #: languages/texts.php:223 pro/mappress_filter.php:92
912
- #: pro/mappress_pro_settings.php:249
913
  msgid "Custom Field"
914
  msgstr ""
915
 
@@ -917,15 +917,15 @@ msgstr ""
917
  msgid "Overwrite existing maps when updating"
918
  msgstr ""
919
 
920
- #: languages/texts.php:225 pro/mappress_pro_settings.php:185
921
  msgid "Permanently resize existing maps"
922
  msgstr ""
923
 
924
- #: languages/texts.php:226 pro/mappress_pro_settings.php:187
925
  msgid "from %s to %s"
926
  msgstr ""
927
 
928
- #: languages/texts.php:227 pro/mappress_pro_settings.php:188
929
  msgid "Force Resize"
930
  msgstr ""
931
 
@@ -1025,63 +1025,75 @@ msgstr ""
1025
  msgid "Chris Richardson"
1026
  msgstr ""
1027
 
1028
- #: mappress_settings.php:93
 
 
 
 
 
 
 
 
1029
  msgid "License"
1030
  msgstr ""
1031
 
1032
- #: mappress_settings.php:96
1033
  msgid "Google API key"
1034
  msgstr ""
1035
 
1036
- #: mappress_settings.php:98
1037
  msgid "Automatic display"
1038
  msgstr ""
1039
 
1040
- #: mappress_settings.php:113
1041
  msgid "Google Server API key"
1042
  msgstr ""
1043
 
1044
- #: mappress_settings.php:204
1045
  msgid "Country code"
1046
  msgstr ""
1047
 
1048
- #: mappress_settings.php:206
1049
  msgid "%s for searching"
1050
  msgstr ""
1051
 
1052
- #: mappress_settings.php:226
1053
- msgid "disabled for Jetpack Infinite Scroll"
1054
  msgstr ""
1055
 
1056
- #: mappress_settings.php:229
1057
  msgid "disable if maps are output using AJAX"
1058
  msgstr ""
1059
 
1060
- #: mappress_settings.php:240
1061
  msgid "%s for map controls"
1062
  msgstr ""
1063
 
1064
- #: mappress_settings.php:256
1065
  msgid "Width (px or %)"
1066
  msgstr ""
1067
 
1068
- #: mappress_settings.php:256
1069
  msgid "Height (px)"
1070
  msgstr ""
1071
 
1072
- #: mappress_settings.php:287
1073
  msgid "rate it 5 Stars"
1074
  msgstr ""
1075
 
1076
- #: mappress_settings.php:289
1077
  msgid "Please %s on WordPress.org."
1078
  msgstr ""
1079
 
1080
- #: pro/mappress_filter.php:92
 
 
 
 
1081
  msgid "Taxonomy"
1082
  msgstr ""
1083
 
1084
- #: pro/mappress_filter.php:92
1085
  msgid "Post field"
1086
  msgstr ""
1087
 
@@ -1101,10 +1113,6 @@ msgstr ""
1101
  msgid "Icon directory"
1102
  msgstr ""
1103
 
1104
- #: pro/mappress_pro_settings.php:32 templates/map-header.php:2
1105
- msgid "Filter"
1106
- msgstr ""
1107
-
1108
  #: pro/mappress_pro_settings.php:35
1109
  msgid "POI click"
1110
  msgstr ""
@@ -1125,87 +1133,87 @@ msgstr ""
1125
  msgid "Automatic updates"
1126
  msgstr ""
1127
 
1128
- #: pro/mappress_pro_settings.php:112
1129
  msgid "API key secured by IP address for geocoding (optional)"
1130
  msgstr ""
1131
 
1132
- #: pro/mappress_pro_settings.php:146
1133
- msgid "Enable settings for automatic updates (experimental)"
1134
  msgstr ""
1135
 
1136
- #: pro/mappress_pro_settings.php:150
1137
- msgid "Enable automatic updates for beta versions"
1138
  msgstr ""
1139
 
1140
- #: pro/mappress_pro_settings.php:163
1141
  msgid "Checkboxes"
1142
  msgstr ""
1143
 
1144
- #: pro/mappress_pro_settings.php:163
1145
  msgid "Select"
1146
  msgstr ""
1147
 
1148
- #: pro/mappress_pro_settings.php:170
1149
  msgid "Format"
1150
  msgstr ""
1151
 
1152
- #: pro/mappress_pro_settings.php:208
1153
- msgid "Enter your license key"
1154
  msgstr ""
1155
 
1156
- #: pro/mappress_pro_settings.php:218
1157
  msgid "Communication error, please try again later"
1158
  msgstr ""
1159
 
1160
- #: pro/mappress_pro_settings.php:220
1161
  msgid "Active"
1162
  msgstr ""
1163
 
1164
- #: pro/mappress_pro_settings.php:222
1165
  msgid "License is invalid or expired"
1166
  msgstr ""
1167
 
1168
- #: pro/mappress_pro_settings.php:231
1169
  msgid "Open POI"
1170
  msgstr ""
1171
 
1172
- #: pro/mappress_pro_settings.php:231
1173
  msgid "Go to post"
1174
  msgstr ""
1175
 
1176
- #: pro/mappress_pro_settings.php:243
1177
  msgid "Address line "
1178
  msgstr ""
1179
 
1180
- #: pro/mappress_pro_settings.php:249
1181
  msgid "Map Field"
1182
  msgstr ""
1183
 
1184
- #: pro/mappress_pro_settings.php:262
1185
  msgid "Overwrite maps when posts are saved"
1186
  msgstr ""
1187
 
1188
- #: pro/mappress_pro_settings.php:270
1189
  msgid "Sort POI list by title"
1190
  msgstr ""
1191
 
1192
- #: pro/mappress_pro_settings.php:285
1193
  msgid "Styled Maps Wizard"
1194
  msgstr ""
1195
 
1196
- #: pro/mappress_pro_settings.php:286
1197
  msgid "JSON from Google's %s"
1198
  msgstr ""
1199
 
1200
- #: pro/mappress_pro_settings.php:307
1201
  msgid "or "
1202
  msgstr ""
1203
 
1204
- #: pro/mappress_updater.php:104
1205
  msgid "Communication error"
1206
  msgstr ""
1207
 
1208
- #: pro/mappress_updater.php:107
1209
  msgid "JSON error"
1210
  msgstr ""
1211
 
2
  # This file is distributed under the same license as the MapPress Easy Google Maps package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: MapPress Easy Google Maps 2.47\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mappress-google-maps-for-wordpress\n"
7
+ "POT-Creation-Date: 2017-10-16 15:32:34+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
37
  msgstr ""
38
 
39
  #: forms/map_editor.php:51 languages/texts.php:46 mappress_controls.php:102
40
+ #: mappress_map.php:599
41
  msgid "Delete"
42
  msgstr ""
43
 
57
  msgid "Map Title"
58
  msgstr ""
59
 
60
+ #: forms/map_media.php:20 languages/texts.php:51 mappress_map.php:604
61
  msgid "Untitled"
62
  msgstr ""
63
 
65
  msgid "Display Size"
66
  msgstr ""
67
 
68
+ #: forms/map_media.php:39 languages/texts.php:19 mappress_map.php:598
69
  msgid "Insert into post"
70
  msgstr ""
71
 
97
  msgid "Size"
98
  msgstr ""
99
 
100
+ #: languages/texts.php:20 mappress.php:134
101
  msgid "Version"
102
  msgstr ""
103
 
104
+ #: languages/texts.php:21 mappress.php:142
105
  msgid "Documentation"
106
  msgstr ""
107
 
108
+ #: languages/texts.php:22 mappress.php:143
109
  msgid "Support"
110
  msgstr ""
111
 
112
+ #: languages/texts.php:23 mappress.php:145
113
  msgid "Upgrade to MapPress Pro"
114
  msgstr ""
115
 
149
  msgid "One of the addresses could not be found."
150
  msgstr ""
151
 
152
+ #: languages/texts.php:33 mappress.php:562
153
  msgid "Google cannot return directions between those addresses. There is no route between them or the routing information is not available."
154
  msgstr ""
155
 
157
  msgid "Unknown error, unable to return directions. Status code = "
158
  msgstr ""
159
 
160
+ #: languages/texts.php:35 mappress_poi.php:122 mappress_settings.php:89
161
  msgid "Directions"
162
  msgstr ""
163
 
164
+ #: languages/texts.php:36 mappress.php:563
165
  msgid "Error reading KML file"
166
  msgstr ""
167
 
169
  msgid "Loading..."
170
  msgstr ""
171
 
172
+ #: languages/texts.php:38 mappress.php:564
173
  msgid "No matching address"
174
  msgstr ""
175
 
176
+ #: languages/texts.php:39 mappress.php:565
177
  msgid "Unable to get your location"
178
  msgstr ""
179
 
185
  msgid "Transit"
186
  msgstr ""
187
 
188
+ #: languages/texts.php:42 pro/mappress_pro_settings.php:243
189
  #: pro/mappress_widget.php:94
190
  msgid "Zoom"
191
  msgstr ""
202
  msgid "Click to change"
203
  msgstr ""
204
 
205
+ #: languages/texts.php:47 mappress.php:566
206
  msgid "Delete this POI?"
207
  msgstr ""
208
 
209
+ #: languages/texts.php:48 mappress.php:567
210
  msgid "Delete this map?"
211
  msgstr ""
212
 
214
  msgid "Please save the map first"
215
  msgstr ""
216
 
217
+ #: languages/texts.php:50 mappress.php:568
218
  msgid "Shape"
219
  msgstr ""
220
 
222
  msgid "New"
223
  msgstr ""
224
 
225
+ #: languages/texts.php:53 mappress_map.php:179
226
  msgid "Map not found"
227
  msgstr ""
228
 
229
+ #: languages/texts.php:54 mappress_map.php:597
230
  msgid "Edit"
231
  msgstr ""
232
 
233
+ #: languages/texts.php:55 mappress_map.php:452
234
  msgid "Show map"
235
  msgstr ""
236
 
254
  msgid "Directions from"
255
  msgstr ""
256
 
257
+ #: languages/texts.php:61 mappress_settings.php:82
258
  msgid "Basic Settings"
259
  msgstr ""
260
 
261
+ #: languages/texts.php:62 mappress_settings.php:84
262
  msgid "Post types"
263
  msgstr ""
264
 
298
  msgid "Map controls"
299
  msgstr ""
300
 
301
+ #: languages/texts.php:72 mappress_settings.php:87
302
  msgid "Map Settings"
303
  msgstr ""
304
 
306
  msgid "Map links"
307
  msgstr ""
308
 
309
+ #: languages/texts.php:74 mappress_settings.php:88
310
  msgid "Map alignment"
311
  msgstr ""
312
 
313
+ #: languages/texts.php:75 mappress_settings.php:93 mappress_settings.php:221
314
  msgid "Open first POI"
315
  msgstr ""
316
 
317
+ #: languages/texts.php:76 mappress_settings.php:91
318
  msgid "POI Settings"
319
  msgstr ""
320
 
326
  msgid "Tooltips"
327
  msgstr ""
328
 
329
+ #: languages/texts.php:79 mappress_settings.php:92
330
  msgid "Default zoom"
331
  msgstr ""
332
 
333
+ #: languages/texts.php:80 mappress_settings.php:96
334
  msgid "Mashups"
335
  msgstr ""
336
 
337
+ #: languages/texts.php:81 mappress_settings.php:97
338
  msgid "Icons"
339
  msgstr ""
340
 
341
+ #: languages/texts.php:82 mappress_settings.php:98
342
  msgid "Styled Maps"
343
  msgstr ""
344
 
345
+ #: languages/texts.php:83 mappress_settings.php:99
346
  msgid "Geocoding"
347
  msgstr ""
348
 
349
+ #: languages/texts.php:84 mappress_settings.php:103
350
  msgid "Localization"
351
  msgstr ""
352
 
353
+ #: languages/texts.php:85 mappress_settings.php:104 mappress_settings.php:225
354
  msgid "Language"
355
  msgstr ""
356
 
357
+ #: languages/texts.php:86 mappress_settings.php:105
358
  msgid "Country"
359
  msgstr ""
360
 
361
+ #: languages/texts.php:87 mappress_settings.php:106
362
  msgid "Directions server"
363
  msgstr ""
364
 
366
  msgid "Directions units"
367
  msgstr ""
368
 
369
+ #: languages/texts.php:89 mappress_settings.php:108
370
  msgid "Miscellaneous"
371
  msgstr ""
372
 
373
+ #: languages/texts.php:90 mappress_settings.php:109
374
  msgid "Map sizes"
375
  msgstr ""
376
 
377
+ #: languages/texts.php:91 mappress_settings.php:110
378
  msgid "Scripts"
379
  msgstr ""
380
 
394
  msgid "Recenter maps when window is resized"
395
  msgstr ""
396
 
397
+ #: languages/texts.php:96 mappress_settings.php:176
398
+ #: pro/mappress_pro_settings.php:110
399
  msgid "more info"
400
  msgstr ""
401
 
402
+ #: languages/texts.php:97 mappress_settings.php:177
403
  msgid "Required to display maps"
404
  msgstr ""
405
 
406
+ #: languages/texts.php:98 mappress_settings.php:212 mappress_settings.php:215
407
  msgid "Output scripts in footer"
408
  msgstr ""
409
 
451
  msgid "Use a specific %s for map controls and geocoding"
452
  msgstr ""
453
 
454
+ #: languages/texts.php:110 mappress_settings.php:165
455
  msgid "Default"
456
  msgstr ""
457
 
539
  msgid "Hybrid"
540
  msgstr ""
541
 
542
+ #: languages/texts.php:132 mappress_settings.php:198
543
  msgid "Google"
544
  msgstr ""
545
 
546
+ #: languages/texts.php:133 mappress_settings.php:199
547
  msgid "Inline"
548
  msgstr ""
549
 
550
+ #: languages/texts.php:134 mappress_settings.php:184 mappress_settings.php:200
551
  msgid "None"
552
  msgstr ""
553
 
571
  msgid "Default alignment"
572
  msgstr ""
573
 
574
+ #: languages/texts.php:140 mappress_settings.php:166
575
  msgid "Center"
576
  msgstr ""
577
 
578
+ #: languages/texts.php:141 mappress_settings.php:167
579
  msgid "Left"
580
  msgstr ""
581
 
582
+ #: languages/texts.php:142 mappress_settings.php:168
583
  msgid "Right"
584
  msgstr ""
585
 
586
+ #: languages/texts.php:143 mappress_settings.php:233
587
  msgid "Default zoom for POIs entered by lat/lng"
588
  msgstr ""
589
 
590
+ #: languages/texts.php:144 mappress_settings.php:182
591
  msgid "Top of post"
592
  msgstr ""
593
 
594
+ #: languages/texts.php:145 mappress_settings.php:183
595
  msgid "Bottom of post"
596
  msgstr ""
597
 
603
  msgid "Load %s"
604
  msgstr ""
605
 
606
+ #: languages/texts.php:148 mappress_settings.php:243
607
  msgid "Default size"
608
  msgstr ""
609
 
627
  msgid "%s on WordPress.org"
628
  msgstr ""
629
 
630
+ #: languages/texts.php:154 mappress_settings.php:277
631
  msgid "Thanks for your support!"
632
  msgstr ""
633
 
634
+ #: languages/texts.php:155 mappress_settings.php:284
635
  msgid "Easy Google Maps"
636
  msgstr ""
637
 
639
  msgid "Like this plugin?"
640
  msgstr ""
641
 
642
+ #: languages/texts.php:157 mappress_settings.php:296
643
  msgid "Sample Map"
644
  msgstr ""
645
 
646
+ #: languages/texts.php:158 mappress_settings.php:318
647
  msgid "Save Changes"
648
  msgstr ""
649
 
650
+ #: languages/texts.php:159 mappress_settings.php:319
651
  msgid "Reset Defaults"
652
  msgstr ""
653
 
654
+ #: languages/texts.php:160 mappress.php:128
655
  msgid "Settings"
656
  msgstr ""
657
 
658
+ #: languages/texts.php:161 pro/mappress_updater.php:139
659
  msgid "download it now"
660
  msgstr ""
661
 
662
+ #: languages/texts.php:162 pro/mappress_updater.php:143
663
  msgid "A PRO Version update is available for manual installation: %s"
664
  msgstr ""
665
 
760
  msgid "Optional - for geocoding only"
761
  msgstr ""
762
 
763
+ #: languages/texts.php:187 pro/mappress_filter.php:72
764
+ #: pro/mappress_filter.php:120 pro/mappress_pro_settings.php:123
765
  msgid "Post type"
766
  msgstr ""
767
 
768
+ #: languages/texts.php:188 pro/mappress_pro_settings.php:169
769
  msgid "Key"
770
  msgstr ""
771
 
772
+ #: languages/texts.php:189 pro/mappress_pro_settings.php:130
773
  msgid "Value"
774
  msgstr ""
775
 
776
+ #: languages/texts.php:190 pro/mappress_pro_settings.php:130
777
+ #: pro/mappress_pro_settings.php:243
778
  msgid "Icon"
779
  msgstr ""
780
 
781
+ #: languages/texts.php:191 pro/mappress_pro_settings.php:265
782
  msgid "Show a list of POIs under each map"
783
  msgstr ""
784
 
787
  msgstr ""
788
 
789
  #: languages/texts.php:193 pro/mappress_pro_settings.php:33
790
+ #: pro/mappress_pro_settings.php:235
791
  msgid "POI title"
792
  msgstr ""
793
 
794
+ #: languages/texts.php:194 pro/mappress_pro_settings.php:235
795
  msgid "Post title"
796
  msgstr ""
797
 
798
  #: languages/texts.php:195 pro/mappress_pro_settings.php:34
799
+ #: pro/mappress_pro_settings.php:225
800
  msgid "POI body"
801
  msgstr ""
802
 
804
  msgid "Address"
805
  msgstr ""
806
 
807
+ #: languages/texts.php:197 pro/mappress_pro_settings.php:225
808
  msgid "Post excerpt"
809
  msgstr ""
810
 
820
  msgid "Go directly to the post"
821
  msgstr ""
822
 
823
+ #: languages/texts.php:201 pro/mappress_pro_settings.php:200
824
  msgid "Google InfoWindow"
825
  msgstr ""
826
 
827
+ #: languages/texts.php:202 pro/mappress_pro_settings.php:201
828
  msgid "InfoBox"
829
  msgstr ""
830
 
831
+ #: languages/texts.php:203 pro/mappress_pro_settings.php:314
832
  msgid "Show featured image thumbnails in mashup POIs"
833
  msgstr ""
834
 
852
  msgid "Enter JSON for %s from Google's %s"
853
  msgstr ""
854
 
855
+ #: languages/texts.php:209 pro/mappress_pro_settings.php:289
856
  msgid "Style name"
857
  msgstr ""
858
 
859
+ #: languages/texts.php:210 pro/mappress_pro_settings.php:275
860
  msgid "No styles have been defined yet"
861
  msgstr ""
862
 
884
  msgid "Address Line 6"
885
  msgstr ""
886
 
887
+ #: languages/texts.php:217 pro/mappress_pro_settings.php:243
888
  msgid "Latitude"
889
  msgstr ""
890
 
891
+ #: languages/texts.php:218 pro/mappress_pro_settings.php:243
892
  msgid "Longitude"
893
  msgstr ""
894
 
895
+ #: languages/texts.php:219 pro/mappress_pro_settings.php:243
896
  msgid "Title"
897
  msgstr ""
898
 
899
+ #: languages/texts.php:220 pro/mappress_pro_settings.php:243
900
  msgid "Body"
901
  msgstr ""
902
 
908
  msgid "Map"
909
  msgstr ""
910
 
911
+ #: languages/texts.php:223 pro/mappress_filter.php:107
912
+ #: pro/mappress_pro_settings.php:248
913
  msgid "Custom Field"
914
  msgstr ""
915
 
917
  msgid "Overwrite existing maps when updating"
918
  msgstr ""
919
 
920
+ #: languages/texts.php:225 pro/mappress_pro_settings.php:184
921
  msgid "Permanently resize existing maps"
922
  msgstr ""
923
 
924
+ #: languages/texts.php:226 pro/mappress_pro_settings.php:186
925
  msgid "from %s to %s"
926
  msgstr ""
927
 
928
+ #: languages/texts.php:227 pro/mappress_pro_settings.php:187
929
  msgid "Force Resize"
930
  msgstr ""
931
 
1025
  msgid "Chris Richardson"
1026
  msgstr ""
1027
 
1028
+ #: mappress_map.php:99
1029
+ msgid "Insert Map"
1030
+ msgstr ""
1031
+
1032
+ #: mappress_map.php:423 pro/mappress_pro_settings.php:32
1033
+ msgid "Filter"
1034
+ msgstr ""
1035
+
1036
+ #: mappress_settings.php:80
1037
  msgid "License"
1038
  msgstr ""
1039
 
1040
+ #: mappress_settings.php:83
1041
  msgid "Google API key"
1042
  msgstr ""
1043
 
1044
+ #: mappress_settings.php:85
1045
  msgid "Automatic display"
1046
  msgstr ""
1047
 
1048
+ #: mappress_settings.php:100
1049
  msgid "Google Server API key"
1050
  msgstr ""
1051
 
1052
+ #: mappress_settings.php:191
1053
  msgid "Country code"
1054
  msgstr ""
1055
 
1056
+ #: mappress_settings.php:193
1057
  msgid "%s for searching"
1058
  msgstr ""
1059
 
1060
+ #: mappress_settings.php:213
1061
+ msgid "Disabled because Jetpack Infinite Scroll is active"
1062
  msgstr ""
1063
 
1064
+ #: mappress_settings.php:216
1065
  msgid "disable if maps are output using AJAX"
1066
  msgstr ""
1067
 
1068
+ #: mappress_settings.php:227
1069
  msgid "%s for map controls"
1070
  msgstr ""
1071
 
1072
+ #: mappress_settings.php:243
1073
  msgid "Width (px or %)"
1074
  msgstr ""
1075
 
1076
+ #: mappress_settings.php:243
1077
  msgid "Height (px)"
1078
  msgstr ""
1079
 
1080
+ #: mappress_settings.php:274
1081
  msgid "rate it 5 Stars"
1082
  msgstr ""
1083
 
1084
+ #: mappress_settings.php:276
1085
  msgid "Please %s on WordPress.org."
1086
  msgstr ""
1087
 
1088
+ #: mappress_settings.php:301
1089
+ msgid "MapPress"
1090
+ msgstr ""
1091
+
1092
+ #: pro/mappress_filter.php:107
1093
  msgid "Taxonomy"
1094
  msgstr ""
1095
 
1096
+ #: pro/mappress_filter.php:107
1097
  msgid "Post field"
1098
  msgstr ""
1099
 
1113
  msgid "Icon directory"
1114
  msgstr ""
1115
 
 
 
 
 
1116
  #: pro/mappress_pro_settings.php:35
1117
  msgid "POI click"
1118
  msgstr ""
1133
  msgid "Automatic updates"
1134
  msgstr ""
1135
 
1136
+ #: pro/mappress_pro_settings.php:111
1137
  msgid "API key secured by IP address for geocoding (optional)"
1138
  msgstr ""
1139
 
1140
+ #: pro/mappress_pro_settings.php:145
1141
+ msgid "Enable settings for automatic updates"
1142
  msgstr ""
1143
 
1144
+ #: pro/mappress_pro_settings.php:149
1145
+ msgid "Enable updates for beta versions"
1146
  msgstr ""
1147
 
1148
+ #: pro/mappress_pro_settings.php:162
1149
  msgid "Checkboxes"
1150
  msgstr ""
1151
 
1152
+ #: pro/mappress_pro_settings.php:162
1153
  msgid "Select"
1154
  msgstr ""
1155
 
1156
+ #: pro/mappress_pro_settings.php:169
1157
  msgid "Format"
1158
  msgstr ""
1159
 
1160
+ #: pro/mappress_pro_settings.php:207
1161
+ msgid "Enter license to enable automatic updates"
1162
  msgstr ""
1163
 
1164
+ #: pro/mappress_pro_settings.php:217
1165
  msgid "Communication error, please try again later"
1166
  msgstr ""
1167
 
1168
+ #: pro/mappress_pro_settings.php:219
1169
  msgid "Active"
1170
  msgstr ""
1171
 
1172
+ #: pro/mappress_pro_settings.php:221
1173
  msgid "License is invalid or expired"
1174
  msgstr ""
1175
 
1176
+ #: pro/mappress_pro_settings.php:230
1177
  msgid "Open POI"
1178
  msgstr ""
1179
 
1180
+ #: pro/mappress_pro_settings.php:230
1181
  msgid "Go to post"
1182
  msgstr ""
1183
 
1184
+ #: pro/mappress_pro_settings.php:242
1185
  msgid "Address line "
1186
  msgstr ""
1187
 
1188
+ #: pro/mappress_pro_settings.php:248
1189
  msgid "Map Field"
1190
  msgstr ""
1191
 
1192
+ #: pro/mappress_pro_settings.php:261
1193
  msgid "Overwrite maps when posts are saved"
1194
  msgstr ""
1195
 
1196
+ #: pro/mappress_pro_settings.php:269
1197
  msgid "Sort POI list by title"
1198
  msgstr ""
1199
 
1200
+ #: pro/mappress_pro_settings.php:284
1201
  msgid "Styled Maps Wizard"
1202
  msgstr ""
1203
 
1204
+ #: pro/mappress_pro_settings.php:285
1205
  msgid "JSON from Google's %s"
1206
  msgstr ""
1207
 
1208
+ #: pro/mappress_pro_settings.php:306
1209
  msgid "or "
1210
  msgstr ""
1211
 
1212
+ #: pro/mappress_updater.php:107
1213
  msgid "Communication error"
1214
  msgstr ""
1215
 
1216
+ #: pro/mappress_updater.php:113
1217
  msgid "JSON error"
1218
  msgstr ""
1219
 
languages/texts.php CHANGED
@@ -250,38 +250,40 @@ __("MapPress Easy Google Maps");
250
  __("http://www.wphostreviews.com/mappress");
251
  __("MapPress makes it easy to insert Google Maps in WordPress posts and pages.");
252
  __("Chris Richardson");
 
 
253
  __("License");
254
  __("Google API key");
255
  __("Automatic display");
256
  __("Google Server API key");
257
  __("Country code");
258
  __("%s for searching");
259
- __("disabled for Jetpack Infinite Scroll");
260
  __("disable if maps are output using AJAX");
261
  __("%s for map controls");
262
  __("Width (px or %)");
263
  __("Height (px)");
264
  __("rate it 5 Stars");
265
  __("Please %s on WordPress.org.");
 
266
  __("Taxonomy");
267
  __("Post field");
268
  __("MapPress license key");
269
  __("Beta versions");
270
  __("Sort");
271
  __("Icon directory");
272
- __("Filter");
273
  __("POI click");
274
  __("Thumbnails");
275
  __("Thumbnail size");
276
  __("Overwrite");
277
  __("Automatic updates");
278
  __("API key secured by IP address for geocoding (optional)");
279
- __("Enable settings for automatic updates (experimental)");
280
- __("Enable automatic updates for beta versions");
281
  __("Checkboxes");
282
  __("Select");
283
  __("Format");
284
- __("Enter your license key");
285
  __("Communication error, please try again later");
286
  __("Active");
287
  __("License is invalid or expired");
250
  __("http://www.wphostreviews.com/mappress");
251
  __("MapPress makes it easy to insert Google Maps in WordPress posts and pages.");
252
  __("Chris Richardson");
253
+ __("Insert Map");
254
+ __("Filter");
255
  __("License");
256
  __("Google API key");
257
  __("Automatic display");
258
  __("Google Server API key");
259
  __("Country code");
260
  __("%s for searching");
261
+ __("Disabled because Jetpack Infinite Scroll is active");
262
  __("disable if maps are output using AJAX");
263
  __("%s for map controls");
264
  __("Width (px or %)");
265
  __("Height (px)");
266
  __("rate it 5 Stars");
267
  __("Please %s on WordPress.org.");
268
+ __("MapPress");
269
  __("Taxonomy");
270
  __("Post field");
271
  __("MapPress license key");
272
  __("Beta versions");
273
  __("Sort");
274
  __("Icon directory");
 
275
  __("POI click");
276
  __("Thumbnails");
277
  __("Thumbnail size");
278
  __("Overwrite");
279
  __("Automatic updates");
280
  __("API key secured by IP address for geocoding (optional)");
281
+ __("Enable settings for automatic updates");
282
+ __("Enable updates for beta versions");
283
  __("Checkboxes");
284
  __("Select");
285
  __("Format");
286
+ __("Enter license to enable automatic updates");
287
  __("Communication error, please try again later");
288
  __("Active");
289
  __("License is invalid or expired");
mappress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Easy Google Maps
4
  Plugin URI: http://www.wphostreviews.com/mappress
5
  Author URI: http://www.wphostreviews.com/mappress
6
  Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
7
- Version: 2.46.9
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
@@ -34,7 +34,7 @@ if (is_dir(dirname( __FILE__ ) . '/pro')) {
34
  }
35
 
36
  class Mappress {
37
- const VERSION = '2.46.9';
38
 
39
  static
40
  $baseurl,
@@ -57,7 +57,7 @@ class Mappress {
57
 
58
  // Pro updater
59
  if (self::$pro)
60
- self::$updater = new Mappress_Updater(self::$basename, 'mappress', self::VERSION, self::$options->license, self::$options->betas, self::$options->autoupdate);
61
 
62
  add_action('admin_menu', array(__CLASS__, 'admin_menu'));
63
  add_action('init', array(__CLASS__, 'init'));
@@ -103,8 +103,6 @@ class Mappress {
103
 
104
  if (isset($_GET['mp_info'])) {
105
  echo "<b>Plugin version</b> " . self::get_version_string();
106
- foreach(array('language', 'wpurl', 'url') as $info)
107
- printf("<br/>%s : %s", $info, get_bloginfo($info));
108
  $posts_table = $wpdb->prefix . 'mappress_posts';
109
  $results = $wpdb->get_results("SELECT postid, mapid FROM $posts_table");
110
  echo "<br/>postid => mapid";
@@ -140,7 +138,7 @@ class Mappress {
140
  }
141
 
142
  static function get_support_links($title = 'MapPress') {
143
- $html = "<div class='mapp-support'><h1>$title</h1> " . self::get_version_string();
144
  $html .= " | <a target='_blank' href='http://wphostreviews.com/mappress/mappress-documentation'>" . __('Documentation', 'mappress-google-maps-for-wordpress') . "</a>";
145
  $html .= " | <a target='_blank' href='http://wphostreviews.com/chris-contact'>" . __('Support', 'mappress-google-maps-for-wordpress') . "</a>";
146
  if (!self::$pro)
@@ -208,14 +206,14 @@ class Mappress {
208
  return $content;
209
 
210
  // Get maps associated with post
211
- $maps = Mappress_Map::get_post_map_list($post->ID);
212
- if (empty($maps))
213
  return $content;
214
 
215
  // Add the shortcode once for each map
216
  $shortcodes = "";
217
- foreach($maps as $map)
218
- $shortcodes .= '<p>[mappress mapid="' . $map->mapid . '"]</p>';
219
 
220
  if ($autodisplay == 'top')
221
  return $shortcodes . $content;
@@ -249,7 +247,7 @@ class Mappress {
249
  $map = Mappress_Map::get($mapid);
250
  } else {
251
  // Get the first map attached to the post
252
- $maps = Mappress_Map::get_post_map_list($post->ID);
253
  $map = (isset ($maps[0]) ? $maps[0] : false);
254
  }
255
 
@@ -282,6 +280,8 @@ class Mappress {
282
  * @param mixed $atts
283
  */
284
  static function get_mashup($atts) {
 
 
285
  $mashup = new Mappress_Map($atts);
286
  $mashup->query = Mappress_Query::parse_query($atts);
287
 
@@ -293,10 +293,10 @@ class Mappress {
293
 
294
  // If using query 'current' then create a static map for current posts
295
  if (empty($mashup->query))
296
- Mappress_Query::get_query_pois($mashup);
297
 
298
  // If 'hideEmpty' is set, try to suppress the map if there are no POIs
299
- if ($mashup->options->hideEmpty) {
300
  // 'current' query - check found pois
301
  if (empty($mashup->query) && empty($mashup->pois))
302
  return "";
@@ -331,7 +331,7 @@ class Mappress {
331
  wp_enqueue_style('mappress-custom', $file, array('mappress'), self::VERSION);
332
 
333
  // Load scripts in header
334
- if (!self::$options->footer || self::infinite_scroll())
335
  self::load();
336
  }
337
 
@@ -346,12 +346,14 @@ class Mappress {
346
  if (empty(self::$pages))
347
  return;
348
 
 
 
349
  // Settings scripts
350
  if ($hook == self::$pages[0])
351
  self::load('settings');
352
 
353
  // CSS
354
- if (in_array($hook, self::$pages) || in_array($hook, array('edit.php', 'post.php', 'post-new.php'))) {
355
  wp_enqueue_style('mappress', self::$baseurl . '/css/mappress.css', null, self::VERSION);
356
  wp_enqueue_style('mappress-admin', self::$baseurl . '/css/mappress_admin.css', null, self::VERSION);
357
  }
@@ -366,8 +368,6 @@ class Mappress {
366
  * There are several WP bugs that prevent correct activation in multisitie:
367
  * http://core.trac.wordpress.org/ticket/14170
368
  * http://core.trac.wordpress.org/ticket/14718)
369
- * These bugs have been open for months. A workaround is to just 'activate' the plugin whenever it runs
370
- * (the tables are only created if they don't exist already)
371
  *
372
  */
373
  static function init() {
@@ -477,7 +477,7 @@ class Mappress {
477
  // Search = 'post', replace with post's location
478
  if (isset($atts['search']) && $atts['search'] == 'post') {
479
  global $post;
480
- $maps = Mappress_Map::get_list($post->ID);
481
  $map = ($maps) ? Mappress_Map::get($maps[0]) : null;
482
  $atts['search'] = ($map && $map->pois) ? $map->pois[0]->point : null;
483
  }
@@ -507,11 +507,9 @@ class Mappress {
507
  return;
508
  $loaded = true;
509
 
 
510
  $version = self::VERSION;
511
- $footer = (is_admin()) ? true : self::$options->footer && !self::infinite_scroll();
512
- $dev = (defined('MAPPRESS_DEV')) ? MAPPRESS_DEV : null;
513
- $dev = (isset($_REQUEST['mp_dev'])) ? $_REQUEST['mp_dev'] : $dev;
514
- $dev = (isset($dev) && empty($dev)) ? 'dev' : $dev;
515
 
516
  $apiversion = ($dev) ? 'v=3.exp' : 'v=3';
517
  $apikey = "&key=" . self::get_api_keys()->browser;
@@ -528,10 +526,10 @@ class Mappress {
528
  wp_enqueue_script("mappress-gmaps", "https://maps.googleapis.com/maps/api/js?{$apiversion}{$language}{$libstring}{$apikey}", null, null, $footer);
529
 
530
  if ($type == 'editor')
531
- wp_enqueue_script('mappress_editor', $js . "/mappress_editor$min.js", array('jquery', 'jquery-ui-position'), $version, $footer);
532
 
533
  if ($type == 'settings')
534
- wp_enqueue_script('mappress_settings', $js . "/mappress_settings$min.js", array('postbox', 'jquery', 'jquery-ui-position'), $version, $footer);
535
 
536
  // mappress.js includes loader, so must come after editor
537
  wp_enqueue_script('mappress', $js . "/mappress$min.js", array('jquery', 'underscore'), $version, $footer);
@@ -544,6 +542,19 @@ class Mappress {
544
  wp_localize_script('mappress', 'mappl10n', self::l10n());
545
  }
546
 
 
 
 
 
 
 
 
 
 
 
 
 
 
547
  static function l10n() {
548
  global $post;
549
 
@@ -571,7 +582,7 @@ class Mappress {
571
  );
572
 
573
  // Global settings
574
- $options = array('country', 'defaultIcon', 'directions', 'directionsServer', 'iconScale', 'iwType', 'mashupBody', 'mashupTitle', 'poiZoom', 'style', 'styles');
575
  foreach($options as $option)
576
  $l10n['options'][$option] = self::$options->$option;
577
 
@@ -609,13 +620,6 @@ class Mappress {
609
  }
610
  }
611
 
612
- /**
613
- * Returns true if Jetpack infinite scroll is enabled
614
- */
615
- static function infinite_scroll() {
616
- return get_option('infinite_scroll') ? true : false;
617
- }
618
-
619
  /**
620
  * Get template.
621
  */
@@ -626,7 +630,7 @@ class Mappress {
626
 
627
  $template_name .= ".php";
628
  $template_file = locate_template($template_name, false);
629
- if (!self::$pro || self::is_admin() || empty($template_file))
630
  $template_file = Mappress::$basedir . "/templates/$template_name";
631
 
632
  if (file_exists($template_file))
@@ -665,6 +669,10 @@ class Mappress {
665
  return (is_ssl() || !filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE));
666
  }
667
 
 
 
 
 
668
  // WP returns is_admin() = true during AJAX calls, this one returns false in that case
669
  static function is_admin() {
670
  $ajax = defined('DOING_AJAX') && DOING_AJAX;
4
  Plugin URI: http://www.wphostreviews.com/mappress
5
  Author URI: http://www.wphostreviews.com/mappress
6
  Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
7
+ Version: 2.47
8
  Author: Chris Richardson
9
  Text Domain: mappress-google-maps-for-wordpress
10
  Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
34
  }
35
 
36
  class Mappress {
37
+ const VERSION = '2.47';
38
 
39
  static
40
  $baseurl,
57
 
58
  // Pro updater
59
  if (self::$pro)
60
+ self::$updater = new Mappress_Updater(self::$basename, 'mappress', self::VERSION, self::$options->license, self::$options->betas, self::$options->autoupdate, Mappress_Pro_Settings::get_usage());
61
 
62
  add_action('admin_menu', array(__CLASS__, 'admin_menu'));
63
  add_action('init', array(__CLASS__, 'init'));
103
 
104
  if (isset($_GET['mp_info'])) {
105
  echo "<b>Plugin version</b> " . self::get_version_string();
 
 
106
  $posts_table = $wpdb->prefix . 'mappress_posts';
107
  $results = $wpdb->get_results("SELECT postid, mapid FROM $posts_table");
108
  echo "<br/>postid => mapid";
138
  }
139
 
140
  static function get_support_links($title = 'MapPress') {
141
+ $html = "<div class='mapp-support'>" . self::get_version_string();
142
  $html .= " | <a target='_blank' href='http://wphostreviews.com/mappress/mappress-documentation'>" . __('Documentation', 'mappress-google-maps-for-wordpress') . "</a>";
143
  $html .= " | <a target='_blank' href='http://wphostreviews.com/chris-contact'>" . __('Support', 'mappress-google-maps-for-wordpress') . "</a>";
144
  if (!self::$pro)
206
  return $content;
207
 
208
  // Get maps associated with post
209
+ $mapids = Mappress_Map::get_list($post->ID, 'ids');
210
+ if (empty($mapids))
211
  return $content;
212
 
213
  // Add the shortcode once for each map
214
  $shortcodes = "";
215
+ foreach($mapids as $mapid)
216
+ $shortcodes .= '<p>[mappress mapid="' . $mapid . '"]</p>';
217
 
218
  if ($autodisplay == 'top')
219
  return $shortcodes . $content;
247
  $map = Mappress_Map::get($mapid);
248
  } else {
249
  // Get the first map attached to the post
250
+ $maps = Mappress_Map::get_list($post->ID);
251
  $map = (isset ($maps[0]) ? $maps[0] : false);
252
  }
253
 
280
  * @param mixed $atts
281
  */
282
  static function get_mashup($atts) {
283
+ global $wp_query;
284
+
285
  $mashup = new Mappress_Map($atts);
286
  $mashup->query = Mappress_Query::parse_query($atts);
287
 
293
 
294
  // If using query 'current' then create a static map for current posts
295
  if (empty($mashup->query))
296
+ $mashup->pois = Mappress_Query::get_pois($wp_query->posts);
297
 
298
  // If 'hideEmpty' is set, try to suppress the map if there are no POIs
299
+ if ($mashup->hideEmpty) {
300
  // 'current' query - check found pois
301
  if (empty($mashup->query) && empty($mashup->pois))
302
  return "";
331
  wp_enqueue_style('mappress-custom', $file, array('mappress'), self::VERSION);
332
 
333
  // Load scripts in header
334
+ if (!self::footer())
335
  self::load();
336
  }
337
 
346
  if (empty(self::$pages))
347
  return;
348
 
349
+ $editing = in_array($hook, array('edit.php', 'post.php', 'post-new.php'));
350
+
351
  // Settings scripts
352
  if ($hook == self::$pages[0])
353
  self::load('settings');
354
 
355
  // CSS
356
+ if (in_array($hook, self::$pages) || $editing) {
357
  wp_enqueue_style('mappress', self::$baseurl . '/css/mappress.css', null, self::VERSION);
358
  wp_enqueue_style('mappress-admin', self::$baseurl . '/css/mappress_admin.css', null, self::VERSION);
359
  }
368
  * There are several WP bugs that prevent correct activation in multisitie:
369
  * http://core.trac.wordpress.org/ticket/14170
370
  * http://core.trac.wordpress.org/ticket/14718)
 
 
371
  *
372
  */
373
  static function init() {
477
  // Search = 'post', replace with post's location
478
  if (isset($atts['search']) && $atts['search'] == 'post') {
479
  global $post;
480
+ $maps = Mappress_Map::get_list($post->ID, 'ids');
481
  $map = ($maps) ? Mappress_Map::get($maps[0]) : null;
482
  $atts['search'] = ($map && $map->pois) ? $map->pois[0]->point : null;
483
  }
507
  return;
508
  $loaded = true;
509
 
510
+ $dev = self::dev();
511
  $version = self::VERSION;
512
+ $footer = self::footer();
 
 
 
513
 
514
  $apiversion = ($dev) ? 'v=3.exp' : 'v=3';
515
  $apikey = "&key=" . self::get_api_keys()->browser;
526
  wp_enqueue_script("mappress-gmaps", "https://maps.googleapis.com/maps/api/js?{$apiversion}{$language}{$libstring}{$apikey}", null, null, $footer);
527
 
528
  if ($type == 'editor')
529
+ wp_enqueue_script('mappress_editor', $js . "/mappress_editor$min.js", array('jquery', 'jquery-ui-position', 'jquery-ui-sortable'), $version, $footer);
530
 
531
  if ($type == 'settings')
532
+ wp_enqueue_script('mappress_settings', $js . "/mappress_settings$min.js", array('postbox', 'jquery', 'jquery-ui-position', 'jquery-ui-sortable'), $version, $footer);
533
 
534
  // mappress.js includes loader, so must come after editor
535
  wp_enqueue_script('mappress', $js . "/mappress$min.js", array('jquery', 'underscore'), $version, $footer);
542
  wp_localize_script('mappress', 'mappl10n', self::l10n());
543
  }
544
 
545
+ static function footer() {
546
+ return (is_admin() || self::$options->footer && !get_option('infinite_scroll'));
547
+ }
548
+
549
+ static function dev() {
550
+ if (defined('MAPPRESS_DEV') && MAPPRESS_DEV)
551
+ return MAPPRESS_DEV;
552
+ else if (isset($_REQUEST['mp_dev']))
553
+ return ($_REQUEST['mp_dev']) ? $_REQUEST['mp_dev'] : 'dev';
554
+ else
555
+ return false;
556
+ }
557
+
558
  static function l10n() {
559
  global $post;
560
 
582
  );
583
 
584
  // Global settings
585
+ $options = array('country', 'defaultIcon', 'directions', 'directionsServer', 'iconScale', 'iwType', 'mashupBody', 'mashupClick', 'mashupTitle', 'poiZoom', 'radius', 'size', 'sizes', 'style', 'styles');
586
  foreach($options as $option)
587
  $l10n['options'][$option] = self::$options->$option;
588
 
620
  }
621
  }
622
 
 
 
 
 
 
 
 
623
  /**
624
  * Get template.
625
  */
630
 
631
  $template_name .= ".php";
632
  $template_file = locate_template($template_name, false);
633
+ if (!self::$pro || is_admin() || empty($template_file))
634
  $template_file = Mappress::$basedir . "/templates/$template_name";
635
 
636
  if (file_exists($template_file))
669
  return (is_ssl() || !filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE));
670
  }
671
 
672
+ static function is_localhost() {
673
+ return !filter_var($_SERVER['SERVER_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
674
+ }
675
+
676
  // WP returns is_admin() = true during AJAX calls, this one returns false in that case
677
  static function is_admin() {
678
  $ajax = defined('DOING_AJAX') && DOING_AJAX;
mappress_map.php CHANGED
@@ -1,38 +1,41 @@
1
  <?php
2
  class Mappress_Map extends Mappress_Obj {
3
- var $mapid,
4
- $width,
5
- $height,
6
- $zoom,
7
  $center,
8
- $mapTypeId = 'roadmap',
9
- $title,
 
 
 
 
 
 
 
 
 
 
10
  $metaKey,
 
 
 
 
11
  $query,
12
- $queryResult,
13
- $pois = array();
 
 
14
 
15
- // Not saved
16
- var $options,
17
- $name;
18
 
19
  function __sleep() {
20
- return array('mapid', 'width', 'height', 'zoom', 'center', 'mapTypeId', 'title', 'metaKey', 'pois');
21
  }
22
 
23
  function __construct($atts=null) {
24
- parent::__construct($atts);
25
-
26
- // Set the options; they may be passed as individual parameters or an 'options' array
27
- $this->options = Mappress_Options::get();
28
 
29
- // License should not be included
30
- unset($this->options->license);
31
-
32
- if (isset($atts['options']))
33
- $this->options->update($atts['options']);
34
- else
35
- $this->options->update($atts);
36
 
37
  // Convert POIs from arrays to objects if needed
38
  foreach((array)$this->pois as $index => $poi) {
@@ -42,7 +45,7 @@ class Mappress_Map extends Mappress_Obj {
42
 
43
  // Set default size if no width/height specified
44
  if (!$this->width || !$this->height) {
45
- $i = (int) $this->options->size;
46
  if (isset(Mappress::$options->sizes[$i])) {
47
  $size = Mappress::$options->sizes[$i];
48
  $this->width = ($this->width) ? $this->width : $size['width'];
@@ -59,6 +62,7 @@ class Mappress_Map extends Mappress_Obj {
59
  add_action('wp_ajax_mapp_get', array(__CLASS__, 'ajax_get'));
60
  add_action('wp_ajax_mapp_save', array(__CLASS__, 'ajax_save'));
61
  add_action('wp_ajax_mapp_delete', array(__CLASS__, 'ajax_delete'));
 
62
 
63
  // Editing meta boxes
64
  add_action('admin_init', array(__CLASS__, 'add_meta_boxes'));
@@ -89,6 +93,13 @@ class Mappress_Map extends Mappress_Obj {
89
  $wpdb->show_errors(false);
90
  }
91
 
 
 
 
 
 
 
 
92
  static function add_meta_boxes() {
93
  // Add editing meta box to standard & custom post types
94
  foreach(Mappress::$options->postTypes as $post_type)
@@ -101,25 +112,73 @@ class Mappress_Map extends Mappress_Obj {
101
  require(Mappress::$basedir . '/forms/map_media.php');
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
- * Get a map.
106
- *
107
- * @param mixed $mapid
108
- * @return mixed false if failure, or a map object on success
109
  */
110
- static function get($mapid) {
111
  global $wpdb;
112
  $maps_table = $wpdb->prefix . 'mappress_maps';
113
- $result = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $maps_table WHERE mapid = %d", $mapid) ); // May return FALSE or NULL
 
 
 
114
 
115
  if (!$result)
116
  return false;
117
 
118
  // Read the map data and construct a new map from it
119
- $mapdata = (array) unserialize($result->obj);
120
- $map = new Mappress_Map($mapdata);
121
- $map->mapid = $result->mapid;
122
- return $map;
 
 
 
 
 
 
 
 
 
 
123
  }
124
 
125
  /**
@@ -128,12 +187,27 @@ class Mappress_Map extends Mappress_Obj {
128
  * @return array of mapids | empty array
129
  *
130
  */
131
- static function get_list($postid = null) {
132
  global $wpdb;
133
  $posts_table = $wpdb->prefix . 'mappress_posts';
134
- $sql = ($postid) ? $wpdb->prepare("SELECT mapid FROM $posts_table WHERE postid = %d", $postid) : "SELECT mapid FROM $posts_table";
135
- $result = $wpdb->get_col($sql);
136
- return (is_array($result)) ? $result : array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  }
138
 
139
  function save($postid) {
@@ -172,6 +246,25 @@ class Mappress_Map extends Mappress_Obj {
172
  return $this->mapid;
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  /**
176
  * Delete a map and all of its post assignments
177
  *
@@ -195,6 +288,19 @@ class Mappress_Map extends Mappress_Obj {
195
  return true;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /**
199
  * Delete a map assignment(s) for a post
200
  * If $mapid is null, then ALL maps will be removed from the post
@@ -223,40 +329,6 @@ class Mappress_Map extends Mappress_Obj {
223
  return true;
224
  }
225
 
226
- /**
227
- * Get a list of maps attached to the post
228
- *
229
- * @param int $postid Post for which to get the list
230
- * @return an array of all maps for the post or FALSE if no maps
231
- */
232
- static function get_post_map_list($postid) {
233
- global $wpdb;
234
- $posts_table = $wpdb->prefix . 'mappress_posts';
235
-
236
- $results = $wpdb->get_results($wpdb->prepare("SELECT postid, mapid FROM $posts_table WHERE postid = %d", $postid));
237
-
238
- if ($results === false)
239
- return false;
240
-
241
- // Get all of the maps
242
- $maps = array();
243
- foreach($results as $key => $result) {
244
- $map = Mappress_Map::get($result->mapid);
245
- if ($map)
246
- $maps[] = $map;
247
- }
248
- return $maps;
249
- }
250
-
251
- function width() {
252
- return ( stripos($this->width, 'px') || strpos($this->width, '%')) ? $this->width : $this->width. 'px';
253
- }
254
-
255
- function height() {
256
- return ( stripos($this->height, 'px') || strpos($this->height, '%')) ? $this->height : $this->height. 'px';
257
- }
258
-
259
-
260
  /**
261
  * Display a map
262
  *
@@ -266,7 +338,6 @@ class Mappress_Map extends Mappress_Obj {
266
  static $div = 0;
267
 
268
  $this->update($atts);
269
- $this->options->update($atts);
270
 
271
  // Assign a map name, if none was provided. Uniqid is used for for ajax to prevent repeating ids
272
  if (empty($this->name)) {
@@ -285,96 +356,109 @@ class Mappress_Map extends Mappress_Obj {
285
  $script = "mapp.data.push( " . json_encode($this) . " ); \r\nif (typeof mapp.load != 'undefined') { mapp.load(); };";
286
 
287
  // WP 4.5: queue maps for XHTML compatibility
288
- if (function_exists('wp_add_inline_script') && Mappress::$options->footer && (!defined('DOING_AJAX') || !DOING_AJAX))
289
  wp_add_inline_script('mappress', "//<![CDATA[\r\n" . $script . "\r\n//]]>");
290
- else
291
  $html .= Mappress::script($script);
 
292
 
293
  return $html;
294
  }
295
 
 
 
 
 
 
 
 
 
 
 
 
 
 
296
  function check($part) {
297
  switch ($part) {
298
  case 'directions' :
299
- return !$this->options->editable && $this->options->directions == 'inline';
300
 
301
  case 'filters' :
302
- return !$this->options->editable && $this->query && $this->options->filter && $this->options->filter;
 
303
 
304
  case 'header' :
305
- return !$this->options->editable && $this->query && ($this->check('filters') || $this->check('search'));
306
 
307
  case 'list-inline' :
308
- return $this->options->poiList && $this->options->layout != 'left';
309
 
310
  case 'list-left' :
311
- return $this->options->poiList && $this->options->layout == 'left';
 
 
 
312
 
313
  case 'show' :
314
- return $this->options->hidden;
315
  }
316
- return false;
317
  }
318
 
319
  function part($part) {
320
 
 
 
 
321
  switch ($part) {
322
  case 'controls' :
323
- $html = Mappress::get_template('map-controls', array('map' => $this));
324
- break;
325
-
326
  case 'directions' :
327
- $html = ($this->check($part)) ? Mappress::get_template('map-directions', array('map' => $this)) : '';
328
- break;
329
-
330
  case 'filters' :
331
- $html = ($this->check($part)) ? Mappress::get_template('map-filters', array('map' => $this)) : '';
 
 
332
  break;
333
 
334
- case 'header' :
335
- $html = ($this->check($part)) ? Mappress::get_template('map-header', array('map' => $this)) : '';
336
  break;
337
 
338
  case 'layout-class' :
339
  $class = 'mapp-layout';
340
- $class .= ($this->options->layout == 'left') ? ' mapp-left' : ' mapp-inline';
341
  $class .= (wp_is_mobile()) ? ' mobile' : '';
342
- if (!$this->options->editable) {
343
- $class .= ($this->options->alignment) ? " mapp-align-{$this->options->alignment}" : '';
344
- $class .= ($this->options->hidden) ? ' mapp-hidden' : '';
345
- }
346
  $html = $class;
347
  break;
348
 
349
  case 'layout-style' :
350
- $width = (!stripos($this->width, 'px') && !strpos($this->width, '%')) ? $this->width . 'px' : $this->width;
351
- $style = "width: $width";
352
- $html = $style;
 
 
 
 
353
  break;
354
 
355
  case 'list-inline' :
356
  case 'list-left' :
357
- $html = ($this->check($part)) ? Mappress::get_template('map-list', array('map' => $this)) : '';
358
  break;
359
 
360
  case 'show' :
361
  // Should be onclick...
362
- $html = ($this->check($part)) ? sprintf("<a href='#' data-mapp-action='show'>%s</a>", __('Show map', 'mappress-google-maps-for-wordpress')) : '';
363
  break;
364
 
365
  case 'wrapper-style' :
366
- $height = $this->height;
367
-
368
- // Aspect ratio
369
- if (stristr($height, ':')) {
370
- $parts = explode(':', $height);
371
- if (count($parts) == 2 && $parts[0] > 0)
372
- $height = round((100 * $parts[1] / $parts[0]), 2) . '%';
373
  }
374
-
375
- // Parse px/%
376
- $height = (!stripos($height, 'px') && !strpos($height, '%')) ? $height . 'px' : $height;
377
- $html = (stristr($height, '%')) ? "padding-bottom: $height;" : "height: $height;";
378
  break;
379
  }
380
 
@@ -396,7 +480,7 @@ class Mappress_Map extends Mappress_Obj {
396
  $poi->prepare();
397
 
398
  // Sort the pois
399
- if ($this->options->sort && !isset($this->query['orderby']))
400
  $this->sort_pois();
401
 
402
  // Set the HTML for each POI (comes *after* sort because links embed POI list position)
@@ -473,6 +557,31 @@ class Mappress_Map extends Mappress_Obj {
473
  return strcasecmp(strip_tags($a->title), strip_tags($b->title));
474
  }
475
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  /**
477
  * Get a list of maps for editing
478
  *
@@ -505,48 +614,5 @@ class Mappress_Map extends Mappress_Obj {
505
  $map = new Mappress_Map();
506
  Mappress::ajax_response('OK', array('map' => $map));
507
  }
508
-
509
- static function ajax_get($mapid) {
510
- ob_start();
511
- $mapid = (isset($_GET['mapid'])) ? $_GET['mapid'] : null;
512
- $map = ($mapid) ? self::get($mapid) : null;
513
- if (!$map)
514
- Mappress::ajax_response(__('Map not found', 'mappress-google-maps-for-wordpress'));
515
- else
516
- Mappress::ajax_response('OK', array('map' => $map));
517
- }
518
-
519
- static function ajax_save() {
520
- ob_start();
521
-
522
- $mapdata = (isset($_POST['map'])) ? json_decode(stripslashes($_POST['map']), true) : null;
523
- $postid = (isset($_POST['postid'])) ? $_POST['postid'] : null;
524
-
525
- if (!$mapdata)
526
- Mappress::ajax_response('Internal error, your data has not been saved!');
527
-
528
- $map = new Mappress_Map($mapdata);
529
- $mapid = $map->save($postid);
530
-
531
- if ($mapid === false)
532
- Mappress::ajax_response('Internal error, your data has not been saved!');
533
-
534
- do_action('mappress_map_save', $mapid); // Use for your own developments
535
- Mappress::ajax_response('OK', array('mapid' => $mapid, 'list' => self::get_map_list($postid)) );
536
- }
537
-
538
- static function ajax_delete() {
539
- ob_start();
540
-
541
- $mapid = (isset($_POST['mapid'])) ? $_POST['mapid'] : null;
542
- $result = Mappress_Map::delete($mapid);
543
-
544
- if (!$result)
545
- Mappress::ajax_response("Internal error when deleting map ID '$mapid'!");
546
-
547
- do_action('mappress_map_delete', $mapid); // Use for your own developments
548
- Mappress::ajax_response('OK', array('mapid' => $mapid));
549
- }
550
-
551
  }
552
  ?>
1
  <?php
2
  class Mappress_Map extends Mappress_Obj {
3
+ var $alignment,
 
 
 
4
  $center,
5
+ $editable,
6
+ $embed,
7
+ $filter,
8
+ $geolocate,
9
+ $height,
10
+ $hideEmpty,
11
+ $initialOpenDirections,
12
+ $initialOpenInfo,
13
+ $layers,
14
+ $layout,
15
+ $mapid,
16
+ $mapTypeId,
17
  $metaKey,
18
+ $minZoom,
19
+ $name,
20
+ $poiList,
21
+ $postid,
22
  $query,
23
+ $title,
24
+ $width,
25
+ $zoom
26
+ ;
27
 
28
+ var $pois = array();
 
 
29
 
30
  function __sleep() {
31
+ return array('mapid', 'center', 'height', 'mapTypeId', 'metaKey', 'pois', 'title', 'width', 'zoom');
32
  }
33
 
34
  function __construct($atts=null) {
 
 
 
 
35
 
36
+ // Update with defaults, then any passed atts
37
+ $this->update(Mappress::$options);
38
+ $this->update($atts);
 
 
 
 
39
 
40
  // Convert POIs from arrays to objects if needed
41
  foreach((array)$this->pois as $index => $poi) {
45
 
46
  // Set default size if no width/height specified
47
  if (!$this->width || !$this->height) {
48
+ $i = (int) Mappress::$options->size;
49
  if (isset(Mappress::$options->sizes[$i])) {
50
  $size = Mappress::$options->sizes[$i];
51
  $this->width = ($this->width) ? $this->width : $size['width'];
62
  add_action('wp_ajax_mapp_get', array(__CLASS__, 'ajax_get'));
63
  add_action('wp_ajax_mapp_save', array(__CLASS__, 'ajax_save'));
64
  add_action('wp_ajax_mapp_delete', array(__CLASS__, 'ajax_delete'));
65
+ add_action('wp_ajax_mapp_find', array(__CLASS__, 'ajax_find'));
66
 
67
  // Editing meta boxes
68
  add_action('admin_init', array(__CLASS__, 'add_meta_boxes'));
93
  $wpdb->show_errors(false);
94
  }
95
 
96
+ static function media_button($editor_id) {
97
+ if ($editor_id == 'content') {
98
+ echo '<button type="button" class="button" id="mapp-pick-button">';
99
+ echo '<span class="wp-media-buttons-icon dashicons dashicons-location-alt"></span> ' . __('Insert Map', 'mappress-google-maps-for-wordpress') . '</button>';
100
+ }
101
+ }
102
+
103
  static function add_meta_boxes() {
104
  // Add editing meta box to standard & custom post types
105
  foreach(Mappress::$options->postTypes as $post_type)
112
  require(Mappress::$basedir . '/forms/map_media.php');
113
  }
114
 
115
+ static function find($args) {
116
+ global $wpdb;
117
+ $args = (object) wp_parse_args($args, array('type' => 'post', 'page' => 1, 'page_size' => 20, 'postid' => null, 'search' => null));
118
+
119
+ $posts_table = $wpdb->prefix . 'mappress_posts';
120
+
121
+ $where = ($args->type == 'post') ? $wpdb->prepare("WHERE postid=%d", $args->postid) : $wpdb->prepare("WHERE postid<>%d", $args->postid);
122
+
123
+ if ($args->search)
124
+ $where .= $wpdb->prepare(" AND $wpdb->posts.post_title LIKE %s", '%' . $args->search . '%');
125
+
126
+ $limit = sprintf(" LIMIT %d, %d", ($args->page - 1) * $args->page_size, $args->page_size);
127
+ $sql = "SELECT SQL_CALC_FOUND_ROWS $wpdb->posts.post_title, $wpdb->posts.ID, $posts_table.mapid FROM $posts_table INNER JOIN $wpdb->posts ON ($wpdb->posts.ID = $posts_table.postid) $where $limit";
128
+
129
+ $rows = $wpdb->get_results($sql);
130
+ $found = $wpdb->get_var('SELECT FOUND_ROWS()');
131
+
132
+ $results = array();
133
+ foreach($rows as $row) {
134
+ $map = self::get($row->mapid, 'raw');
135
+ $results[] = array(
136
+ 'mapid' => $row->mapid,
137
+ 'postid' => $row->ID,
138
+ 'post_title' => $row->post_title,
139
+ 'can_edit' => current_user_can('edit_post', $row->ID),
140
+ 'mapdata' => $map
141
+ );
142
+ }
143
+
144
+ $pages = (int) ceil($found / $args->page_size);
145
+ $page = (int) min($args->page, $pages);
146
+ return (object) array('items' => $results, 'page' => $page, 'pages' => $pages);
147
+ }
148
+
149
+ static function ajax_find() {
150
+ Mappress::ajax_response('OK', self::find($_GET));
151
+ }
152
+
153
  /**
154
+ * Get a map. Output is 'raw' or 'object'
 
 
 
155
  */
156
+ static function get($mapid, $output = 'object') {
157
  global $wpdb;
158
  $maps_table = $wpdb->prefix . 'mappress_maps';
159
+ $posts_table = $wpdb->prefix . 'mappress_posts';
160
+
161
+ $sql = "SELECT $posts_table.postid, $maps_table.mapid, $maps_table.obj FROM $posts_table INNER JOIN $maps_table ON ($maps_table.mapid = $posts_table.mapid) WHERE $maps_table.mapid = %d";
162
+ $result = $wpdb->get_row($wpdb->prepare($sql, $mapid));
163
 
164
  if (!$result)
165
  return false;
166
 
167
  // Read the map data and construct a new map from it
168
+ $mapdata = unserialize($result->obj);
169
+ $mapdata->postid = $result->postid;
170
+ $mapdata->mapid = $result->mapid;
171
+ return ($output == 'object') ? new Mappress_Map($mapdata) : $mapdata;
172
+ }
173
+
174
+ static function ajax_get() {
175
+ ob_start();
176
+ $mapid = (isset($_GET['mapid'])) ? $_GET['mapid'] : null;
177
+ $map = ($mapid) ? self::get($mapid) : null;
178
+ if (!$map)
179
+ Mappress::ajax_response(__('Map not found', 'mappress-google-maps-for-wordpress'));
180
+ else
181
+ Mappress::ajax_response('OK', array('map' => $map));
182
  }
183
 
184
  /**
187
  * @return array of mapids | empty array
188
  *
189
  */
190
+ static function get_list($postid = null, $output = 'objects') {
191
  global $wpdb;
192
  $posts_table = $wpdb->prefix . 'mappress_posts';
193
+
194
+ $where = ($postid) ? $wpdb->prepare("WHERE postid = %d", $postid) : '';
195
+
196
+ $mapids = $wpdb->get_col("SELECT mapid FROM $posts_table $where");
197
+ if (!$mapids)
198
+ return array();
199
+
200
+ if ($output == 'ids') {
201
+ return $mapids;
202
+ } else {
203
+ $maps = array();
204
+ foreach($mapids as $mapid) {
205
+ $map = Mappress_Map::get($mapid);
206
+ if ($map)
207
+ $maps[] = $map;
208
+ }
209
+ return $maps;
210
+ }
211
  }
212
 
213
  function save($postid) {
246
  return $this->mapid;
247
  }
248
 
249
+ static function ajax_save() {
250
+ ob_start();
251
+
252
+ $mapdata = (isset($_POST['map'])) ? json_decode(stripslashes($_POST['map']), true) : null;
253
+ $postid = (isset($_POST['postid'])) ? $_POST['postid'] : null;
254
+
255
+ if (!$mapdata)
256
+ Mappress::ajax_response('Internal error, your data has not been saved!');
257
+
258
+ $map = new Mappress_Map($mapdata);
259
+ $mapid = $map->save($postid);
260
+
261
+ if ($mapid === false)
262
+ Mappress::ajax_response('Internal error, your data has not been saved!');
263
+
264
+ do_action('mappress_map_save', $mapid); // Use for your own developments
265
+ Mappress::ajax_response('OK', array('mapid' => $mapid, 'list' => self::get_map_list($postid)) );
266
+ }
267
+
268
  /**
269
  * Delete a map and all of its post assignments
270
  *
288
  return true;
289
  }
290
 
291
+ static function ajax_delete() {
292
+ ob_start();
293
+
294
+ $mapid = (isset($_POST['mapid'])) ? $_POST['mapid'] : null;
295
+ $result = Mappress_Map::delete($mapid);
296
+
297
+ if (!$result)
298
+ Mappress::ajax_response("Internal error when deleting map ID '$mapid'!");
299
+
300
+ do_action('mappress_map_delete', $mapid); // Use for your own developments
301
+ Mappress::ajax_response('OK', array('mapid' => $mapid));
302
+ }
303
+
304
  /**
305
  * Delete a map assignment(s) for a post
306
  * If $mapid is null, then ALL maps will be removed from the post
329
  return true;
330
  }
331
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  /**
333
  * Display a map
334
  *
338
  static $div = 0;
339
 
340
  $this->update($atts);
 
341
 
342
  // Assign a map name, if none was provided. Uniqid is used for for ajax to prevent repeating ids
343
  if (empty($this->name)) {
356
  $script = "mapp.data.push( " . json_encode($this) . " ); \r\nif (typeof mapp.load != 'undefined') { mapp.load(); };";
357
 
358
  // WP 4.5: queue maps for XHTML compatibility
359
+ if (function_exists('wp_add_inline_script') && Mappress::footer() && (!defined('DOING_AJAX') || !DOING_AJAX)) {
360
  wp_add_inline_script('mappress', "//<![CDATA[\r\n" . $script . "\r\n//]]>");
361
+ } else {
362
  $html .= Mappress::script($script);
363
+ }
364
 
365
  return $html;
366
  }
367
 
368
+ function width() {
369
+ return ( stripos($this->width, 'px') || strpos($this->width, '%')) ? $this->width : $this->width. 'px';
370
+ }
371
+
372
+ function height() {
373
+ if (stristr($this->height, ':')) {
374
+ $parts = explode(':', $this->height);
375
+ if (count($parts) == 2 && $parts[0] > 0)
376
+ return round((100 * $parts[1] / $parts[0]), 2) . '%';
377
+ }
378
+ return ( stripos($this->height, 'px') || strpos($this->height, '%')) ? $this->height : $this->height. 'px';
379
+ }
380
+
381
  function check($part) {
382
  switch ($part) {
383
  case 'directions' :
384
+ return !$this->editable && Mappress::$options->directions == 'inline';
385
 
386
  case 'filters' :
387
+ case 'filters-toggle' :
388
+ return !$this->editable && $this->query && $this->filter;
389
 
390
  case 'header' :
391
+ return $this->query && ($this->check('filters') || $this->check('search'));
392
 
393
  case 'list-inline' :
394
+ return $this->poiList && $this->layout != 'left';
395
 
396
  case 'list-left' :
397
+ return $this->poiList && $this->layout == 'left';
398
+
399
+ case 'search' :
400
+ return $this->editable;
401
 
402
  case 'show' :
403
+ return $this->hidden;
404
  }
405
+ return true;
406
  }
407
 
408
  function part($part) {
409
 
410
+ if (!$this->check($part))
411
+ return;
412
+
413
  switch ($part) {
414
  case 'controls' :
 
 
 
415
  case 'directions' :
 
 
 
416
  case 'filters' :
417
+ case 'header' :
418
+ case 'search' :
419
+ $html = Mappress::get_template("map-$part", array('map' => $this));
420
  break;
421
 
422
+ case 'filters-toggle' :
423
+ $html = "<div class='mapp-caret mapp-button mapp-filters-toggle' data-mapp-action='filters-toggle'>" . __('Filter', 'mappress-google-maps-for-wordpress') . "</div>";
424
  break;
425
 
426
  case 'layout-class' :
427
  $class = 'mapp-layout';
428
+ $class .= ($this->layout == 'left') ? ' mapp-left' : ' mapp-inline';
429
  $class .= (wp_is_mobile()) ? ' mobile' : '';
430
+ if (!$this->editable)
431
+ $class .= ($this->alignment) ? " mapp-align-{$this->alignment}" : '';
 
 
432
  $html = $class;
433
  break;
434
 
435
  case 'layout-style' :
436
+ $w = $this->width();
437
+ $html = "width: $w;";
438
+
439
+ if ($this->embed) {
440
+ $h = $this->height();
441
+ $html .= " height: $h;";
442
+ }
443
  break;
444
 
445
  case 'list-inline' :
446
  case 'list-left' :
447
+ $html = Mappress::get_template('map-list', array('map' => $this));
448
  break;
449
 
450
  case 'show' :
451
  // Should be onclick...
452
+ $html = sprintf("<a href='#' data-mapp-action='show'>%s</a>", __('Show map', 'mappress-google-maps-for-wordpress'));
453
  break;
454
 
455
  case 'wrapper-style' :
456
+ if ($this->embed)
457
+ $html = '';
458
+ else {
459
+ $h = $this->height();
460
+ $html = (stristr($h, '%')) ? "padding-bottom: $h;" : "height: $h";
 
 
461
  }
 
 
 
 
462
  break;
463
  }
464
 
480
  $poi->prepare();
481
 
482
  // Sort the pois
483
+ if (Mappress::$options->sort && !isset($this->query['orderby']))
484
  $this->sort_pois();
485
 
486
  // Set the HTML for each POI (comes *after* sort because links embed POI list position)
557
  return strcasecmp(strip_tags($a->title), strip_tags($b->title));
558
  }
559
 
560
+ /**
561
+ * Get a list of maps attached to the post
562
+ *
563
+ * @param int $postid Post for which to get the list
564
+ * @return an array of all maps for the post or FALSE if no maps
565
+ */
566
+ static function get_post_map_list($postid) {
567
+ global $wpdb;
568
+ $posts_table = $wpdb->prefix . 'mappress_posts';
569
+
570
+ $results = $wpdb->get_results($wpdb->prepare("SELECT postid, mapid FROM $posts_table WHERE postid = %d", $postid));
571
+
572
+ if ($results === false)
573
+ return false;
574
+
575
+ // Get all of the maps
576
+ $maps = array();
577
+ foreach($results as $key => $result) {
578
+ $map = Mappress_Map::get($result->mapid);
579
+ if ($map)
580
+ $maps[] = $map;
581
+ }
582
+ return $maps;
583
+ }
584
+
585
  /**
586
  * Get a list of maps for editing
587
  *
614
  $map = new Mappress_Map();
615
  Mappress::ajax_response('OK', array('map' => $map));
616
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
617
  }
618
  ?>
mappress_obj.php CHANGED
@@ -9,6 +9,7 @@ class Mappress_Obj {
9
  return;
10
 
11
  $obj_atts = get_object_vars($this);
 
12
 
13
  foreach ($obj_atts as $key => $value ) {
14
  $newvalue = (isset($atts[$key])) ? $atts[$key] : null;
9
  return;
10
 
11
  $obj_atts = get_object_vars($this);
12
+ $atts = (array) $atts;
13
 
14
  foreach ($obj_atts as $key => $value ) {
15
  $newvalue = (isset($atts[$key])) ? $atts[$key] : null;
mappress_poi.php CHANGED
@@ -119,7 +119,7 @@ class Mappress_Poi extends Mappress_Obj {
119
  break;
120
 
121
  case 'directions' :
122
- $html = ($map->options->directions != 'none') ? sprintf("<a href='#' data-mapp-action='dir'>%s</a>", __('Directions', 'mappress-google-maps-for-wordpress')) : '';
123
  break;
124
 
125
  case 'icon' :
@@ -127,6 +127,7 @@ class Mappress_Poi extends Mappress_Obj {
127
  break;
128
 
129
  case 'thumbnail' :
 
130
  if ($this->postid && Mappress::$options->thumbs) {
131
  $size = (Mappress::$options->thumbSize) ? Mappress::$options->thumbSize : null;
132
  $style = (Mappress::$options->thumbWidth && Mappress::$options->thumbHeight) ? sprintf("width: %spx; height : %spx;", Mappress::$options->thumbWidth, Mappress::$options->thumbHeight) : null;
119
  break;
120
 
121
  case 'directions' :
122
+ $html = (Mappress::$options->directions != 'none') ? sprintf("<a href='#' data-mapp-action='dir'>%s</a>", __('Directions', 'mappress-google-maps-for-wordpress')) : '';
123
  break;
124
 
125
  case 'icon' :
127
  break;
128
 
129
  case 'thumbnail' :
130
+ $html = '';
131
  if ($this->postid && Mappress::$options->thumbs) {
132
  $size = (Mappress::$options->thumbSize) ? Mappress::$options->thumbSize : null;
133
  $style = (Mappress::$options->thumbWidth && Mappress::$options->thumbHeight) ? sprintf("width: %spx; height : %spx;", Mappress::$options->thumbWidth, Mappress::$options->thumbHeight) : null;
mappress_settings.php CHANGED
@@ -15,28 +15,19 @@ class Mappress_Options extends Mappress_Obj {
15
  $defaultIcon,
16
  $directions = 'google',
17
  $directionsServer = 'https://maps.google.com',
18
- $editable,
19
  $filter,
20
  $footer = true,
21
- $hidden,
22
- $hideEmpty,
23
  $iconScale,
24
- $initialOpenDirections,
25
  $initialOpenInfo,
26
  $iwType = 'iw',
27
  $language,
28
- $layers,
29
- $layout,
30
  $license,
31
  $mashupTitle = 'poi',
32
  $mashupBody = 'poi',
33
  $mashupClick = 'poi',
34
- $maxZoom,
35
- $minZoom,
36
- $metaKey,
37
  $metaKeys = array(),
38
  $metaSyncSave = true,
39
- $name,
40
  $poiList = false,
41
  $poiZoom = 15,
42
  $postTypes = array('post', 'page'),
@@ -63,10 +54,6 @@ class Mappress_Options extends Mappress_Obj {
63
  return new Mappress_Options($options);
64
  }
65
 
66
- static function get_defaults() {
67
- return (object) get_class_vars(__CLASS__);
68
- }
69
-
70
  function save() {
71
  return update_option('mappress_options', get_object_vars($this));
72
  }
@@ -221,9 +208,9 @@ class Mappress_Settings {
221
 
222
  function set_footer($name) {
223
  // Disable if jetpack infinite scroll is used
224
- if (Mappress::infinite_scroll()) {
225
  echo Mappress_Controls::checkmark($name, false, __('Output scripts in footer', 'mappress-google-maps-for-wordpress'), array('disabled' => true));
226
- printf("<br/><i>(%s)</i>", __('disabled for Jetpack Infinite Scroll', 'mappress-google-maps-for-wordpress'));
227
  } else {
228
  echo Mappress_Controls::checkmark($name, $this->options->footer, __('Output scripts in footer', 'mappress-google-maps-for-wordpress'));
229
  printf("<br/><i>(%s)</i>", __('disable if maps are output using AJAX', 'mappress-google-maps-for-wordpress'));
@@ -311,6 +298,7 @@ class Mappress_Settings {
311
  add_meta_box('metabox_' . $section['id'], $section['title'], array($this, 'metabox_settings'), $hook_suffix, 'normal', 'high', array('page' => 'mappress', 'section' => $section));
312
  ?>
313
  <div class="wrap mapp-settings-screen">
 
314
  <?php echo Mappress::get_support_links(); ?>
315
  <div id="poststuff">
316
  <?php // Print demo box early because directions has its own form tag ?>
15
  $defaultIcon,
16
  $directions = 'google',
17
  $directionsServer = 'https://maps.google.com',
 
18
  $filter,
19
  $footer = true,
20
+ $geolocate,
 
21
  $iconScale,
 
22
  $initialOpenInfo,
23
  $iwType = 'iw',
24
  $language,
 
 
25
  $license,
26
  $mashupTitle = 'poi',
27
  $mashupBody = 'poi',
28
  $mashupClick = 'poi',
 
 
 
29
  $metaKeys = array(),
30
  $metaSyncSave = true,
 
31
  $poiList = false,
32
  $poiZoom = 15,
33
  $postTypes = array('post', 'page'),
54
  return new Mappress_Options($options);
55
  }
56
 
 
 
 
 
57
  function save() {
58
  return update_option('mappress_options', get_object_vars($this));
59
  }
208
 
209
  function set_footer($name) {
210
  // Disable if jetpack infinite scroll is used
211
+ if (get_option('infinite_scroll')) {
212
  echo Mappress_Controls::checkmark($name, false, __('Output scripts in footer', 'mappress-google-maps-for-wordpress'), array('disabled' => true));
213
+ printf("<br/><i>%s</i>", __('Disabled because Jetpack Infinite Scroll is active', 'mappress-google-maps-for-wordpress'));
214
  } else {
215
  echo Mappress_Controls::checkmark($name, $this->options->footer, __('Output scripts in footer', 'mappress-google-maps-for-wordpress'));
216
  printf("<br/><i>(%s)</i>", __('disable if maps are output using AJAX', 'mappress-google-maps-for-wordpress'));
298
  add_meta_box('metabox_' . $section['id'], $section['title'], array($this, 'metabox_settings'), $hook_suffix, 'normal', 'high', array('page' => 'mappress', 'section' => $section));
299
  ?>
300
  <div class="wrap mapp-settings-screen">
301
+ <h1><?php _e('MapPress', 'mappress-google-maps-for-wordpress'); ?></h1>
302
  <?php echo Mappress::get_support_links(); ?>
303
  <div id="poststuff">
304
  <?php // Print demo box early because directions has its own form tag ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
  Requires at least: 3.5
6
  Tested up to: 4.9
7
- Stable tag: 2.46.9
8
 
9
  MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
 
@@ -86,6 +86,16 @@ Please see the plugin documentation pages:
86
 
87
  == Changelog ==
88
 
 
 
 
 
 
 
 
 
 
 
89
  = 2.46.9 =
90
  * Fixed: POI editor error if tinyMCE is disabled in user settings
91
 
4
  Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
  Requires at least: 3.5
6
  Tested up to: 4.9
7
+ Stable tag: 2.47
8
 
9
  MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
 
86
 
87
  == Changelog ==
88
 
89
+ = 2.47 =
90
+ * Added: filter dropdown now includes icons from the 'automatic icons' setting (for use as a map legend)
91
+ * Fixed: editor spawner multiple icon color pickers, so popups were sometimes in the wrong position
92
+ * Changed: 'directions' and 'mashupClick' (POI click behavior for mashups) are now global, set them from the settings screen instead of the shortcode
93
+ * Changed: templates 'map.php' and 'map-list.php' were updated, please update any custom templates
94
+ * Changed: list CSS class 'mapp-pois'/'mapp-poi' were changed to 'mapp-items'/'mapp-item'
95
+
96
+ = 2.46.10 =
97
+ * Changed: pro updater cache name changed to 'mappress_updater_[action]'
98
+
99
  = 2.46.9 =
100
  * Fixed: POI editor error if tinyMCE is disabled in user settings
101
 
templates/map-controls.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class='mapp-controls'>
2
  <div data-mapp-position="TOP_LEFT" class='gmnoprint mapp-menu-toggle' data-mapp-action='menu-toggle' title='<?php _e('Menu', 'mappress-google-maps-for-wordpress');?>'></div>
3
  <div data-mapp-position="TOP_LEFT" class='gmnoprint mapp-menu'>
4
- <?php if ($map->options->editable) : ?>
5
  <div class='mapp-menu-item' data-mapp-action='viewport-set'><?php _e('Set center/zoom', 'mappress-google-maps-for-wordpress');?></div>
6
  <div class='mapp-menu-item mapp-active' data-mapp-action='viewport-reset'><?php _e('Clear center/zoom', 'mappress-google-maps-for-wordpress');?></div>
7
  <div class='mapp-menu-separator'></div>
1
  <div class='mapp-controls'>
2
  <div data-mapp-position="TOP_LEFT" class='gmnoprint mapp-menu-toggle' data-mapp-action='menu-toggle' title='<?php _e('Menu', 'mappress-google-maps-for-wordpress');?>'></div>
3
  <div data-mapp-position="TOP_LEFT" class='gmnoprint mapp-menu'>
4
+ <?php if ($map->editable) : ?>
5
  <div class='mapp-menu-item' data-mapp-action='viewport-set'><?php _e('Set center/zoom', 'mappress-google-maps-for-wordpress');?></div>
6
  <div class='mapp-menu-item mapp-active' data-mapp-action='viewport-reset'><?php _e('Clear center/zoom', 'mappress-google-maps-for-wordpress');?></div>
7
  <div class='mapp-menu-separator'></div>
templates/map-directions.php CHANGED
@@ -17,7 +17,7 @@
17
  <div class='mapp-dir-toolbar'>
18
  <a class='mapp-dir-google' href='#' data-mapp-action='dir-google'><?php esc_html_e('Google Maps', 'mappress-google-maps-for-wordpress'); ?></a>
19
  <span class='mapp-button-submit' data-mapp-action='dir-get'><?php esc_html_e('Get Directions', 'mappress-google-maps-for-wordpress'); ?></span>
20
- <span class='mapp-spinner' style='display:none'></span>
21
  </div>
22
  <div class='mapp-dir-renderer'></div>
23
  </div>
17
  <div class='mapp-dir-toolbar'>
18
  <a class='mapp-dir-google' href='#' data-mapp-action='dir-google'><?php esc_html_e('Google Maps', 'mappress-google-maps-for-wordpress'); ?></a>
19
  <span class='mapp-button-submit' data-mapp-action='dir-get'><?php esc_html_e('Get Directions', 'mappress-google-maps-for-wordpress'); ?></span>
20
+ <span class='mapp-spinner'></span>
21
  </div>
22
  <div class='mapp-dir-renderer'></div>
23
  </div>
templates/map-filters.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class='mapp-filters'>
2
  <div class='mapp-filters-list'>
3
- <?php $filter = new Mappress_Filter(array('key' => $map->options->filter, 'format' => null)); ?>
4
  <div class='mapp-filter mapp-<?php echo $filter->key; ?>'>
5
  <div class='mapp-filter-label'><?php echo $filter->get_label(); ?></div>
6
  <div class='mapp-filter-values'><?php echo $filter->get_html(); ?></div>
1
  <div class='mapp-filters'>
2
  <div class='mapp-filters-list'>
3
+ <?php $filter = new Mappress_Filter(array('key' => $map->filter, 'format' => null)); ?>
4
  <div class='mapp-filter mapp-<?php echo $filter->key; ?>'>
5
  <div class='mapp-filter-label'><?php echo $filter->get_label(); ?></div>
6
  <div class='mapp-filter-values'><?php echo $filter->get_html(); ?></div>
templates/map-header.php CHANGED
@@ -1,4 +1,7 @@
1
  <div class='mapp-header'>
2
- <div class='mapp-caret mapp-button' data-mapp-action='filters-toggle'><?php _e('Filter', 'mappress-google-maps-for-wordpress');?></div>
 
 
 
3
  </div>
4
 
1
  <div class='mapp-header'>
2
+ <div class='mapp-search-wrapper'>
3
+ <?php echo $map->part('filters-toggle');?>
4
+ <?php echo $map->part('search'); ?>
5
+ </div>
6
  </div>
7
 
templates/map-list.php CHANGED
@@ -1,8 +1,8 @@
1
  <div class='mapp-list'>
2
- <div class='mapp-pois'>
3
  <?php foreach($map->pois as $i => $poi) : ?>
4
  <?php if ($poi->type == 'kml') continue; ?>
5
- <div class='mapp-poi' data-mapp-action='open' data-mapp-poi='<?php echo $i;?>'>
6
  <div class="mapp-icon"><?php echo $poi->part('icon');?></div>
7
  <div class='mapp-title'><?php echo $poi->part('title');?></div>
8
  </div>
1
  <div class='mapp-list'>
2
+ <div class='mapp-items'>
3
  <?php foreach($map->pois as $i => $poi) : ?>
4
  <?php if ($poi->type == 'kml') continue; ?>
5
+ <div class='mapp-item' data-mapp-action='open' data-mapp-poi='<?php echo $i;?>'>
6
  <div class="mapp-icon"><?php echo $poi->part('icon');?></div>
7
  <div class='mapp-title'><?php echo $poi->part('title');?></div>
8
  </div>
templates/map.php CHANGED
@@ -11,5 +11,4 @@
11
  </div>
12
  <?php echo $map->part('directions'); ?>
13
  <?php echo $map->part('list-inline'); ?>
14
- <?php echo $map->part('footer'); ?>
15
  </div>
11
  </div>
12
  <?php echo $map->part('directions'); ?>
13
  <?php echo $map->part('list-inline'); ?>
 
14
  </div>