Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ian Dunn

    (@iandunn)

    The only way to do it via the UI is to manually assign them to each placemark. It can be done automatically with a little bit of code; there’s an example in the FAQ.

    Thread Starter thienD

    (@thiend)

    So I did this, replacing the slugs with my slugs and the files with mine. The place markers just all disappear. What am I missing?

    function setBGMPDefaultIconByCategory( $iconURL, $placemarkID )
    {
    $placemarkCategories = wp_get_object_terms( $placemarkID, ‘bgmp-category’ );

    foreach( $placemarkCategories as $pc )
    {
    switch( $pc->slug )
    {
    case ‘fob’:
    $iconURL = get_bloginfo( ‘stylesheet_directory’ ) . ‘/images/marker-icons/fob.png’;
    break;

    case ‘home-base’:
    $iconURL = get_bloginfo( ‘stylesheet_directory’ ) . ‘/images/marker-icons/hb.png’;
    break;

    default:
    $iconURL = get_bloginfo( ‘stylesheet_directory’ ) . ‘/images/marker-icons/pin.png’;
    break;
    }
    }

    return $iconURL;
    }
    add_filter( ‘bgmp_default-icon’, ‘setBGMPDefaultIconByCategory’, 10, 2 );

    Plugin Author Ian Dunn

    (@iandunn)

    I’d check the URL that’s being generated, to make sure it’s correct. IIRC, stylesheet_directory is the file path on the server, not the URL. get_stylesheet_directory_uri() is probably what you want.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Map Marker’ is closed to new replies.