Reply To: Set Location value on Map Field Type

Author Replies
traversal # Posted on March 31, 2014 at 10:01 pm

Hey Mary,

Sorry, I don’t quite understand the specifics. Are you trying to get the map to display in your template?

If that’s what you’re trying to do, the best way to do this involves 2 steps. First, add helper code for the map, to output the scripts necessary to embed the map, as shown in this gist:

https://gist.github.com/traversal/e6756ddc7344460159c5

Next, supposing you had a field set called details, and a field named location, add the following code into your theme:

https://gist.github.com/traversal/9aaac546639c85f9d418

That will output a div with the class “mp-map” and a script which will embed the map at the selected location. This div is classed with “mp-map” which can be styled with CSS to allow you to tweak the width and height etc.

Does that help? Let me know if I’ve misunderstood the question.

Sorry about the gap in the documentation for this. The map class is now listed in the class reference, but there is still not enough info on how to embed. I’ll get onto that.

Regards

Travis

Latest From the Blog

MasterPress 1.1.4 now available

MasterPress 1.1.4 is now available. This release contains an important compatibility fix for WordPress 4.5 to allow correct detection of the taxonomy term editing screen. Without this fix, any custom fields you have attached to custom taxonomies will not be shown at all in the editing form. Note also that MasterPress will still detect the edit screen correctly in… 

Plugin Requirements

MasterPress requires a minimum of WordPress version 3.4, MySQL 5, and PHP version 5.2.4.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Traversal