Remove 'miles away'

New home Forums Pro Add-on Remove 'miles away'

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13440
    mitchcan
    Member

    I’d like to remove the “x miles away” from display in the infowindow of a Marker.

    I tried doing so with some simple display:none css, but that didn’t work, as I could not target just the p for the miles, it took out everything in the window.

    I saw the specifics for the _title and _description, but nothing for the “x miles away.”

    Could you let me know how to remove/hide that info in the window?

    And if possible, would I then be able to use ‘wpgmza_map_xx’ to target a specific map when doing this?

    Thanks.

    #13598
    Nick Duncan
    Keymaster

    Hi Mitch
    This will have to be removed from the code itself. If you open the wp-google-maps-pro/js/core.js file, try looking for this:

    if (radius !== null) {                                 
                                if (distance_type === "1") {
                                    d_string = "<p>"+Math.round(d,2)+' '+wpgmaps_lang_m_away+"</p>"; 
                                } else {
                                    d_string = "<p>"+Math.round(d,2)+' '+wpgmaps_lang_km_away+"</p>"; 
                                }
                            } else { d_string = ''; }

    Simply remove that section

    #13672
    mitchcan
    Member

    Hey Nick,

    I removed this from lines 1724 + and 2152 + in js/core.js but the mileage remains. Then I was thinking, do I need to do something with the core.min.js file also to get this to work? And if so, how do I go about that?

    Thanks.

    #13739
    Nick Duncan
    Keymaster

    Hi Mitch
    There’s two sections with the same code in, please remove the other one too

    #14248
    mitchcan
    Member

    Hey Nick,

    I removed both sections around lines 1794 and 2220, to no avail. Do I need to reminify that js? or change the same places in the .min file too? to get this to work?

    Thanks.

    #14868
    mitchcan
    Member

    Hey Nick,

    Can I hit you up on this one again? I never have got the format you referenced to work. You mentioned that you were going to look at an easier way to do this. I would have been happy just to CSS display:none the thing and call it good, but that doesn’t work either.

    I know its an edge use case, so I appreciate your help.

    Thanks and have a great day.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Remove 'miles away'’ is closed to new replies.