-
1. Re: gmap not rendered in firefox
hispeedsurfer Jul 14, 2007 5:35 AM (in response to hispeedsurfer)Additonal info:
in online version the problem doesn't appear (http://livedemo.exadel.com/richfaces-demo/)
Have deployed richfaces-demo from svn and from nightly-build -
2. Re: gmap not rendered in firefox
sergeysmirnov Jul 14, 2007 12:58 PM (in response to hispeedsurfer)google map requires it own key registered for each domain. So, you need to take the key from Google and use it - attribute "gmapKey"
richFaces Google map component allow to specify several keys, so you will be able to test application on the "localhost" and then deploy it to the production.
Look at createKey() method at: http://tinyurl.com/2axh5o -
3. Re: gmap not rendered in firefox
hispeedsurfer Jul 15, 2007 5:24 AM (in response to hispeedsurfer)Unfortunately thats not the reason because map is displayed in Internet Explorer(v7).
Anyway I have changed the key but the result is the same. Cannot show maps in richfaces-demo build from svn and it's not showed in my own app as well. -
4. Re: gmap not rendered in firefox
hispeedsurfer Jul 15, 2007 4:05 PM (in response to hispeedsurfer)hey Sergey,
here some more infos.
Tried gmap-sample.war and no problem. On richfaces-demo from svn it's always the same, also in my app. But in firebug 2 errors are thrown when I call gmap site.Object cannot be created in this context" code: "9 getElementsByClassName("title", "span", undefined)menu.js (line 123) init()menu.js (line 42) [Break on this error] undefined GMap2 is not defined __initGmapdiv("map", "j_id183", "Your browser does not support Google Maps")gmap.js.jsf (line 12) __initGMap()gmap.jsf (line 620) [Break on this error] window[mapVar] = new GMap2(mapdiv);
I have searched "GMap2 is not defined" error and found that I have to clear cache in firefox. No success. -
5. Re: gmap not rendered in firefox
sergeysmirnov Jul 15, 2007 6:03 PM (in response to hispeedsurfer)try to surround content of the page with <f:view contentType="text/html">
-
6. Re: gmap not rendered in firefox
hispeedsurfer Jul 16, 2007 1:04 AM (in response to hispeedsurfer)Great Sergey,
that's the solution. How can I figure out such reason? -
7. Re: gmap not rendered in firefox
sergeysmirnov Jul 16, 2007 1:25 AM (in response to hispeedsurfer)Frankly speaking, I do not know the primary reason either.
richfaces-demo works under JSF 1.2 with Facelets
gmap-sample works under JSF 1.1 and without Facelets.
In general, facelets starts to set the content type to "xhtml" by default when recognizes the jsf 1.2. However, IE does not not support it and continues with "text/html". FF does support.
So,based on your feedback, the difference between "working vs. broken" is a content type.
http://jira.jboss.com/jira/browse/RF-457 has been created for further investigation. -
8. Re: gmap not rendered in firefox
rnabuurs Jul 27, 2007 6:19 AM (in response to hispeedsurfer)I had the same problem as you. This is a known problem with Google Maps. See the Google Forums at http://tinyurl.com/yos773
Basically the problem is that when you supply a page with a mime-type of text/xhtml+xml to firefox it will parse it using it's xml parse. So the result is an xml document and not a html document.
Google Maps then tries to use the javascript call "document.write()" on that xml document, which fails because "document.write()" is html only (see http://www.mozilla.org/docs/web-developer/faq.html#accept )
IE doens't have this problem because IE doens't support XHTML and will treat is as ordinary html
You workaround (that i'm using as well) works because it forces firefox to use it's SGML parser instead of it's XML parser to parse the document.
I don't think you'll be able to fix this problem in richfaces... the real fix will have to come from Google -
9. Re: gmap not rendered in firefox
sergeysmirnov Jul 27, 2007 1:16 PM (in response to hispeedsurfer)Thank you for info. I see people try to find workaround, but not one exists that allow to fix this problem in general. Let's wait Google's guy.
So far, if you use Facelets, the problem is fixed easy with declaring the "text/html" content type explicitly with<f:view contentType="text/html">
As soon as Facelets does not care where you put f:view, you can put it anywhere on the page, even inside the template that contains gmap.
BTW: Starting from version 3.1.0 (future August release), RichFaces will have a rich:virtualEarth component. This is an alternative from MS. What is interesting, but, by default, the same problem there also: http://viavirtualearth.com/vve/Forum/2/3.ashx