WordPress.org

Ready to get started?Download WordPress

Forums

SIMPLEMAP plugin - custom markers (3 posts)

  1. emazero
    Member
    Posted 2 years ago #

    hello
    can't find how to customize markers in simplemap plugin.
    anyone knows how to?
    I didn't find any solutions about...
    please help me

    thanks
    ema

  2. Mark
    Member
    Posted 2 years ago #

    Add the code below to the functions.php file for your theme. Then put an image called marker.png into the images subdirectory of your theme. That's it.

    add_action( 'wp_head', 'custom_markers' );
    
    	function custom_markers() { 
    
    		?>
    		<script>
    			function simplemapCustomMarkers() {
    				var blueIcon = new GIcon(G_DEFAULT_ICON);
    				blueIcon.image = "<?php echo get_bloginfo('stylesheet_directory') ?>/images/marker.png";
    				return { icon: blueIcon };
    			}
    		</script>
    		<?php
    
    	}
  3. Glenn Ansley
    Member
    Posted 2 years ago #

    This only works 2.3 and below. There is updated code for 2.4+ with Google's updated API.

Topic Closed

This topic has been closed to new replies.

About this Topic