-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I updated my Zk to 5.0.0-RC2 and when i try to use gmaps tag Im getting this error:
org.zkoss.zk.ui.metainfo.DefinitionNotFoundException: Component definition not found: gmaps in [LanguageDefinition: xul/html], [SYS file:/E:/workspace-csii/csii/WebContent/index.zul
My code in index.zul is
<zk>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA7_PRET95fDhQgNtQtC58aRSPajjBwEPeUe64LiuWG4sH29NvDhQ9em2x4twWaUu-JLOYaNxXqabRCQ"
type="text/javascript"></script>
<gmaps width="500px" height="300px"></gmaps>
</zk>
Could you Help me please?
João Alguineiro
Fixed, I updated my gmapsz.jar with gmapsz.jar in zk-Gmaps-bin-2.0_50.zip.
):-
João Alguineiro.
Note that Gmaps 2.0_50 now supports Google Ajax API, the way to provide the Google API key is a little bit different from that of old version. User shall provide <script content="googleAPIkey='your-key-here'"/> or <?script content="googleAPIkey='your-key-here'" ?> in the page.
In your example, you shall then use
<zk> <script content="googleAPIkey='ABQIAAAA7_PRET95fDhQgNtQtC58aRSPajjBwEPeUe64LiuWG4sH29NvDhQ9em2x4twWaUu-JLOYaNxXqabRCQ'"/> <gmaps width="500px" height="300px"></gmaps> </zk>
Note the single quote that enclose the key is required.
For me it does not seem to work..
<zk> <script content="zk.googleAPIkey='ABQIAAAAijWFss7nQnotGWv7FQCD9hTorFVTpO9Sp6wxj6zL5EhkrHk5dBSB36QGXAqwUNARxpLWqGWyazWAMg'"/> <gmaps width="500px" height="300px"></gmaps> </zk>
always delivers the screen
To use <gmaps>, you have to specify the following statement in your page:
<script content="zk.googleAPIkey='key-assigned-by-google'" />
when not called from localhost. - I even tried new keys from google. but no way..
_before_ updating to zk5RC2 it worked without any problems with the old
<script src = "http://maps.google.com/maps?file=api&v=2&key=ABQI...
is there a chance to debug this without trial and error?
any ideas welcome!..
thank you!
some more hints..:
maybe it is a timing issue.. ? works sometimes.... in Firefox 3.5.5 Windows - 20 page reloads and I got the map 2 or 3 times.. But NOT in IE8 ( always shows the "to use gmaps"..text) nor Safari 3 (shows just nothing)
firebug shows up on the call :
http://www.google.com/jsapi?key=ABQIAAAAijWFss7nQnotGWv7FQCD9hTorFVTpO9Sp6wxj6zL5EhkrHk5dBSB36QGXAqwUNARxpLWqGWyazWAMg
if (!window['google']) {
window['google'] = {};
}
if (!window['google']['loader']) {
window['google']['loader'] = {};
google.loader.ServiceBase = 'http://www.google.com/uds';
google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax';
google.loader.ApiKey = 'ABQIAAAAijWFss7nQnotGWv7FQCD9hTorFVTpO9Sp6wxj6zL5EhkrHk5dBSB36QGXAqwUNARxpLWqGWyazWAMg';
google.loader.KeyVerified = false;
google.loader.LoadFailure = true;
google.loader.Secure = false;
google.loader.GoogleLocale = 'www.google.com';
google.loader.ClientLocation = null;
google.loader.AdditionalParams = '';
google.loader.OriginalAppPath = 'http://dev31
on
<zk>
<script content="zk.googleAPIkey='ABQIAAAAijWFss7nQnotGWv7FQCD9hTorFVTpO9Sp6wxj6zL5EhkrHk5dBSB36QGXAqwUNARxpLWqGWyazWAMg'"/>
<gmaps width="500px" height="300px"></gmaps>
</zk>
BUT the key is correct. direct call of the api gives KeyVerified=true and loadFailure=false..
thank you for any help.. I have no more Ideas right now..
Timo
I tried some more time. It seems that there is some problem there. Sometimes everything works like it should and 2 minutes later, you only get Errors. I am quite sure that there must be some kind of timing-problem. because the same API-Key is sometimes working and often not. The problem is in all my browsers (FF35, SF3, GC, IE8)..
but I found another bug in gmaps. I will file and make new thread.
timo
timo,
The gmaps version 2.0_50 adapts the "Google AJAX API Loader" mechanism and thus the new way to specify the google key in ZK 5.
the sequence is like this:
1. ZK loads the "Google AJAX API Loader" script in and verify the key.
2. Then use "Google AJAX API Loader" to load google maps script in.
3. run ZK Gmaps script.
Per the firebug information (those are codes of Google AJAX API":
google.loader.KeyVerified = false;
google.loader.LoadFailure = true;
It seems that Google thinks the key is NOT "verified" and step 1 is failed.
-----
I cannot replicate your case here. Let's do some experiments.
In you page specify
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"></script>
This virtually do the step 1.
Let's see whether this solve the issue. Otherwise, you might has to give us an access URL to check your test page directly.
Hi Henri,
thanks for the reply. I found a working way. The problem is not the key or the loading mechanism itself. It is that I use includes with mode="instant" . the file with the map is instantly included by an instant included file from the top-file. when I put the key in the top-file and do not instantly include it works all the time. when it is, where it was with the old <script language...> loading tag (top of included zul) , it often produces this problem.
As I was not able to make a sample for you that reproduces the problem constantly (the page with this has a quite complex gui which seems to bring this up), i put that on my todo-list.
thank you,
Timo
I am sorry.. The problem still exists and becomes more and more complex.. I tried all tags. no way...
I just noticed that it only works in FF3.5.5 - but NOT in IE8 nor Safari 4.0.4..
....hmmmmmm....
i will setup a demo if you dont have any idea right now..
it must have to do with the include things and macro components. i heaviliy use this.
stay tuned... - this is unfortunatelly damn important for me to have gmaps work..
Timo
on my way stripping down to a test szenario, i figured out that: MUHAHA... ^^
<script content="zk.googleAPIkey='MYKEY'" /> is not working in my complex page. at least not from within eclipse tomcat - this only when I call the page via localhost and not FQDN of the dev-pc (which of course the api-key is valid for).
when I deploy the file to a tomcat behind an apache webserver, it works. - at least for now after quick testing it seems so. IE8 problems gone.
so:
the Issue is in Eclipse-tomcat behaviour. 100% reproducable only in IE8. FF is the thing described some articles above: sometimes works, sometimes not.
any idea how to debug this? Should be possible to use the local tomcat in eclipse with zkstudio for everything - and of course also over FWDN (i do this, because I have a virtualbox with windows running for browsertests).
by the way: it seems essentially important where in the page you put <script content="zk.googleAPIkey='MYKEY'" /> ... should be somehow nearly first line.. ? how is that intended?
thankUall
Timo
Asked: 2009-12-17 07:56:00 +0800
Seen: 2,082 times
Last updated: Jul 10 '13
change zkoss gmarker content box css
Gpolygon problem ( new feature )
Longitude and Latitude from client IP
ZK Studio, ZK Pivottable, ZK Calendar & ZK Gmaps released for ZK 7!
Gmap center moves ,when gmarkers are loaded.
problem using setCenter() method in ZK GMaps [closed]