Title: Local event search using postcodes
Last modified: August 20, 2016

---

# Local event search using postcodes

 *  Resolved [adzay](https://wordpress.org/support/users/adzay/)
 * (@adzay)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/local-event-search-using-postcodes/)
 * Hi. I was wondering if there is a way to list ALL the postcodes so that I can
   use them to make a local event search with Google maps.
 * I found this code online
 *     ```
       <!DOCTYPE html>
       <html>
       <head>
           <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
           <title>Google Maps API Geocoding Demo</title>
           <script src="http://maps.google.com/maps?file=api&v=2&sensor=false"
                   type="text/javascript"></script>
         </head>
         <body onunload="GUnload()">
           <div id="map_canvas" style="width: 400px; height: 300px"></div> 
   
           <script type="text/javascript">
              var geocoder = new GClientGeocoder();
              var map = new GMap2(document.getElementById("map_canvas"));
              var i;
   
              var postcodes = [
                 'SL59JH',
                 'LU13TQ',
                 'SR29TD',
                 'DA75BQ',
                 'EC1V9B'
               ];
   
              map.setCenter(new GLatLng(54.00, -3.00), 5);
   
              for (i = 0; i < postcodes.length; i++) {
                 geocoder.getLatLng(postcodes[i] + ', UK', function (point) {
                    if (point) {
                       map.addOverlay(new GMarker(point));
                    }
                 });
              }
           </script>
         </body>
       </html>
       ```
   
 * where it says ` var postcodes = [
    ‘SL59JH’, ‘LU13TQ’, ‘SR29TD’, ‘DA75BQ’, ‘EC1V9B’];`
   is it possible to call all of the EMPostcodes to fit inside that array?
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/local-event-search-using-postcodes/#post-3481659)
 * Yes, you could, I’d suggest doing a normal DB query on wp_em_locations and grab
   the information that way, unless you to filter specific locations out.
 *  Thread Starter [adzay](https://wordpress.org/support/users/adzay/)
 * (@adzay)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/local-event-search-using-postcodes/#post-3481777)
 * Thanks for the advice, I need to research how to call the DB wp+em_locations 
   and put it into that format ‘_’, .
 * I will try it tonight and give feedback.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Local event search using postcodes’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [local](https://wordpress.org/support/topic-tag/local/)
 * [postcodes](https://wordpress.org/support/topic-tag/postcodes/)

 * 2 replies
 * 2 participants
 * Last reply from: [adzay](https://wordpress.org/support/users/adzay/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/local-event-search-using-postcodes/#post-3481777)
 * Status: resolved