A mashup map is one that uses marker content from more than one source and displays it on a single Google Map. For example, a user could combine the location data from several post types to display travel destinations around the world or other points of interest.
Mashups are a very powerful feature of Maps Builder Pro. They allow you to automate outputting markers on your map via any posts on your site. Whether your post type has its own location data or not, Maps Builder can be configured to display your posts dynamically on your map. Here’s a simple walk-through of how it’s done.
Enable the Mashup Metabox for your Post Type
If the posts that you want to display on your map do not already have location fields, you can add them via the Maps Builder settings.
- Go to “Google Maps > Settings” and then the “General Options” tab.
- At the bottom you’ll see the “Mashup Metabox” setting. Enable any posts there that you would like to have our location metabox added to.
This will enable our location metabox to appear on that post type. You can see above that we’ve added the metabox to our “WordCamps” post type.
Add Locations to your Posts
Next, go to your posts. Now you’ll notice the Metabox there on the right hand side. Our metabox will automatically populate the location once you start typing it into the field. When you select your location it will automatically populate the longitude and latitude fields that your map needs in order to create the marker.
You’ll need to add these locations to all your posts that you want populated on the map.
Configure your Map to populate these locations
Once all your locations are added to all your posts, head over to the map. You’ll notice the “Mashups” section now. That is where you’ll tell this map to populate it’s markers from a certain post type. Here’s all the settings you need to understand:
This is where you choose the post type that will populate the map.
If your post type supports taxonomies (like Categories) then you can filter your post type by category. This means that you could have a different mashup, or a different map for every category of your Posts if you wanted.
If you chose to filter by Taxonomy, you’ll notice that this area is now populated with all the supported “terms” of that “taxonomy”. For example, if you chose “Category” for your Posts, here you would see the name of all those Categories and you could then choose them.
Latitude Field and Longitude Field
If you are using our metabox to populate the location for each post, then these fields are populated for you automatically (you’ll see “_gmb_lat” and “_gmb_lng”). Otherwise, you can choose from the list of available fields to locate the location field for your post type. For example, you might have a plugin that allows you to create “Properties” for sale for a Realtor’s website. This post type will have an address field, perhaps named “_prop_lat” and “_prop_lng”. You can choose those instead of our Mashup Metabox fields.
Show Featured Image
This allows you to show the featured image of each post within the “Infobubble” when users click on this locations marker.
Custom Mashup Marker
If you want to have this mashup have a custom marker, this is where you do that.
Marker Load Status
This field is useful for seeing the status of the markers in your mashup. For example, in the image below you can see that the “WordCamp Los Angeles” post does not have a latitude or longitude value and therefore it can’t be output on the map.
Load Your Markers
Once you have that all configured, hit the “Load Markers” button and you’ll see the status for each marker appear in the “Marker Load Status” field and you’ll see each marker added to your map one at a time. Click “Update Map” and you’re done!