MapPress FAQ

‘Oops’ Error and Google Maps API Keys

Google now requires an API key to use the maps API. 

If your key isn’t working

  1. Open the JavaScript console and check the error message from Google. 
  2. If you have a referrer error, check that you entered the referrers using Google’s format (*.example.com/*)
  3. Be patient: changes in the developer console can take up to five minutes to update

Get a Browser API key

  1. Use this link to go to the Google Developer Console 
  2. From the projects list, select a project or create a new one
  3. Click Continue to enable the API and any related services.
  4. On the Credentials page, get an API key
  5. It is usually easiest to start with an unrestricted key, but if you want you can secure the key so it can only be used specific web sites::
    a) Select Restrict key to set a browser restriction on the API key.
    b) In the Key restriction section, select HTTP referrers (web sites), then follow the on-screen instructions to set referrers.
  6. Copy the API key and click ‘OK’.  Paste the key into the MapPress settings screen.

Note: the provided Google Developer Console link should automatically enable the correct APIs.  If you need to enable them manually, go to the Library menu and enable the following APIs: Google Maps Javascript API, Google Places API Web Service, Google Maps Geocoding API, Google Maps Directions API, Google Maps Geolocation API

Get a Server Key

A server key is only required for MapPress Pro, and only if you wish to use the geocoding function to generate maps from custom fields.  If you have left your browser key unrestricted, you can use the same key. 

However, if you restricted the key by HTTP referrers, it won’t work because the geocoding API calls come from your server, not from a specific web site.  You will need to generate a new key and restrict it by your server’s IP address:

  1. Follow the steps above to create a new key
  2. This time, choose Restrict key and select IP addresses in the Key restriction section. 
  3. Enter your server’s IP address

Test / Local Keys

If you left your browser key unrestricted, you can use it on local servers (like “localhost”).  However, if you restricted the key by HTTP referrers, you will need follows the steps above to generate additional, unrestricted keys for local testing. 

Maps API Loaded Multiple Times

Google only allows the maps API to be loaded once per page.  Sometimes another plugin or the theme will load the API, in addition to MapPress.  This can cause unusual errors:

  • Map can’t be dragged
  • Missing controls or icons
  • No map display

Check the browser’s JavaScript console for an error indicating the maps API is loaded multiple times.  If so, deactivate the other plugin entirely, or disable the maps function in your theme,  Most themes include a checkbox for this purpose, or you can contact the author to ask how to do it. 

For plugins, you may be able to keep both plugins working by changing the activation order of MapPress and the other plugin. 

Map Isn’t Displayed

These are the most common issues:

  1. Error in another plugin or theme
    Disable all of your plugins and switch to a standard theme (for a moment).  If you now see your map, re-activate until you find the error. 
  2. Maps API loaded multiple times
    See the section above on this topic.
  3. Theme is missing the wp_footer() call
    See here for details: http://codex.wordpress.org/Function_Reference/wp_footer
  4. Theme or plugin loads obsolete version of jQuery 
    If the jQuery version is too old, you’ll see an error in your browser’s javacript console.  The minimum version is 1.7 (released 4 years ago).  You’ll need to update the theme or plugin or deactivate it.
  5. “Minifier” plugins
    Exclude the MapPress files (mappress.min.js) or Google URL (maps.googleapis.com) from your minifier plugin.

Map Won’t Save

This is caused by  errors in another plugin or the theme.  Disable all plugins and switch to a standard theme (for a moment).  If you now see your map, re-activate until you find the problem. 

Will I Lose my Maps when I Upgrade to Pro?

Don’t worry – your maps will continue to work.  You’ll gain all the new Pro features but your existing maps are fully compatible.

Map is grey or only a corner of the map displays

Google maps do not display properly when they are inside an element that is initially hidden, such as a hidden tab, slider, accordion, etc.  MapPress includes a workaround for jQuery UI TabsFor other libraries or controls, you’ll need to implement your own solution using Javascript. 

When a hidden element is displayed, you can redraw the map by calling its resize() method.  For example to redraw the first map on the screen use:
mapp0.resize();

This example redraws maps inside elements with class ‘mycontrol’ when the element is clicked.  Note that setTimeout is only needed if there is an animation (such as sliding into place) that must complete before the map is resized:

jQuery(document).ready(function() {
    jQuery('.mycontrol').on('click', function() {
        jQuery(this).find('.mapp-canvas').each(function() {
            var id = jQuery(this).attr('id');
            var map = window[id];
            setTimeout(function() {
                map.resize();
            }, 350);
        });
    });
});

POIs are in the Ocean near Africa

This happens when a POI can’t be geocoded.  Either the POI location is invalid or you are over your Google query limit.  See the documentation for information about query limits.

Can’t change marker icons

MapPress Pro is required to change the map icons.  

Map exists but doesn’t appear in the post

Check that a shortcode is present in the post.  The documentation shows you how to do it step by step.

Post displays [mappress] shortcode instead of the map

This indicates MapPress has been deactivated or it can occur because of a very old WordPress bug: each shortcode must be on a separate line.  Edit the post and check that there is a carriage return between shortcodes and any surrounding text.

Translating MapPress

WordPress plugin translations are created using the POEdit utility. MapPress translation files are stored in the languages directory of the plugin. 

Creating a New Translation

  1. Download the latest POEdit
  2. Run POEdit and open the master file mappress.pot or mappress.po from the languages directory of the MapPress plugin
  3. Use the menu File->Save as to save it as a .po file (a translation).  The file name must include an extension for your language.  For example, ‘mappress-es_ES.po’  is for Spanish.  A list of valid language extensions is here.
  4. Translate the strings.
  5. When you’re done use menu ‘file->save’ to save the file again.  POEdit should create a .MO file (a compiled translation) with the same base name as your .PO file.
  6. Send me both the .PO and .MO files, and I’ll include them with all future versions of MapPress!

Updating an Existing Translation

MapPress texts change frequently so you may find there is an existing .PO file for your language but the translation isn’t up to date.  If that happens:

  1. Run POEdit and open the .po file.  For example, for Spanish open mappress-es_ES.po
  2. Use the menu Catalog->Update from POT file. Select the file mappress.pot or mappress.po
  3. Update any missing strings.
  4. Correct any fuzzy strings (they appear in a different color at the top of the file).  For each one, click on menu Edit->Translation is Fuzzy to remove the fuzzy indicator.  You can also hit ALT-U.
  5. Save your .PO file.  POEdit should re-generate the corresponding .MO file.
  6. Send me both the .PO and .MO files, and I’ll include them with all future versions of MapPress!

Still Stuck?

I’ll be happy to help.  Please contact me and let me know you’ve already taken the steps listed above.  Please send everything I might need to reproduce the problem, including any error messages and a URL or screenshots illustrating the problem.