0

gmaps tag error

asked 2009-12-17 07:56:00 +0800

alguineirojunior gravatar image alguineirojunior
18 2

updated 2013-06-28 03:50:08 +0800

jimyeh gravatar image jimyeh
2047 1 4
ZK Team

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

delete flag offensive retag edit

14 Replies

Sort by » oldest newest

answered 2009-12-17 10:58:17 +0800

alguineirojunior gravatar image alguineirojunior
18 2

Fixed, I updated my gmapsz.jar with gmapsz.jar in zk-Gmaps-bin-2.0_50.zip.

):-

João Alguineiro.

link publish delete flag offensive edit

answered 2009-12-24 03:03:45 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

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.

link publish delete flag offensive edit

answered 2010-01-09 06:07:19 +0800

timo18146 gravatar image timo18146
189

updated 2010-01-09 06:22:51 +0800

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...
- tag. Now it does not with neither the one or the other tag. Update to .50 also did not help.

is there a chance to debug this without trial and error?

any ideas welcome!..

thank you!

link publish delete flag offensive edit

answered 2010-01-09 06:35:23 +0800

timo18146 gravatar image timo18146
189

updated 2010-01-09 06:53:49 +0800

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

link publish delete flag offensive edit

answered 2010-01-09 08:46:44 +0800

timo18146 gravatar image timo18146
189

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

link publish delete flag offensive edit

answered 2010-01-10 21:39:56 +0800

henrichen gravatar image henrichen
3869 2
ZK Team

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.

link publish delete flag offensive edit

answered 2010-01-11 04:52:14 +0800

timo18146 gravatar image timo18146
189

updated 2010-01-11 04:53:07 +0800

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

link publish delete flag offensive edit

answered 2010-01-11 08:23:42 +0800

timo18146 gravatar image timo18146
189

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

link publish delete flag offensive edit

answered 2010-01-11 09:20:04 +0800

timo18146 gravatar image timo18146
189

updated 2010-01-11 09:22:46 +0800

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

link publish delete flag offensive edit

answered 2010-01-11 09:30:48 +0800

timo18146 gravatar image timo18146
189

Henri,

I am sorry. I was wrong. It worked in IE8 the first time. but after 2 page refresh it did not work anymore.

i will provide you a login to alpha test server where you can look at it. I'll do this via email.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2009-12-17 07:56:00 +0800

Seen: 2,082 times

Last updated: Jul 10 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More