- This topic has 6 replies, 2 voices, and was last updated 5 years, 6 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Home › Forums › MapPress Support › Hide shapes on mashup
Hi Chris,
Is there a way to hide polygons, circles on a mashup map ?
Thanks in advance for your reply.
Hi,
There are at least two ways:
1. KML files are suppressed by default, so you could draw the shapes in Google Earth or another KML editor, and then add that file as a POI.
2. You can use filter mappress_query_filter
to filter out the POIs you don’t want. This is called just after the mashup query, but before display. POIs that represent shapes will have poi->type set to one of [‘circle’, ‘rectangle’, ‘polyline’ or ‘poly’]. All shapes also have poi->poly set.
Here’s an example of a filter you could add to functions.php to remove all shapes:
function myfilter($map) {
$pois = array();
foreach($map->pois as $poi) {
if (!$poi->poly)
$pois[] = $poi;
}
$map->pois = $pois;
return $map;
}
add_filter('mappress_query_filter', 'myfilter');
Hi Chris,
Thanks for your reply, I added the filter on the functions.php file but it doesn’t work.
Do i need to add something on the [mashup] shortcode ?
FYI I have version 2.44 of your plugin.
Thanks
Hi,
You don’t need anything in the shortcode, but you will need to upgrade to the current version – the filter wasn’t present in older versions.
I think it should work once you do that.
Hi,
You don’t need anything in the shortcode, but you will need to upgrade to the current version – the filter wasn’t present in older versions.
I think it should work once you do that.
Hi Chris,
Thank you for your reply, it works perfectly.
In the new version of the plugin, there is no more options to unload the css file ?
Thanks
Hi,
I’m glad it’s working! The option to suppress the CSS has been removed.