[Resolved] [Plugin: Basic Google Maps Placemarks] Custom icon/markers
Within each placemark special post, why not have a field for URL of custom marker?
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.
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.
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.
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.
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.
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
and put the image in the
- The topic ‘[Resolved] [Plugin: Basic Google Maps Placemarks] Custom icon/markers’ is closed to new replies.