Add Icon to the [mappress] short code

Home Forums MapPress Support Add Icon to the [mappress] short code

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17908
    Foster
    Participant

      In the [mappress short code] is there a way to tell it which icon to use for the POI?

      Thanks!
      Foster

      #17910
      Chris
      Keymaster

        Hi,

        The shortcode just displays a map, it doesn’t contain the POI info like address, icon, etc.

        Normally, you can change the icon by just editing the map. Click on the POI, then click on the icon in the POI infowindow to change it.

        There’s also an ‘automatic icon’ section in the MapPress settings screen, which can be used to default the icon based on tag/category, etc.

        Please see the documentation for more details on both approaches above.

        #17916
        Foster
        Participant

          I got the icon to work using the extension. I’m using pods, so I had to use this section of PHP to make it fly.

          function my_meta_update($meta_id, $object_id, $meta_key, $meta_value) {

          if ( ‘city’ === $meta_key ||
          ‘state’ === $meta_key ||
          ‘street’ === $meta_key ||
          ‘zipcode’ === $meta_key ||
          ‘map_icon’ === $meta_key )
          do_action(‘mappress_update_meta’, $object_id);
          }

          add_action(‘added_post_meta’, ‘my_meta_update’, 10, 4);
          add_action(‘updated_post_meta’, ‘my_meta_update’, 10, 4);
          add_action(‘deleted_post_meta’, ‘my_meta_update’, 10, 4)

          Thanks!
          Foster

          #17917
          Chris
          Keymaster

            Hi,

            I think you’re asking about the geocoding settings on the MapPress settings screen.

            I’m not sure why you needed the extra code. It looks a lot like what’s built into the ‘mappress_meta.php’ file, which also watches the meta events, and updates the map if the meta values have changed.

            Maybe it’s something to do with ‘pods’ (I’m guessing that’s a custom fields plugin?). Anyway, I’m glad you got it working.

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