Known Issues - jeffreykemp/jk64-plugin-reportmap GitHub Wiki
The following are known issues that have been encountered, with workarounds presented where possible. No fixes are expected.
Problems with two or more maps on the same page
When two or more map regions are rendered on the same page, depending on which visualisation or other options are chosen, one or more of the maps will not render correctly (or at all).
The browser console log may show errors like "Uncaught TypeError: Cannot read property 'HeatmapLayer' of undefined"
. Alternatively, the map tiles might simply not show up or be "all grey".
This is caused by a limitation of the plugin: only one copy of the Google Maps API will be loaded on page load; the first map rendered on the page (in region order) will dictate which API options get loaded. If another map on the same page needs an option that was not loaded by the first map, they will fail.
The following options require API options loaded at page load, and may exhibit this issue:
Workaround #1: What can work in some cases is to change the order that the map regions are rendered. This takes advantage of the fact that the first map region that is rendered dictates which API options get loaded; if other maps on the page don't conflict with the first, they will be able to re-use the same Google Maps API loaded by the first map.
Workaround #2: Add a selector (e.g. a select list, or checkboxes) that causes the page to only show one map at a time; when the user changes the value of the selector, reload the page so that the correct options for the desired map is loaded.
Workaround #3: Render each map in a separate page - e.g. in a popup page, or add navigation buttons or a menu to switch between different pages.
Some browsers show [object Object] error page
If you call jQuery from a href tag (e.g. if you set a link's target attribute to anything like javascript:$("#map_mymap").reportmap("click",#ID#)
) in some browsers clicking the link will open a new web page showing [object Object]
.
This is a known issue with embedding calls to jQuery from a href tag and is not specific to this plugin. Ref: https://stackoverflow.com/questions/20845695/jquery-ie-gives-object-object-error-when-displaying-dialogs
The workaround is to wrap the javascript call in a function and call that from your link; e.g. in your page's Function and Global Variable Declaration add a function like this:
function click_mymap(id) {
$("#map_mymap").reportmap("click",id);
}
Then change your report link to refer to the function, e.g.
javascript:click_mymap(#ID#)