Events Manager
[resolved] Local event search using postcodes (3 posts)

  1. adzay
    Posted 3 years ago #

    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>
        <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"
      <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 = [
           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));

    where it says ` var postcodes = [
    is it possible to call all of the EMPostcodes to fit inside that array?


  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    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.

  3. adzay
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic