# gmaps tag error

alguineirojunior
18 2

Hi,

I updated my Zk to 5.0.0-RC2 and when i try to use gmaps tag Im getting this error:

My code in index.zul is

<zk>
type="text/javascript"></script>
<gmaps width="500px" height="300px"></gmaps>
</zk>

João Alguineiro

delete retag edit

## 14 Replies

alguineirojunior
18 2

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

):-

João Alguineiro.

henrichen
3869 2

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>
<gmaps width="500px" height="300px"></gmaps>
</zk>


Note the single quote that enclose the key is required.

timo18146
189

For me it does not seem to work..

<zk>
<gmaps width="500px" height="300px"></gmaps>
</zk>


always delivers the screen

To use <gmaps>, you have to specify the following statement in your page:

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!

timo18146
189

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 :

}

on

<zk>
<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

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

henrichen
3869 2

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:

3. run ZK Gmaps script.

Per the firebug information (those are codes of Google AJAX API":

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.

timo18146
189

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

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

timo18146
189

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

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.

[hide preview]