WordPress.org

Ready to get started?Download WordPress

Forums

Basic Google Maps Placemarks
[resolved] Custom icon/markers (12 posts)

  1. OC2PS
    Member
    Posted 2 years ago #

    Within each placemark special post, why not have a field for URL of custom marker?

    http://wordpress.org/extend/plugins/basic-google-maps-placemarks/

  2. Joyce
    Member
    Posted 2 years ago #

    +1

  3. JABŁOŃSKI
    Member
    Posted 2 years ago #

    I second that

  4. Gillian
    Member
    Posted 2 years ago #

    A great idea if feasible - I spend a reasonable time when creating each placemarker just browsing/searching the media library for and inserting the custom marker I want, a simple paste into a URL field would certainly speed things up.

  5. Luke Xie
    Member
    Posted 2 years ago #

    +1

  6. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    I agree that WordPress' current media library isn't very efficient, but I think it's important for plugins to use the core architecture as much as possible. I think that the media library is going to be getting a lot more attention in the next few WordPress releases, and hopefully that will make this process quicker.

    I also think that a lot of users wouldn't want to paste in the URL, because they're not familiar with what a URL is and how to get it. Also, the URL could break if the site is moved to a different URL.

    Can you guys describe the problem you have with the current method? There may be a better have to handle it.

    Also, if you're using the same icon for all placemarks, you can easily setup a filter to do change the default icon, and then you wouldn't have to set the featured icon at all. See the FAQ for details on that.

  7. OC2PS
    Member
    Posted 2 years ago #

    To tell you the truth, I just didn't know the "featured images" method. So basically, I didn't know how to set custom markers short of changing the functions.php of my theme.

    Now that I have figured it out, there doesn't seem to be a big problem, though media library could be more efficient.

    I would strongly recommend enabling users to change the default marker in the plugin's admin/config, though (as opposed to editing theme's function.php).

    Also, would be nice if you can enable animations like http://wordpress.org/extend/plugins/comprehensive-google-map-plugin/ does.

  8. Luke Xie
    Member
    Posted 2 years ago #

    What is the "featured images" method?

  9. OC2PS
    Member
    Posted 2 years ago #

    WordPress allows you to assign featured images to posts. You will see a button in bottom right corner of the edit post page.

    If you assign an images as featured image for a placemark, it will appear as its marker on the map.

  10. Gillian
    Member
    Posted 2 years ago #

    Hi Ian

    I have tried to set up an alternative default icon following your instructions at the end of the FAQ, but I can't get it to work. I expect that I either haven't got the pathing to my new default icon correct, or I'm inserting the URL in the wrong place. Would you mind confirming where and how the "full URL to the new icon" should be put in the function?

    Using your first example in the FAQ, I thought the URL should go in the function's "return get_bloginfo" line, like this

    return get_bloginfo( 'stylesheet_directory' ) . 'http://www.mydomain/images/mydefaulticonname.png';
    but the icon is not found and so the marker doesn't appear on the map.

    Thanks in advance for any advice you can offer.

    Ridgididgi

  11. Ian Dunn
    Member
    Plugin Author

    Posted 2 years ago #

    No, the get_bloginfo( 'stylesheet_directory' ) part is going to be translated to something like 'http://your-domain.net/wp-content/themes/your-theme/', so you want to do something like

    `return get_bloginfo( 'stylesheet_directory' ) . '/images/mydefaulticonname.png';

    and then put the image inside the '/wp-content/your-theme/images/' directory.

    Or, you could do something like

    return 'http://www.mydomain/images/mydefaulticonname.png';

    and put the image in the /images directory.

  12. Gillian
    Member
    Posted 2 years ago #

    Many thanks for correcting my muddled understanding, Ian - much appreciated.

    It is all working properly now :-)

    Happy New Year!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic