Hide shapes on mashup

Home Forums MapPress Support Hide shapes on mashup

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #17727
    monsieurgraphiste
    Participant

      Hi Chris,

      Is there a way to hide polygons, circles on a mashup map ?

      Thanks in advance for your reply.

      #17730
      Chris
      Keymaster

        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');
        
        #17734
        monsieurgraphiste
        Participant

          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

          #17735
          Chris
          Keymaster

            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.

            #17736
            Chris
            Keymaster

              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.

              #17738
              monsieurgraphiste
              Participant

                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

                #17741
                Chris
                Keymaster

                  Hi,

                  I’m glad it’s working! The option to suppress the CSS has been removed.

                Viewing 7 posts - 1 through 7 (of 7 total)
                • You must be logged in to reply to this topic.