Support » Plugin: MapPress Maps for WordPress » Cannot read property ‘push’ of undefined

  • Resolved mathie1990

    (@mathie1990)


    Hi, when I use Mappress, this script is added to page:

    mapp.data.push( {"alignment":"default","center":null,"editable":null,"filter":null,"height":"350","hideEmpty":null, ... and so on } ); 
    if (typeof mapp.load != 'undefined') { mapp.load(); };

    but I’ve got error Cannot read property ‘push’ of undefined, that is because I’ve different object mapp:

    mapp
    {Map: ƒ, Directions: ƒ, geocoders: {…}, Icons: {…}, InfoBox: ƒ, …}
    Directions: ƒ (t,i)
    Icons: {get: ƒ, getUrl: ƒ}
    InfoBox: ƒ (t,i)
    Map: ƒ (n,t)
    Places: ƒ (t,i)
    Poi: ƒ (t)
    event: {addListener: ƒ, addListenerOnce: ƒ, clearInstanceListeners: ƒ, clearListeners: ƒ, trigger: ƒ}
    geocoders: {Algolia: ƒ, Google: ƒ}
    lib: {ajax: ƒ, alert: ƒ, jqVersionCheck: ƒ, log: ƒ, scrollTo: ƒ, …}
    load: ƒ ()
    widgets: {Grid: ƒ, Popup: ƒ}
    __proto__: Object

    I dont’have property data, how I can fix this?
    Best regards, Mateusz

Viewing 1 replies (of 1 total)
  • Plugin Author chrisvrichardson

    (@chrisvrichardson)

    Hi,

    The mapp structure is output in the blog header. If the blog theme lacks a wp_head() function, or if another plugin suppresses the output, then it won’t work.

    You can test if this is the problem: temporarily switch to a standard theme (like ‘twenty nineteen’) and deactivate ALL other plugins. Then check to see if the map starts working.

    If so, you’ll need reactivate one by one to find the conflict. If it’s the theme, you probably just need to a wp_head() call:

    https://codex.wordpress.org/Function_Reference/wp_head

Viewing 1 replies (of 1 total)
  • The topic ‘Cannot read property ‘push’ of undefined’ is closed to new replies.