• Getting:
    leaflet.js:5 Uncaught Error: Bounds are not valid.
    at e.fitBounds (leaflet.js:5)
    at Leaflet.CenterMap (WP-GPX-Maps.js:720)
    at Leaflet.AddWaypoints (WP-GPX-Maps.js:701)
    at a.fn.init.$.fn.wpgpxmaps (WP-GPX-Maps.js:890)
    at HTMLDocument.<anonymous> ((index):469)
    at i (jquery.js:2)
    at Object.fireWith [as resolveWith] (jquery.js:2)
    at Function.ready (jquery.js:2)
    at HTMLDocument.K (jquery.js:2)

    and no map is shown. But there should be 2 maps on the page

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter marcooderkerk

    (@marcooderkerk)

    Managed to get one map running, after I raised the map height. the second map is still not working with the same error so i guess each map needs it individual bounds information.

    Thread Starter marcooderkerk

    (@marcooderkerk)

    It looks like that the secon gpx file doesn’t contain any waypoints.
    It could be the if

    if (!jQuery.isEmptyObject(waypoints))
    {
    map.AddWaypoints(waypoints, waypointIcon);
    }

    in WP-GPX-MAPS.js. During debug it has a zize of zero
    length
    :
    0
    __proto__
    :
    Array(0)

    so a waypoints.length could maybe help.

    Having the same issue too. Same error in console.
    Seems like a conflict of the plugin with some other plugin or theme.
    If dev keeps an eye he should have a look.

    • This reply was modified 7 years, 9 months ago by Harris.

    Hi,

    Same problem here…

    I´m using ENFOLD theme, don´t know if that matter. But it was working just fine until the last upgrade…

    Any ideas?

    Thread Starter marcooderkerk

    (@marcooderkerk)

    I changed temporary the following line in the WP-GPX.js of the plugin (line 889)
    from

    if (!jQuery.isEmptyObject(waypoints))

    to

    if (!jQuery.isEmptyObject(waypoints) && waypoints.length)

    till the official update is comming. for me it works.
    The Error in my case results from an empty waypoint array and the isEmptyObject does not get it correctly

    Niiiiiiceeeeee @marcooderkerk

    it worked perfectly!!!

    Thanks a lot…

    Hello,
    Where exactly is that WP-GPX.js file? Can’t find it.
    Doesn’t seem to be in the js folder either

    Thanks

    OK. Found the file. It was WP-GPX-MAPS.js
    WOrked for me too.
    Thanks

    • This reply was modified 7 years, 9 months ago by Harris.
Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Uncaught Error: Bounds are not valid.’ is closed to new replies.