Plugin / Basic Google Maps Placemarks

Ian Dunn

Installation

Installation

For help installing this (or any other) WordPress plugin, please read the Managing Plugins article on the Codex.

Basic Usage:

  1. 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.
  2. Create a page or post where you’d like to embed the map, and type [bgmp-map] in the content area.
  3. Go to the Placemarks menu and click ‘Add New’. Enter the title, address, etc.
  4. Click on ‘Set Featured Image’ to upload the icon.
  5. Click on the ‘Publish’ or ‘Update’ button to save the placemark.

Advanced Usage:

Multiple maps with different locations, zoom levels, etc:

  1. 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:

  1. Go to the Placemarks menu and click on Categories, and add a category for each set of placemarks.
  2. Edit your placemarks and click on the category you want to assign them to.
  3. 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.
  4. 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:

  1. Choose which placemark you want to appear on top and edit it.
  2. 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:

  1. Edit the post or page you want the list to appear on.
  2. Type [bgmp-list] in the context area.
  3. Click the ‘Publish’ or ‘Update’ button.
  4. (optional) You can specifiy a specific category or categories to pull from. e.g., [bgmp-list categories=”record-stores,parks”]
  5. (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.

Ratings

4.4
50 reviews

Rating breakdown

Details Information

Version

1.10.7

First Released

04 May, 2015

Total Downloads

190,608

Wordpress Version

3.1 or higher

Tested up to:

4.8.11

Require PHP Version:

-

Tags

Contributors

Languages

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.