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
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.
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.
try to surround content of the page with <f:view contentType="text/html">
that's the solution. How can I figure out such reason?
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.
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.
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
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
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