Forum Replies Created
-
AuthorPosts
-
Hi,
You are correct, thanks for letting me know – a change in the build process caused those files to be deleted.
Could you please try with 2.53.7 and let me know how that works for you?
Hi,
That message isn’t from MapPress, and it sounds like a theme problem – what does their tech support suggest?
Perhaps you could switch themes, and then update MapPress.
Hi,
It looks like this is due to the theme interfering with the Leaflet map styles. I’ve pasted one of the relevant theme sections below.In most browsers you can open development tools using F12, which will let you see what CSS is applied to a particular element.For example, it looks like the theme is applying background: #fff to ALL images on the page, including the map icons.Some options to fix it include:a) Switch themesb) Remove that CSS from the theme’s ‘styles.css’c) Add you own override at the bottom of syles.css, for example:.mapp-layout img { background: none !important; }Here’s the styles.css section:.post img, .type-page img, .type-feature img, .type-testimonial img, .type-portfolio img, .search-results .page img, .search-results .type-product img, .search-results .type-feature img, .search-results .type-testimonial img, .search-results .type-portfolio img, .post img.thumbnail, .type-page img.thumbnail, .type-feature img.thumbnail, .type-testimonial img.thumbnail, .type-portfolio img.thumbnail, .search-results .page img.thumbnail, .search-results .type-product img.thumbnail, .search-results .type-feature img.thumbnail, .search-results .type-testimonial img.thumbnail, .search-results .type-portfolio img.thumbnail { /* padding: .53em; */ /* border: 1px solid #eaeaea; */ background: #fff; max-width: 100%; height: auto; }Hi,
I started simple with this shortcode, but got no results:
[mashup query="post_type=Event"]
The problem is the query needs the post_type slug not it’s name. From the CPT plugin, we can see the slug for ‘Event’ posts is ‘events’. So this query works:
[mashup query="post_type=events"]
Adding the date and meta_compare also seemed to work:
[mashup query="post_type=events&meta_key=expires&meta_value=2020-02-04&meta_compare=>"]
Hopefully the problem was just the slug, and that’s enough to help you get the PHP code working.
Hi,
I gave an example earlier using post date, but for a custom field the query would be:
[mashup query="post_type=Event&meta_key=Expires&meta_value=20200201"]
However, unlike queries by post_date, WP doesn’t provide any way to pass a dynamic date for the meta_value in the query string.
One solution is to add some PHP to one of your theme’s template files to generate the map instead:
<?php $date = date('Ymd'); $query = "post_type=Event&meta_key=Expires&meta_value=$date"; echo do_shortcode('[mashup query="' . $query . '"]'); ?> ?>Hi,
I don’t see anything wrong with the shortcode, so my guess is the Views plugin is using its own internal query to generate the list. You can ask the Views developer if there’s a way to set the global $wp_query, which would make that query data available to MapPress and other plugins.
Alternatively, you can use the map POI list. That brings us to your original question about how to specify ‘today or later’ in the query string. WordPress supports date queries using a date_query array (see here for details). For example, to show everything since yesterday the query would be:
query="date_query[0][after]=now-1day"
Unfortunately, WordPress strips out braces inside shortcodes, so the above won’t work in the [mashup] shortcode. A workaround is to use the HTML codes %5b and %5d instead of brackets:
[mashup query="date_query%5b0%5d%5bafter%5d=now-1day"]
That’s hard to read, and I often get questions about this, so I’ve added a patch to MapPress to allow curly braces instead (if you’d like to try the patch, please send a login and I’ll install it for you to test). With the patch installed, the shortcode would be:
[mashup query="date_query{0}{after}=now-1day"]Also – if you search for posts with future dates, I think WordPress will only show private posts owned by the current user. So you may need to add the ‘future’ status to the query:
[mashup query="post_status=publish,future&date_query{0}{after}=now-1day"]Hi,
If you’d like to paste the ‘current’ query into the ‘alerts’ page you listed, I’ll take a look to see if something simple is amiss that is causing the query to be ignored.
When the mashup query is ‘current’, MapPress displays locations based on the posts in the WordPress global query object ($wp_query). Normally this is set to the posts you’re currently viewing.
If the Views plugin isn’t setting that global query properly, it won’t be possible to sync the map with the list of posts. You might try using the mashup POI list instead, which is always linked to the map.
Hi,
The mashup will display all the results that match the query, and it ignores the posts_per_page parameter. If you just want to display locations from the the current page in the blog, this should work instead:
[mashup query="current"]
Hi,
Is this how the code looks?
$props[['message']]
If so, it should have only single brackets:
$props['message']
November 9, 2019 at 10:43 am in reply to: Does MapPressPro integrate with any of the forms plugins? #18419Hi,
I know some customers use Formidable and ACF. Maybe someone who has experience with them will reply, but I can at least give you a little background info:
- MapPress doesn’t have any specific integration to forms plugins. However, it can generate maps from post custom fields (on the back-end), and forms plugins can create custom fields, for example an address field.
- There is built-in, configurable filtering functionality for the maps, as well as displaying a POI list. If those meet your needs, they’ll be a lot easier than integrating a form plugin.
- If you want to have the map center on a specific POI from an element external to the map, you can do it with a little JavaScript. The maps and POIs are numbered from zero, so this would center on the first POI on the first map:
<div onclick='mapp0.pois(0).center()'>
I hope that helps!
Hi,
The plugin always uses Algolia to display the search box of possible addresses, but it will use MapBox to resolve them to latitude/longitude.
The goal of doing it this way is to get the increased accuracy of MapBox, without using consuming the MapBox usage limit on every keystroke in the autocomplete.
Sorry, but that’s not possible. You can double-click the map to zoom in, or use the buttons.
Hi,
Sorry for the confusion, I think I misunderstood your original question. This should help:
To control what happens when a marker is clicked: use the settings ‘open POI’, ‘open post’, and ‘open post in new tab’. One of these options (‘open post’) wasn’t working properly – I had planned to deprecate it, but left it on the settings screen. This is fixed in 2.53.3.
To control what happens when the POI title is clicked (I think this is what you want to do): use the ‘templates’ section in the MapPress settings to edit the ‘mashup popup’ template. In that template you’ll see:
<div class='mapp-title'><a href='{{{poi.url}}}' target='_blank'>{{{poi.title}}}</a>Just change it to this (remove the target=’_blank’) and save:
<div class='mapp-title'><a href='{{{poi.url}}}'>{{{poi.title}}}</a>Hi Jay,
Per our emails on this, the problem was due to a change by MapBox. Their styles used to be prefixed with ‘http://’ but now they’re ‘mapbox://’. MapPress 2.53.2 should work with both URL types.
Hopefully this will help anyone else having the same issue.
Are you using Leaflet or Google? Leaflet is “scrollwheelzoom”, Google is “scrollwheel”.
-
AuthorPosts
