BGMP creates a
custom post type for placemarks (markers) on a Google Map. The map is embedded into pages or posts using a shortcode, and there are settings to affect how it's displayed. You can create markers that will show up on the map, and set their icons using the Featured Image meta box. When a marker is clicked on, a box will appear and show the marker's title and description.
Features
- Each map marker can have a unique custom Installation icon, share a common custom icon, or use the default icon.
- Options to set the map type (street, satellite, etc), center location, size, zoom level, navigation controls, etc.
- Setup unique maps on different pages with their own placemarks, map types, center locations, etc.
- Placemarks can be assigned to categories, and you can control which categories are displayed on a individual map.
- Marker clustering for large numbers of placemarks
- Extra shortcode to output a text-based list of markers for mobile devices, search engines, etc.
- Lots of filters so that developers can customize and extend the plugin.
- Use HTML, images, etc inside the information window.
- Compatible with WordPress MultiSite.
- Internationalized (see Other Notes for a list of supported languages)
Live Examples
Support
I'm happy to fix reproducible bugs, but don't have time to help you customize the plugin to fit your needs. There's also plenty of documentation and community support available. Check out the 'How can I get help when I'm having a problem?' question in
the FAQ for details.
For help installing this (or any other) WordPress plugin, please read the
Managing Plugins article on the Codex.
Basic Usage:
- After activating the plugin, go to the 'Basic Google Maps Placemarks' page under the Settings menu. Enter the address that the map should be centered on.
- Create a page or post where you'd like to embed the map, and type
[bgmp-map]
in the content area.
- Go to the Placemarks menu and click 'Add New'. Enter the title, address, etc.
- Click on 'Set Featured Image' to upload the icon.
- Click on the 'Publish' or 'Update' button to save the placemark.
Advanced Usage:
Multiple maps with different locations, zoom levels, etc:
- Just add the extra parameters to the [bgmp-map] shortcode. Here's an example of the different ones you can use:
[bgmp-map categories="parks,restaurants" width="500" height="500"]
[bgmp-map placemark="105" center="chicago" zoom="10" type="terrain"]
Multiple maps with different placemarks:
- Go to the Placemarks menu and click on Categories, and add a category for each set of placemarks.
- Edit your placemarks and click on the category you want to assign them to.
- Edit the place where the map is embedded and add the category parameter to the shortcode. For example: [bgmp-map categories="restaurants,record-stores"] or [bgmp-map categories="parks"]. Use the category's slug, which is displayed on the Categories page in step 1. Separate each slug with a comma.
- You can add the [bgmp-map] shortcode to multiple pages, each time using a different set of categories.
Setting the stacking order of overlapping markers:
- Choose which placemark you want to appear on top and edit it.
- Enter a number in the Stacking Order meta box in the right column that is greater than the other placemark's stacking order.
Adding a text-based list of placemarks to a page:
- Edit the post or page you want the list to appear on.
- Type
[bgmp-list]
in the context area.
- Click the 'Publish' or 'Update' button.
- (optional) You can specifiy a specific category or categories to pull from. e.g., [bgmp-list categories="record-stores,parks"]
- (optional) You can add "View on Map" links to each item in the list, which will open the corresponding marker's info window. e.g., [bgmp-list viewonmap="true"]
Using [bgmp-map] in a template file with do_shortcode():
For efficiency, the plugin only loads the required JavaScript, CSS and markup files on pages where it detects the map shortcode is being called. It's not practical to detect when
do_shortcode() is used in a template, so you need to manually let the plugin know to load the files by adding this code to your theme:
`
function bgmpShortcodeCalled()
{
global $post;
$shortcodePageSlugs = array(
'hello-world',
'second-page-slug'
);
if( $post )
if( in_array( $post->post_name, $shortcodePageSlugs ) )
add_filter( 'bgmp_map-shortcode-called', '__return_true' );
}
add_action( 'wp', 'bgmpShortcodeCalled' );
`
Copy and paste that into your theme's
functions.php file or a
functionality plugin, update the function names and filter arguments, and then add the slugs of any pages/posts containing the map to $shortcodePageSlugs.
That won't work for the home page, though. If you want to target the home page, or any other pages with
conditional tags, you can do it like this:
`
function bgmpShortcodeCalled()
{
global $post;
if( ( function_exists( 'is_front_page' ) && is_front_page() ) || ( function_exists( 'is_home_page' ) && is_home_page() ) )
add_filter( 'bgmp_map-shortcode-called', '__return_true' );
}
add_action( 'wp', 'bgmpShortcodeCalled' );
Before version 1.9, you needed to use the
bgmp_map-shortcode-arguments
filter to pass shortcode arguments when calling
do_shortcode()
from a template, but that is no longer necessary. You can simply pass the arguments in the
do_shortcode()` call, like this:
do_shortcode( '[bgmp-map center="Boston" zoom="5"]' );
Check
the FAQ and
support forum if you have any questions.
Localizations
If there isn't a translation for your language (or it is incomplete/inaccurate) please consider making one and contributing it to the plugin. You can learn how by reading
Translating WordPress and
How to Create a .po Language Translation. The .pot file you'll need is inside the
languages directory in the plugin's folder. Once you're done, just start a thread on
the support forum with links to the .po and .mo files, and I'll add them to the next release. You can also subscribe to
the BGMP Translators e-mail list to be notified when updated versions have new strings to translate.
Known conflicts
How you can help with the plugin's development
- The thing I could really use some help with is answering questions on the support forum. I don't have a lot of time to work on the plugin, so the time I spend answering questions reduces the amount of time I have to add new features. If you're familiar with the plugin and would like to help out, you can click the 'Subscribe to Emails for this Plugin' link to get an e-mail whenever a new post is created.
- Translate the plugin into your language. See the Localizations section above for details.
- Volunteer to test new versions before they're officially released. Sign up for the BGMP Testers e-mail list to be notified when new release candidates are available for testing.
- If you find a bug, create a post on the support forum with as much information as possible. If you're a developer, create a patch and include a link to it in the post.
- Send me feedback on how easy or difficult the plugin is to use, and where you think things could be improved. Add a post to the support forum with details.
- Send me feedback on ways the documentation could be more clear or complete. Add a post to the support forum with details.
- Review the code for security vulnerabilities and best practices. If you find a security issue, please contact me privately so that I can release a fix for it before publicly disclosing it.
- Check the TODO.txt file for features that need to be added and submit a patch.
Donations
I do this as a way to give back to the WordPress community, so I don't want to take any donations. If you'd like to give something, though, I'd encourage you to make a donation to
Doctors Without Borders or the
WordPress Foundation.
Customization
If you need to customize BGMP and a solution isn't already available in the forums, the best thing to do is to hire a developer.
Your local WordPress Meetup is a great place to meet one, or you can also check out
jobs.wordpress.net.
If you make customizations that could be beneficial to other users, please start a thread on
the support forum with a description of them and a link to the source code.