Product Support

Locations Map

Shows a customizable Google map with location markers for all your Participants Database records.

Product Setup

First install and activate the plugin. This will add the “Locations Map” menu item to the Participants Database admin menu. Click that item to open the Locations Map settings screen. The first step is to get your API key.

Getting Your API Keys

To use Google maps services, you must have an API key. It’s no big deal: they are free, you just have to have a Google account, and then set up the API access through Google Developers.

  1. Visit https://cloud.google.com/maps-platform/
  2. Click on Get Started, you may be asked to log in to your Google account
  3. Select Maps, click continue
  4. Select or Create a Project: Just create a new project and give it the name of your website
  5. The project will be created, it can take several seconds
  6. Set up billing: Google requires that you have a billing account in case you start to run up charges (you probably won’t…see below)
  7. The Maps API will be enabled
  8. You will then be given your API key. Copy this and paste it into the “Maps JavaScript API Key” setting in the Locations Map settings.
  9. Go to your Google Cloud APIs Dashboard, make sure you have the right project selected, then on the left, select “Credentials.”
  10. Add another API key by clicking on the “Create credentials” button. This will be used for Geocoding, so give it a name that identifies it for that purpose. Paste it into the “Geocoding API Key” setting.

Google Maps Services is Free—To a Point

For each service used, Google provides a limited number of free loads (every time someone loads a page with a map on it, that’s one load). Unless your site has very high volume, it won’t cost you anything to show maps. This plugin uses three Google services: Dynamic Maps, Static Maps and Geocoding.

Every time a page with a dynamic map is opened on your site, it will generate a Dynamic Map load. You can have up to 28,000 of those per month for free. You’d probably have to be getting several thousand visits a month (with them all seeing your map) to hit that.

Static Maps has higher limits: you’ll get 100,000 free map loads per month with those. Static maps lack the user interactivity of dynamic maps, but they are cheap, fast and really all you need for many applications.

Geocoding also has limits, but it’s not used very often. We only need to geocode when a record is created or updated. You’ll get 40,000 of those for free per month.  If you have a lot of records, you might get over that number when you geocode the entire batch, but after that you’re unlikely to hit charges for geocoding.

Get all the details in the Google Maps Pricing Table…

Once you have the API keys in place, you can show the map in your list and single record displays. A detailed explanation of the plugin’s settings is found under the “Settings” tabs here.

Dynamic Maps or Static Maps?

You should decide whether you need to use Dynamic Maps or Static Maps. They are used differently and result in a different display…here are the pros and cons:

Map Type Pros Cons
Dynamic
  • user interactivity like zoom, panning, street view, change map type
  • location markers
  • info popups on markers
  • more appearance control
  • fewer free loads
  • can take longer to load when viewed
  • more complex display could be confusing or distracting
Static
  • loads instantly, no javascript
  • simple display
  • location markers
  • lots of free loads
  • no user interactivity
  • less responsive: you must define dimensions
  • less control over appearance
  • no marker info popups

Placing Dynamic Maps

Dynamic maps can be placed automatically, without the need for custom templates, by selecting a location in the list or single record displays using the Automatic Map Placement settings. In the list display, the map will show in the selected location (top or bottom) with markers for all the records shown in the list results. A search result will show a repopulated map with markers for the result set.

The map for the single record shows a marker for the location of that record.

Dynamic Map Shortcodes

If you want to just show a Dynamic map with it’s markers, they can also be shown with a shortcode. Don’t use these shortcodes to add a map to the list display, they are for showing a map on it’s own.

[pdb_listmap] shows a map with all your located records as markers. You can use the “filter” attribute in the shortcode to determine which records are included or excluded.

[pdb_singlemap] shows a map for a single record with a marker for it’s location. You will need to access it’s page using a ?pdb=id type of URL (typically, by using the “single record link” in the list display), so that the shortcode knows which record to show. Or, if you are a coder, you can use it in a custom template and set the record id in the shortcode, using the ‘record_id’ attribute.

Dynamic Map Templates

Dynamic maps can also be displayed using a custom template. The add-on comes with two example templates for showing a dynamic map: pdb-list-dynamicmap-default.php and pdb-single-dynamicmap-default.php You can use them as-is or use them as a starting point for your own custom templates.

If you are already using a custom template, take a look at these examples, you’ll see it’s very simple to add a map to a template.

Placing Static Maps

Static Maps are used in three ways: as a custom form element, the [pdb_list_static_map] shortcode or using a special template.

The Static Map Form Element

Setting up the map as a Participants Database field is convenient if you want to show a small map in a list display or you want the map to be part of the single record display.

Static maps must have their width and height set beforehand. If you don’t define the width and height in the field definition, it will use the global map height setting for the width and the height (resulting in a square map).

You can set several parameters in the field definition to set up your map:

  • ‘width’ sets the width, in pixels for your map display
  • ‘height’ sets the height in pixels
  • ‘located_only’ when set to true will only show a map if the record has been located (i.e., has latitude and longitude data)
  • ‘zoom’ sets the zoom level of the map; if omitted, the zoom level is determined by the global zoom setting
  • ‘maptype” can take one of 4 values: roadmap, satellite, terrain, hybrid and determines the type of map display to use
  • ‘center’ allows you to set a default center for the map: if there is a marker present, it will center on that marker. You must use the | (pipe) character instead of a comma to separate the latitude and longitude values. 


For example: this field is configured to show a map of width 650 pixels wide by 500 pixels in height, showing a hybrid map centered on San Francisco.

Note: map sizes are limited by your Google API plan type. Normally, this is 650 pixels, but if you upgrade your plan, you can get up to 2048 pixels. Details here…

You can manage the appearance like any other Participants Database field. If you want the map to show up in your list display, make sure the map field is configured to do so. For single displays, it will appear like any other field.

Map fields do not display in signup forms or record edit forms.

The [pdb_list_static_map] Shortcode

This works much the same as the [pdb_listmap] shortcode, only it shows a static map. The shortcode uses the ‘width’ and ‘height’ attributes to set up the dimensions of the map display. You can use these attributes in the shortcode:

  • width – in pixels
  • height – in pixels
  • zoom – sets the base zoom level of the map
  • center – longitude | latitude for the center of the map, defaults to auto-centering the map on the markers
  • maptype – can be roadmap, satellite, terrain, or hybrid

The Static Map Template

This add-on includes a special template for showing all your record markers in a static map. If you need to set up a custom list template using a static map, you can use the included pdb-list-static-map-default.php template as your starting point or as an example of how to include the map.

To use the static map template in your list shortcode, use a shortcode like this: [pdb_list template="static-map-default"].

Configuring the Appearance of the Dynamic Map

There are several preferences for determining how the dynamic map will look. First, you can select the Map Style, which is the color scheme of the map. There are several available, and it is possible to create your own color scheme if you want.

The Map Height setting sets the size of the map display. The map will always try to be as wide as possible, filling the available horizontal space. It is necessary to give the map a specific height to determine how much vertical space it will take. The usual size is around 300 pixels, this will look good on most handheld devices. You don’t want to try to show a map that is larger than the screen size of the device since the user can scroll within the map window.

Map Controls determine what the user can do with the map. You have several controls that you can enable or disable depending on your needs. It is probably a good idea to have as few of these enabled as possible to avoid unneeded clutter in the display.

Each location is marked on the map with a Marker Icon, you can select the type of icon and color.

Marker Info Pop-Ups show information from the record when the marker is clicked on or hovered over. You can configure the content of the info box: it’s possible to put pretty much anything you want to show in there, the template gives you a way to determine which fields are shown and how they are laid out in the box.

Geocoding

Most of the time, your records will have an address that defines its location. Geocoding takes this address information (from anywhere in the world!) and converts it to the latitude and longitude values needed to place the marker on the right spot on the map.

You’ll need to tell the plugin which fields are your Address Fields, it uses the data in those fields to determine the location. It’s possible to locate markers with partial information, such as a state or city, but it will be more accurate with a complete address.

If your records already have latitude and longitude data, you don’t need to use geocoding, just make sure the Latitude and Longitude Field settings tell the plugin where to find that info.

Mass Geocoding

If you already have a records when you set up the map plugin, you’ll want to geocode those so that their markers will be placed. The Geocode All Records button does this for all the records in the database. The operation takes place in the background, so once you start it, you can do other things. You’ll need to refresh the page after a few minutes to see the results of the operation.

API Key Restrictions

API keys should be restricted to prevent their use by others. Key restrictions will only allow the website that is authorized to use them to gain access to the API and its services.

For our purposes, there are only two kinds of restrictions we are concerned with: “HTTP referrers” and “IP addresses.” HTTP referrer restrictions are for requests from the client side, and so this includes Dynamic Maps and Static Maps. IP address restrictions are for requests directly from the web server to Google: this is what the Geocoding API needs. Here is a handy chart:

Plugin Feature Google API Restriction to use
Dynamic or Static Maps Maps JavaScript API HTTP Referrer
Geocoding (Location Markers) Geocoding API IP Addresses

Setting Up Restrictions

HTTP Referrer restrictions should contain the domain name of your website. If you want to use the same key on multiple sites, you can add more domains. It’s a good idea to use wildcards in the setting…for instance, for this site, I would use: https://*.xnau.com/* so it will cover all subdomains and paths in the site.

IP Address restrictions require that you know the IP address of your web server. You can usually find this on your hosting control panel, or you can just ask your web host. In some cases, there are multiple possible IPs that your server could use, so you should add all of them to the restrictions setting for the API key.

Product Settings

Google Maps API Settings

Maps JavaScript API Key

You must have an API key to use Google’s map service. Instructions for getting your API key are found under the “Instructions” tab.

Geocoding API Key

If you are using restrictions on your API keys, you will need to use a different API key for Geocoding. Without restrictions, you can use the same key for both. Restrictions are optional, but it is recommended you set them up to prevent your API keys getting misused.

Google Static Maps Signing Secret

This key is optional, and you’ll only need it if you’re using Static Maps and want to increase the number of free loads you can have. More information on digital signatures here…

General Map Settings

Default Zoom Level

Normally, the map will auto-zoom to include all the markers. If the map has no markers, this is the zoom level to use. This also works as a minimum zoom level so that your maps won’t be zoomed in too close if there is only one marker or they are all clustered in a single location.

Details that would be seen at several example zoom levels:

  • 1: World
  • 5: Landmass/continent
  • 7: Country
  • 10: City
  • 15: Streets
  • 20: Buildings

Default Location

The center of the map is normally determined by the markers. If there are no markers, this location will be used as the center of the map.

Map Height

All maps require a height setting. Choose a value in pixels that looks good in the normal display you are using. This value can be overridden by individual maps. The maximum size available here is 650 pixels, unless you have a premium Google API plan.

For dynamic maps, the width of the map will be determined by the display, so it will be responsive to the viewing device screen. Static maps require a fixed width value, which is set in the configuration of the static map. Static maps can be made responsive with appropriate CSS, your responsive theme may take care of that for you.

Marker Icon

Choose the style of marker icon from a preset list of icons.

Custom Marker Icon

If you want to use a custom icon, put the URL to it here. This means it needs to be hosted on a server. The easiest way to do this is to upload the image to your site’s media library. To get the URL, open the image in the media library editor, then copy the URL for the image (seen in the upper right of the edit screen).

An icon should be a 32×32 pixel PNG with a transparent background.

Dynamic Map Features

List Display Automatic Map Placement
Single Record Automatic Map Placement

This selection inserts the dynamic map in your List or Single Record displays in the location specified.

This will be active in all single or list displays. If you need to selectively display a dynamic map, you must use a custom template. The plugin includes some default custom templates which you can use as-is or as a guide to creating your own.

Map Style

This chooses a color scheme for your map. There are several built-in ones to choose from, or you can build you own. See the “Custom Map Style” setting for details.

Map Controls

Dynamic Map Controls

There are several different controls available to users on a dynamic map. This setting lets you decide which ones will be available. Note that this can’t prevent users from zooming and panning using their keyboard and mouse, all this does is hide or show the specific on-screen control.

Enable Marker Info Pop-Up

Checkbox to enable/disable informational pop-ups for markers. These pop-ups show information from a record when its marker is clicked or hovered over.

Marker Info Show Action

Determines the action that will show the informational pop-up: click, the marker must be clicked on or hover, the info box for each marker is shown as the pointer hovers over it.

Marker Info Template

This mini-template determines which pieces of information will be included in the informational pop-up and how it will be formatted. It uses the same “value tags” as available in Participants Database email templates. Each tag will be replaced by the record data in the named field.

You can use simple HTML in the template, but it may break if you try to put too much in there.

Custom Map Style

Here is where you can add your own custom map color scheme. You’re expected to paste a valid JSON object, an error will result if there are syntax issues with the JSON object.

There are several online services that make developing your own map style fairly easy.

These services will all generate the JSON for you: just copy and paste into the custom map style to use it.

Geocoding

In order to place markers on a map, it is necessary to know the coordinates for each one. In most cases, your records will have an address of some kind. Geocoding is the process of taking a descriptive address of a place and converting it to the geometric coordinates of the place on the globe: the latitude and longitude.

Enable Auto-Geocoding

When enabled, a record is automatically geocoded when it is created or edited. You can disable this if your records already contain latitude and longitude information.

Address Fields

To geocode a place, we need the address information. This setting tells the geocoder which fields to use to find the coordinates. The address can be a mailing address or any other kind of descriptive address that is normally used. The address can be incomplete (for instance, just a city or even a country), the geocoder will place the coordinates as accurately as it can using whatever information it is given.

For example, if you give the geocoder the only name of a city, it will place the marker in the center of that city. If given a locality (such as “Hell’s Kitchen”) it will place it in the center of that locality, so even if your records don’t contain complete addresses, markers can be meaningfully placed.

Latitude Field
Longitude Field

Select the two fields where this information is held in your records. Normally, the plugin will add these fields and you won’t have to change this setting. If your records already have coordinate fields, you can set those here so the plugin knows where to get the information to place the marker.

Geocode All Records

When you first set up the plugin, you will probably need to get the coordinates for all the records that are already in the database. This button will start the process of geocoding all of your records.

It does this in the background, so you won’t see much happening until it is done. Refresh the page after a minute or two to see the results of the bulk geocoding operation.

Remember, there is a limit to the number of free geocoding requests you can make, and if you have a large database you could easily reach that limit if you perform this operation multiple times. You should only have to do this once.

F.A.Q.

My records won't geocode, I just get the "Processing complete. 0 records geocoded." message when I try to geocode my records.

There are several things that could be going wrong here, so here is a checklist of things to verify:

  1. API Keys: Make sure you are using the correct key and that the key is set up for the correct APIs. The keys should be set up on the Maps JavaScript API and the Geocoding API. You must have a valid billing account set up with Google for the key to work.
  2. API Key must be valid for the domain making the request. This will be under the “restrictions” for the key. If it is unrestricted, it will also work.
  3. If the keys are restricted, you must use a separate key for the Maps JavaScript API and the Geocoding API. The JavaScript API must use HTTP Referrer restrictions and the Geocoding AP must use IP Address restrictions. Make sure these restrction settings are correct. If you turn the restrictions off, and then it works, you know the restriction settings are not correct.
  4. If you have Participants Database debugging on, you may see pertinent information on the geocoding attempt. For example you may see pdbgmap\geocoder::geocode request failed with status: REQUEST_DENIED which indicates a problem with the API Key.
  5. Check the Geocoding Address Fields setting. This must be a comma-separated list of valid field names. Do not include any non-address fields. For example:
    address, city, state, country
  6. Your records must have enough valid data in the address fields to locate the record. Check a single record with a good address, it should geocode when saved so you can see if that record is working and make any changes to get it working. Even just a country and city is enough to place a pin. If you find it geocodes with just the city and country, then maybe something about the street or house address is confusing. There is a Google geocoding tester you can use to see if you’ve got a readable address.
  7. If after you’ve verified the first 3 items on this list and your address tests OK on the geocode test page, you still can’t get it to geocode your records, it can be helpful to do a little debugging. In the Participants Database settings under the advanced tab, select “plugin debug” in the Enable Debugging setting. Now attempt to geocode your test record in the backend record editor (you only have to save the record to do this). The log (debugging log item in the Participants database admin menu) will tell you what errors happened during the geocode process. Most of the time, the problem is with the API keys. Setting up the keys is a bit complex and everything has to be correct for them to work.
I'm using Locations Map with Combo Multisearch, and the map shown in the list doesn't update to show markers for the search results.

Make sure you are using the latest versions of both Participants Database and the Location Map plugins, there was a bug in earlier versions that prevented the map fields getting updated when using Combo Multisearch.

Don’t try to use the [pdb_listmap] shortcode to display the map on a page that has the

First Name Last Name Club Role City State Main Activity Photo
Jacob Drenth
Cheese Burger
Jason None of you
jorge collantes
Hans Wurst
test user
Epic Choice Volunteer Santa Clara California General Sports
Ian Ashton
Matt Moran Guest Carlsbad California General Sports, Rock Climbing, Photography, Crafts, Arts & Hobbies
essai essai2

shortcode with a search…they won’t be in sync. If you want to show a searchable list and a location map that follows the search results, it is best to use the “Map Auto-Placement” feature or the dynamic map list template for that.

Another approach is to use a custom template. While Locations Map does include a list template that adds a dynamic map, for Combo Multisearch, you need to combine the template that Combo Multisearch uses and the Locations Map one.

I have put such a template together, it is available here…

Take a look at the linked page if you are unfamiliar with the use of custom templates in Participants Database.

I'm using the "auto list placement" and the map doesn't update when a search is performed.

This is a limitation in the current version of the plugin. You can’t use “AJAX Searches” with the List display auto placement, the map doesn’t update.

There are two solutions to this, you will only need to use one of them:

  1. Turn off “Enable AJAX Search Functionality” in the Participants Database advanced settings.
  2. Use a custom template instead of the auto placement…for example:

    Search:





    First Name Last Name Club Role City State Main Activity Photo
    Jacob Drenth
    Cheese Burger
    Jason None of you
    jorge collantes
    Hans Wurst
    test user
    Epic Choice Volunteer Santa Clara California General Sports
    Ian Ashton
    Matt Moran Guest Carlsbad California General Sports, Rock Climbing, Photography, Crafts, Arts & Hobbies
    essai essai2

Support Discussions for Locations Map

  • Hello Roland,
    Thanks for your good plugin.
    I’ve just purchased Locations Map and have got some problems.
    After a fight with gmaps API, I success geolocalisation. Good.
    But some options of Locations Map don’t do anything.
    1 – I changed the “Marker Info Template” of the map to names of my customs fields, but the small information pop-up show others field…
    2 – I chose another Marker Icon, uploaded it, and select it in the select icon option, but it doesn’t change…
    I clear my browser and wp cache, but nothing helps.
    Do you have some tricks ?
    Thanks !
    Romain

    • I don’t know what the issue is with your marker info template, this is working in my tests. Make sure you are using the “name” of your fields in the value tags []

      On the marker icon, you also have to select it in the marker select dropdown.

      • Thank you for answer.
        I found this was a varnish cache server side.
        No more problems now ;)

        • Thanks for posting your solution. Caches can cause all kinds of problems, and they are the first thing to look at when something stops working.

        • In fact, this was not varnish cache, this was php cache !
          And cache was not emptied when changing template for “Marker Info Template”. I have to save a member to empty cache and see my changes.
          It could be cool to modify this next version.
          See you !

        • Interesting, I’ll have to look into that. Thanks!

  • Roland, thanks for all your work making this a great plugin!
    I’m using the map on my search results page where one of the search criteria is location (a combo-search input where the user can enter city, state or zip). When there are no results for a search, the map defaults to the default location set in the settings. Is there a method you’ve used to instead have the map center on the city, state or zip from the search (even though no records show up here)? This would really help my users!

    I’ve worked out a few plans of attack, one of which is passing the search term(s) as parameters tacked on to the form action when submitting the form… this would require wading through the combo-multisearch plugin files that dynamically render the search form and adding the parameters – (I think this is doable, but a bit anxiety inducing for me), then if no results come back taking these parameters and making a call to the google maps api to get the coordinates where I can recenter the map – (again, I think this is doable but ??). This strategy keeps most of my work on the front end and seems promising, though I’m not 100% sure it will work. If you think there’s a better direction you can point me in or if you’ve seen this done another way I’m all ears! I can send you a link privately to see my site if you’d like.

    • I don’t have a solution for this figured out, but you can probably handle this using a filter that is triggered on an action. This is pretty advanced stuff, but it can be figured out. One possible action to use is ‘pdb-before_include_shortcode_template’ which passes in the PDb_List object before the results are displayed. With that object you can tell if there are no results, and if so, you set up a filter on ‘pdbgmap-map_control_props’ which passes in an array of configuration values for the map. You would take your search string (which is available in the list object), then use that to get your new center property for the map. Probably, you’ll need to shoot a request to Google (or some other geolocation service) for the coordinates.

      There are several ways this can not work, so my suggestions can get you started, but you’ll have to work out how to make it all work.

      • Thanks Roland.. I got it figured out and wanted to post this as a verified method which may help others. I edited the PDb gmap.php file and created a variable like so:
        var searchLocation = jQuery(“input#pdb-combo_search-control”).val() which uses the value from the combosearch input on the same page where the google maps api is called ( i have the form set to remember and pre-populate the most recent search terms, so the search location is available this way using jQuery. If you didn’t have this enabled, you could still create a javascript variable from the php variable $combo_search like so: var searchLocation = “”; which gets loaded on the page also.
        Then, if no location results are returned when the search is performed, make a call to the api to geocode the location saved in that variable. Reset the map to the resulting coordinates. There is a little hiccup when this happens because the map renders twice… first at the default location, then right after, at the search location but I think this can be fixed too.. would be a nice to have for ux.

        Another hack I made involved letting users search by zip code, and if no results come back, display the nearby results instead… this one’s a little clunkier and has some ironing out needed but I’m open to discussing if any interest…

  • Map plugin sometimes not working and now search feature not working? Also, the previous email with more details is being marked as Spam?

    • Can you be more specific about the problems you’re having with the map and the search results? Maybe share a link so I can see it?

      For the email, this is something at can happen, depending on email server the email is going to. It’s important to make sure your emails have verifiable return mail information, the “from” address needs to be from the domain that is sending the email, or you need to set up SPF or some other form of email sender verification. Also, it’s a good idea to try to find out exactly why the email was flagged. You can usually do this by looking at the email that was flagged, there will often be an explanation as to why. Another thing to try is to test your email server with a deliverability test to make sure there isn’t some other problem with the seerver that is causing the issue.

  • Roland, again thanks for an excellent plugin with great documentation. I’ve spent hours dealing with this issue regarding Google Maps API. All functions work fine when I leave the default “none” for Application Restrictions. But Google seems to strongly advise adding either “websites” or “ip address” restrictions to avoid misuse and potential added costs.

    After hours of troubleshooting, I find that Geocoding only works with IP Address restriction, but Dynamic Maps and Static Maps only work with http restriction. We’re only able to apply one of these restrictions as far as I can tell. My website is https://RunningMyRaces.com. From experience, have other users been OK without an Application Restriction? I don’t think I’ve missed anything, but I’m sure many people use this plugin.
    So I’ve currently set my Google API without restrictions. Any guidance appreciated!

    • I typically run without the restrictions. The main concern is that a hijacked API key could be used to access the service, and possibly run up a tab. I don’t know how possible or likely that is. It is just a good precaution to take.

      Now, why the various services work differently with the restrictions, I don’t know. The plugin is not directly providing the server info to Google, that is all handled by WordPress. There is a difference in the requests from the dynamic service and the static service.

      Are you using some kind of DNS service? Something that might change the public-facing IP? Just a thought.

  • Having problems geocoding
    Here is errors

    pdbgmap\geocoder::geocode request failed with status: REQUEST_DENIED request: https://maps.googleapis.com/maps/api/geocode/json?address=4303+Teague+Town+Rd+Taylorsville+NC&key=(with API key)

    • Make sure your API Key is correct and that it is enabled for both the Maps JavaScript API and the Geocoding API. If the key is restricted, it must be allowed for the site you are using it on. These are all things you must set up in your Google Developer account.

      • Hi Roland,

        I’ve the same issues. The API key is correct, Maps Javascript API and Geocoding API are enabled. The key is unrestricted as you said: If it is unrestricted, it will also work. Address, city and country fields are good. Geocoding isn’t working: 0 results.

        I’ve enabled the debugger and it gives REQUEST_DENIED. If I put the longitude and latitude of the address manually in the single record, the pin on the map shows up on the correct city and address?

        Another issue I am having is the error I receive when opening the Javascript console in Firefox. The message is: You have included the Google Maps JavaScript API multiple times on this page. This may cause unexpected errors.
        There’s only one map on my page?

        Now, I used to receive an authorization API key denied message in the javascript console, but it’s gone, so this is good. The “developer message” by Google on top of the map also disappeared, the map shows clearly now. All settings in your plugin and with Google (API Cloud Platform) must be good in my opinion. I’m not sure what to do next. Can you help me further?

        Much appreciated!

        • The “request denied” usually means you don’t have the right APIs enabled in your project. In this case, it looks like you’re missing the Geocoding API.

          What shortcodes do you have on the page?

        • Thanks for your reply Roland,

          I do have the Geocoding API enabled on the project as mentioned before?

          The shortcodes on the page are: [pdb_listmap] and [pdb_list template=multisearch-flexbox filter='approved=yes'] I’ve created a custom template.

        • All I can say is “Request Denied” means that Google is not accepting the request…so whatever is not right, it has to do with the API key. Is it restricted? Do you have the right settings on the restriction? Try it unrestricted and see if it works, if it does, you know it’s the restrictions. If you’re using an IP in there, it may be coming in to Google on a different IP, try using a domain name instead.

          Aslo, you may find that the map works better if you use the “List Automatic Placement” setting instead of using a separate shortcode for the list.

        • I just released a new version of the Location Maps add-on. I realized that the plugin was not compatible with using restrictions on API keys, so I had to update it to allow for a different key for each the Maps JavaScript API and the Geocoding API. This is because each one needs a different type of restriction: HTTP Referrer for JavaScript API and IP Addresses for the Geocoding API.

        • There’s no difference between the -List automatic placement- setting or the shortcode. I just tried a new template as you wrote here: https://gist.github.com/xnau/39afbf647d78e85a7acdba4b0da30530
          I even customized it with a flexbox template and all the results are the same.

          I have geocoded them all manually, but for new records it’s still an issue. Perhaps it’s best to contact Google about it further.

          Another funny thing is that on the first load of the page in the browser it provides all 462 results on the map. After I do a search it gives the results searched for. When I clear the search results, just a few remain and not the 462. Any suggestions for that?

        • That’s why I suggested you use the automatic placement….it follows the list search results better.

          Geocoding the records automatically won’t work until you get that API issue resolved.

        • There’s no difference using the listmap shortcode or the pdb-list-multisearch-map.php (default) or using my custom flex (responsive) template (which is the default template customized).

          If I put the automatic placement on, it gives the same results in all displays with search results, so that’s a good thing for the shortcode, not? It seems to work the same?

          If I only use the default (pdb-list-multisearch-map.php ), it does not load all records on the first page load?

          I think it must be possible to have all records loaded on the first page load, doing a search after, get let’s say 10 results displaying the locations and after clearing the search, all records must show again like the first page load?

          Thanks for your quick replies, obviously something is wrong. Does it use caching? I’m just guessing now.

        • When you use the automatic placement, the map will show all the markers for the currently displayed page of records. If you do a search, it will show the current page of records that match the search. When you clear the search, it goes back to only showing the current page of records.

          If you use the [pdb_listmap] shortcode, it will show all the markers for all the records. It is meant to be a standalone display, it may not follow the search results or the clear command. If you are getting unexpected results with that, I suggest you use the auto-placement for the map, not the listmap shortcode. You say they are the same, but this is not what I see in my tests.

          If you want the auto-placed map to show all the records, then you need to configure the list shortcode to show all the records, so it won’t be paginated.

          If you want me to take a look to see what the problem is, provide a link.

        • Roland, I will send you some links privately. I’ll setup different demo pages with the displays mentioned earlier. I’ll let you know.

          As for pagination and displays, that’s good to know.

          Thanks for all your help so far!

  • I’ve purchased this plugin and populated some test data with UK addresses – street address, town, postcode and country – but the geocoding won’t work. It just returns the message ” Processing complete. 0 records geocoded.”. What am I doing wrong?

  • I’m looking at getting this AP, I need it to do something like MTB Projet that is a map with a route shown on it. I would want to show several points of interest (POI with pictures etc) along the route. Does this ap/plug in of Google maps enable each record to have its own Google map route along with POIs for that route?
    All records should be able to be identified on a general google map, then zooming to the specific route that a user was looking at.
    thanks

    • I went ahead and got the google maps, but it doesn’t load on my sight. There are about 12 map APIs out there, I got the one for address and geocodes. The plugin downloaded fine, but no latitude and longitude values are showing up; either with new records or in the existing records. Suggestions?

      • Once the APIs are set up, then if a record won’t geocode, it usually means there isn’t enough information in the address to set a location. Make sure that you have your address fields assigned to the geocoder and you have enough information in the record to calculate the location.

        • Hi Roland,
          thanks for getting back with me.
          I put several full address in, still not working. I did the geocoding all button twice. showed 0 records updated, 4 records processed.
          Not sure if it makes a difference, but I changed the group for address, city, state to the “main page” instead of the personal page. Also, I had deleted address earlier and recreated the address field. I updated the locations map setting as follows:
          [route_share_user_name][address][city][state]

        • OK, the “address fields” setting in the geocoder needs to be a comma separated list of field names. Also, don’t include fields that do not contain address information.

          for example:

          address, city, state, country

        • I did put the commas in there. My database is only one record now and very complete. It still didn’t make any difference. The longitude and Latitude fields won’t populate.

        • Most of the time, a problem like this is due to the API keys not working. Once you’re sure the API key for both the Maps JavaScript API and the Geocoding API are set and you’ve got it correctly entered in the plugin settings, you can test the geocoding with a single record. Saving the record on the admin record edit screen will attempt to geocode the record.

          If it doesn’t work there, you’ll need to take a look at your php error log. The plugin will print any problems it encounters to the log.

        • Roland,
          Thanks for your help. I was missing the JavaScript API. Bill

    • You will probably need to develop a custom application for that. The Map Locations add-on just throws down pins for the addresses in the database.

      • Hi Roland,
        Thanks for all your help. The PINS are working fine right now.
        Is there any way, since I got the multi-search plug-in also, that after the multi-search is executed (that is a search is done) that only those pins in the search results show up on the map?

        Thanks,

        • Well, that depends on how you are displaying the map. If you want the map to only show the pins from the results of a search, you need to use the “List Display Automatic Map Placement” feature so that the map is integrated with the list display.

        • Hi Roland, I tried the “List Display Automatic Map Placement” before and after the list display; and it still didn’t make any difference. The map is still showing all the pins after the search, even those not part of it.

          The single map display, is fine when I go there.

          Thanks

        • Yes, I’m sorry, don’t use the automatic placement, I’ve got a bug there to deal with. I suggest you use the special template for showing a dynamic map:

          [pdb_list template=dynamicmap-default search=true]

        • I guess i’m entering it wrong. I’m putting on same page as:

          [pdb_list template=multisearch]
          I tried putting the code: [pdb_list template=dynamicmap-default search=true] before above code, after above code, and after word multisearch (as ,dynamicmap-default search=true]. none of them worked.
          Maybe something else I did wrong?

        • You only need the one list shortcode:

          [pdb_list template=dynamicmap-default search=true]

          In order for this to work, you need to have the custom template in the correct location. If not, it will fall back to the default template.

  • Hello, this is a great plugin!
    I’m trying to add a list of the search results next to the map with markers, much like when searching for places on Google. Is it possible?

    • Yes, the easy way to do this is to use the automatic map placement setting in the Locations Map settings, under the Dynamic Map Features tab. The setting List Display Automatic Map Placement lets you choose where to show the map, but it’s only before or after the actual list of results.

      If you want the locations map to show to the side, depending on your theme, you may be able to use some CSS to place the map display. More likely, however, you’ll need to use a custom template so you can set up the HTML the way you want. The plugin comes with an example template to get you started: pdb-list-dynamicmap-default.php

      Here are general instructions for setting up a custom template: Using Participants Database Custom Templates

  • Hi! I installed this and am having an issue. I followed the steps, but am seeing this error and don’t see a way to fix it: http://searchtinyhousevillages.com/map-error

    I am trying to do a dynamic map.

    Additionally, when I select from the map icon, they are all blank, except for the “custom” option.
    So, I selected “custom” marker and uploaded an option. No markers are showing on the map, even after verifying that the address fields are correct. I also have lat/long fields entered and selected within the plugin.

    • I’ve never seen that message before, but it does suggest that Google is not getting the correct API key. It is sometimes possible to get more information about the problem if you look at the browser developer’s console when attempting to load the map. If I had a link to the map page, I could check on that.

      The map icons, that is a new problem, looks like the Google icon repository I was using has changed. I’ll need to fix that.

      About the markers not showing…on this page you are getting maps? Just no markers? If you open a record in the admin, you should be able to see if the latitude and longitude fields have values. If not, make sure you have auto geocoding set up, then geocode your records.

      • The update fixed the map marker icon. Thank you.

        I tried setting up a second API key and got the same error. It looks like it will load once (without any markers). But then the second time I load the page, I get the error message in my earlier message.

        I do have lat and long fields and they do have values (I added them manually myself because I was using my own custom map solution). Your plugin created its own fields for the same purpose. When I set the plugin to use my fields and auto geocached, it erased all of the lat/long fields I had and left empty values.

        You should have a login still on my site at SearchTinyHouseVillages.com

        • It’s possible the plugin cleared those location values when the API key failed. It shouldn’t do that.

          What is the exact error message you are getting? Google changed their requirements for using the Maps API back in June, so you may need to check on that status of your API account to make sure it is still active.

  • I am very interested in this plugin & what it can do.

    I would like to use this for airports, how will it show if I have more than one marker at the exact same location?
    Other programs I have seen combine them into one marker with the number of icons.

    • This is an interesting question. I had not considered how to handle multiple markers in the same location. As it is, it will just stack them on top of each other, but that could be changed.

    • Could you point me in the direction to learn how to make this happen?

      • Looks like it’s possible, but requires a pretty deep dive into the code. Check out this response at Stack Overflow There may be some more discussions on the subject there as well.

Got a Support Question?

You have to agree to the comment policy.