1

Google map works on development PC but not on server

asked 2010-07-14 05:01:23 +0800

Col gravatar image Col
135 1 6

updated 2013-03-28 11:58:12 +0800

jimyeh gravatar image jimyeh
2047 1 4
ZK Team

zk version: zkee 5.0.2 on both computers

works.zul <zk>

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=my-google-supplied-key" type="text/javascript"></script>

<gmaps width="500px" height="300px"/> </zk> This code works on both my development PC and on the server.

fails.zul <zk> <script type="text/javascript" content="zk.googleAPIkey='my-google-supplied-key'"/> <gmaps width="500px" height="300px"/> </zk> This code works on my development PC only. When I try to run this script on the server it comes up with: To use <gmaps>, you have to specify the following statement in your page: <script content="zk.googleAPIkey='key-assigned-by-google'"/>

Both my development PC and test server are on the same internal network. I have searched the forums and checked everything recommended there. I am running out of ideas for how I might be able to fix this problem. Does anyone have any ideas of what might be the problem?

Thanks, Col

delete flag offensive retag edit

5 Answers

Sort by ยป oldest newest most voted
0

answered 2010-07-14 20:23:13 +0800

Col gravatar image Col
135 1 6

After much google searching and head scratching I found the problem.

If you access your website via a port number other than 80 (I use 8080 while testing at the moment) you need to get a key for http://youdomain.com:8080

Also don't be confused by google maps working when you access via http://localhost as apparently "It works for localhost because the API key validation is suppressed for localhost." (Found during my searching.

Hope this helps someone else.

link publish delete flag offensive edit

Comments

I am still getting the issue in my server. version used: gmapsz-6.5.2.2.jar,I implemented your code but got an error :"The reference to entity "v" must end with the ';' delimiter.".

nsharma ( 2013-06-20 07:13:34 +0800 )edit

right now i'm using key provided by ZK,so what kind of key we need for my website as the port number is not 80. help me out with it.

nsharma ( 2013-06-20 07:18:49 +0800 )edit
0

answered 2010-07-14 05:04:17 +0800

Col gravatar image Col
135 1 6

Again with proper code tags:

works.zul

<zk>
<script src="http://maps.google.com/maps?file=api&v=2&key=my-google-supplied-key"
type="text/javascript"></script>
<gmaps width="500px" height="300px"/>
</zk>

fails.zul

<zk>
<script type="text/javascript" content="zk.googleAPIkey='my-google-supplied-key'"/>
<gmaps width="500px" height="300px"/>
</zk>

error message:

To use <gmaps>, you have to specify the following statement in your page:
<script content="zk.googleAPIkey='key-assigned-by-google'" />

link publish delete flag offensive edit
0

answered 2013-03-28 08:27:46 +0800

pramasam gravatar image pramasam
3

Hi,

<script <src="http://maps.google.com/maps?file=api&v=2&key=" google="" api-key"=""/>

When I tried this I am getting following Error.

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

<script content="zk.googleAPIkey='key-assigned-by-google'"/>

Please help me on this.

Regards, Prakash

link publish delete flag offensive edit
0

answered 2013-03-28 08:35:22 +0800

vincentjian gravatar image vincentjian
2245 6

updated 2013-03-29 04:32:39 +0800

Hi Prakash,

If you are using the latest zkgmpas, you don't need googleAPIKey anymore.

link publish delete flag offensive edit
0

answered 2013-04-02 10:21:58 +0800

Jonson1 gravatar image Jonson1
19 1
http://www.techsupporthou...

updated 2013-04-02 10:22:34 +0800

I think you can also get help form internet.

link publish delete flag offensive edit
Your answer
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: 2010-07-14 05:01:23 +0800

Seen: 745 times

Last updated: Apr 02 '13

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