Title: Custom Map Marker
Last modified: September 8, 2017

---

# Custom Map Marker

 *  [thienD](https://wordpress.org/support/users/thiend/)
 * (@thiend)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/custom-map-marker/)
 * Hi, is there a way to use custom map markers for each category with this plugin?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/custom-map-marker/#post-9479799)
 * 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](https://wordpress.org/support/users/thiend/)
 * (@thiend)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/custom-map-marker/#post-9479950)
 * 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](https://wordpress.org/support/users/iandunn/)
 * (@iandunn)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/custom-map-marker/#post-9552474)
 * 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.

 * ![](https://ps.w.org/basic-google-maps-placemarks/assets/icon-128x128.png?rev
   =1152531)
 * [Basic Google Maps Placemarks](https://wordpress.org/plugins/basic-google-maps-placemarks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/basic-google-maps-placemarks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/basic-google-maps-placemarks/)
 * [Active Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/basic-google-maps-placemarks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/basic-google-maps-placemarks/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Ian Dunn](https://wordpress.org/support/users/iandunn/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/custom-map-marker/#post-9552474)
 * Status: not resolved