feature request: pass url arguments to map page

New home Forums Pro Add-on feature request: pass url arguments to map page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #10589

    I’d like to be able to pass arguments to the page serves to filter the results. I propose this work with categories a user can set up through the WP admin settings.

    For example, if I have defined categories “Foo”, “Bar”, and “Baz”, and a map at the url http://example.com/my-map, I’d like to be be able to do the following:

    Show markers in category Foo:

    Show markers in category Bar:

    Show markers in category Foo and Baz (experimental):

    Nick Duncan

    Hi there
    We currently have a shortcode that can handle this at the moment.

    For example:

    [ wpgmza cat=”cat_id” ] – would that not help?

    There is no way at the moment to pick up GET variables. We’ll try add functionality for this in the future.


    Thank you that’s good to know — that may come in useful. I tried it, and it does indeed display markers from that category, although the filter dropdown doesn’t reflect the selected category.

    I worked up javascript way to read the get params from the URL and update select the appropriate option from the category filter. It’s kind of hackish, but it works. In case anyone finds this useful:

    (function($) {
      $(function() {
        var $wpgm_select_category = $('#wpgmza_filter_select'),
          _get_param = function(q,s) {
            s = s || window.location.search;
            var re = new RegExp('&'+q+'(?:=([^&]*))?(?=&|$)','i');
            return (s=s.replace(/^\?/,'&').match(re)) ? (typeof s[1] === 'undefined' ? false : decodeURIComponent(s[1])) : false;
        google.maps.event.addDomListener(window, 'load', function() {
          var category_id = _get_param('wpgmCategoryId');
          if (category_id) {
            setTimeout(function() { map_change_category(category_id) }, 500);
        function map_change_category(category_id) {
            .prop('selected', true)

    I discovered this while looking for a way to pass values to the shortcode.
    Is there an API or a page that lists the accepted parameters?

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘feature request: pass url arguments to map page’ is closed to new replies.