Filter by maps (regions)

New home Forums Pro Add-on Troubleshooting Filter by maps (regions)

This topic contains 9 replies, has 3 voices, and was last updated by  figaro 10 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #45897

    MilosElu
    Member

    Hello.

    I bought a pro version.

    It’s very important for me to have filtering by regions (maps) and focus on it. Is it possible display multiple maps within one, and then filter through the maps?
    I tried different things and read the forum. Also, I’ve tried maps mashup, but have no success.
    You can see the example here, and that is what I need:
    http://eeeinternational.com/?page_id=11
    Just see filter by regions.

    Thank you

    #45899

    SupportTeam
    Moderator

    Hi there,

    Thank you so much for getting in touch with us.

    For this I would try using categories. You can create categories in Maps -> Categories and then apply them to a new marker or by editing a marker in the map editor.

    To turn on “Filter by Category” in the map editor under the Marker Listing Options tab. Then select your desired Category Selection Logic and Filter by category displayed as in Maps -> Settings -> Maps.

    Thanks so much,

    Kind Regards,
    Trevor Anderson

    #45905

    MilosElu
    Member

    Thanks for your reply.
    I’ve already tried the categories and custom fields.
    But, what I really missing is the the automatic zoom or movement on specific part of the map.
    Is it possible to fix some specific region on the categorie or custim field?
    Exp. if I am looging something in Australia, and change categore for something in Europe, I’m still in Australia with my view.

    #45907

    MilosElu
    Member

    What for I could use attributes and their values at the custom field options?

    #46055

    SupportTeam
    Moderator

    Hi there,

    Sorry for the issue.

    The only thing I could say is you’d likely need a custom script that will detect when the category is changed and then change the center and zoom of the map. I could create an example script for you if you’d like.

    Thanks so much,

    Kind Regards,
    Trevor Anderson

    #46652

    figaro
    Member

    [quote quote=46055]Hi there,

    Sorry for the issue.

    The only thing I could say is you’d likely need a custom script that will detect when the category is changed and then change the center and zoom of the map. I could create an example script for you if you’d like.

    Thanks so much,

    Kind Regards,
    Trevor Anderson[/quote]

    Sorry for hijacking thread, but I also need to be able to zoom when a Category is chosen. I would very much appreciate it if Trevor could indeed share an example script for this?

    #46654

    SupportTeam
    Moderator

    Hi there,

    Here is an example script, you’ll need to know the latitude and longitude values of the center point you’d like to zoom to, and the zoom level. Then add that information into the array for the cat_set_center_zoom with the index being the category ID.

    var cat_set_center_zoom = [];
    cat_set_center_zoom[1] = {
    lat: 34.0534897,
    lng: -118.2453232,
    zoom: 10
    };
    jQuery(function($){
    $('#wpgmza_filter_select').change(function(){
    var cat_select = parseInt($(this).val());
    var map_id = parseInt($(this).attr('mid'));
    if (cat_set_center_zoom[cat_select] && cat_set_center_zoom[cat_select].hasOwnProperty('lat')) {
    var point = new WPGMZA.LatLng(cat_set_center_zoom[cat_select].lat, cat_set_center_zoom[cat_select].lng);
    MYMAP[map_id].map.setCenter(point);
    MYMAP[map_id].map.setZoom(cat_set_center_zoom[cat_select].zoom);
    }
    });
    });
    

    Thanks so much,

    Kind Regards,
    Trevor Anderson

    • This reply was modified 10 months ago by  SupportTeam.
    #46672

    figaro
    Member

    Thank you Trevor, this is ‘almost’ working for me. The zoom part works, but i’m getting an error on the setCenter, LatLng part as follows:

    InvalidValueError: setCenter: not a LatLng or LatLngLiteral: in property lat: not a number

    Now this may be because I’m running Pro version 5, and not the latest version 7?

    I’ll happily purchase an upgrade to version 7 if I know this will work.

    #46674

    SupportTeam
    Moderator

    Hi there,

    Sorry for the issue.

    In this case please try the following instead:

    var cat_set_center_zoom = [];
    cat_set_center_zoom[1] = {
    lat: 34.0534897,
    lng: -118.2453232,
    zoom: 10
    };
    jQuery(function($){
    $('#wpgmza_filter_select').change(function(){
    var cat_select = parseInt($(this).val());
    var map_id = parseInt($(this).attr('mid'));
    if (cat_set_center_zoom[cat_select] && cat_set_center_zoom[cat_select].hasOwnProperty('lat')) {
    MYMAP[map_id].map.setCenter({lat: cat_set_center_zoom[cat_select].lat, lng: cat_set_center_zoom[cat_select].lng});
    MYMAP[map_id].map.setZoom(cat_set_center_zoom[cat_select].zoom);
    }
    });
    });
    

    Thank so much,

    Kind Regards,
    Trevor Anderson

    #46683

    figaro
    Member

    Yes! that works.

    Really appreciate your help Trevor!

    #46684

    SupportTeam
    Moderator

    Hi there,

    So glad this is working for you. If there’s anything else I can help you with please let me know.

    If you ever have two minutes spare, please consider reviewing the plugin on https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post it would mean the world to me! (If possible, could I ask you to mention both your name and mine in the review for administrative purposes, this would be a tremendous help!)

    Thanks so much,

    Kind Regards,
    Trevor Anderson

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.