This project is read-only.

JavaScript Error in Panel and CMS

Feb 12, 2008 at 9:49 PM
We are integrating this control into one of our custom modules in the DotNetNuke (DNN) CMS. Due to the complexities of this module, we are using a radMultiPage control to wrap certain sections of content, including this GoogleMap control. This control works much like the Panel server control.

radMultiPage Control: http://www.telerik.com/demos/aspnet/TabStrip/Examples/Functionality/Multipage/DefaultCS.aspx

Here is the problem. The map only renders when the selected tab on page load was the one with the GoogleMap control. When another tab is loaded as the default, we instead see all of the Google map icons and controls, but not the map itself. When this happens, attempts to change the zoom or move the map would result in a JavaScript error. The error is "Q() is null or not an object". This is clearly an error thrown from Google's API, but why? We have also experienced this error when using DOM to switch the views.

Just to recap, the GoogleMap control performs perfectly if it is loaded when the page loads. If it is hidden at page load and then displayed using AJAX OR DOM, it doesn't work.

Drupal appears to be having a similar problem. Here is a reference link http://drupal.org/node/134110. Although they are not using your control, it is the same error we are experiencing. (Hopefully the link would at least give you an idea of how we are using it.)

Do you have any idea how to get this to work as we intend it?
Feb 13, 2008 at 4:18 PM
Hi,
I'll check out that.

Regards,
Velio
Feb 13, 2008 at 6:39 PM

velio wrote:
Hi,
I'll check out that.

Regards,
Velio

After some additional troubleshooting, we found the problem this morning, and it appeared to be related to the initial rendering of the control. For instance, with the Google Map API, you cannot initially render the map within a container (TD, DIV) with the style attribute of "display:none;". When you reset the display property to "block" or "inline", the Google API Code is already broken.

A workaround that we found was to set the position of the control to absolute and then position it off of the page. When the tab is then clicked, we use JavaScript to reset the position of the map control into its original place. This method allows the map to render perfectly as if nothing was wrong to begin with.

The end of this forum thread is where we found the fix.

http://www.dynamicdrive.com/forums/showthread.php?t=3923
Jul 6, 2012 at 4:29 PM

Has there been any resolution to this one?

I have the same problem when the control is loaded in a hidden panel it does not work.