Issue 4 in ogmaps: gapp not defined

11 views
Skip to first unread message

codesite...@google.com

unread,
Jun 8, 2008, 9:24:10 PM6/8/08
to ogmaps-...@googlegroups.com
Issue 4: gapp not defined
http://code.google.com/p/ogmaps/issues/detail?id=4

New issue report by m...@thewaffleproject.com:
What steps will reproduce the problem?
1. Run Program
2. Open HTML File


What is the expected output? What do you see instead?
The expected output is the google maps UI for waterloo, ON.
After fixing the other two defects (Outside US, and version number),
the html page displays a white sidebar, with grey content that says "Loading".

There are a bunch of javascript warnings/errors.
There are several CSS selector errors, which I suspect isn't important,
but,
Error:
gapp is not defined in ogmap.html line 17.

I suspect this means some Javascript files are missing. I will read the
source and see what I can find out.

What version of the product are you using? On what operating system?
Using the latest SVN on Firefox 3 RC1; Linux.

Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Dammie

unread,
Jul 24, 2008, 5:07:13 AM7/24/08
to ogmaps-discuss
On Jun 9, 3:24 am, codesite-nore...@google.com wrote:
> Issue 4: gapp not defined

Hi,

I've been looking into this., and it seems google changed a lot. I
didn't manage to get everything working, but maybe it helps a
little...

1] The maps version is currently 120, so change the number in this
line to 120:

mapfiles = 'http://www.google.com/intl/en_us/mapfiles/120/maps2'


2] Further I noticed three more javascripts were added:
- mod_lyrsctrl
- mod_trends
- mod_infowindow.js

They need to be fetched accordingly:

# get mod_lyrsctrl.js and transmogrify
if not os.path.isfile(os.path.join(RUN_FROM_DIR, 'data',
'mod_lyrsctrl.js')):
print 'downloading:', mapfiles+'/mod_lyrsctrl.js'
oa = openanything.fetch(mapfiles+'/mod_lyrsctrl.js',
agent=useragent)
js = oa['data']
js = js.replace('http://maps.google.com','data')
js = js.replace('/mapfiles','')
file = open( os.path.join(RUN_FROM_DIR, 'data',
'mod_lyrsctrl.js'), 'w' )
file.write( js )
file.close()

# get mod_trends.js and transmogrify
if not os.path.isfile(os.path.join(RUN_FROM_DIR, 'data',
'mod_trends.js')):
print 'downloading:', mapfiles+'/mod_trends.js'
oa = openanything.fetch(mapfiles+'/mod_trends.js',
agent=useragent)
js = oa['data']
js = js.replace('http://maps.google.com','data')
js = js.replace('/mapfiles','')
file = open( os.path.join(RUN_FROM_DIR, 'data',
'mod_trends.js'), 'w' )
file.write( js )
file.close()

# get mod_infowindow.js and transmogrify
if not os.path.isfile(os.path.join(RUN_FROM_DIR, 'data',
'mod_infowindow.js')):
print 'downloading:', mapfiles+'/mod_infowindow.js'
oa = openanything.fetch(mapfiles+'/mod_infowindow.js',
agent=useragent)
js = oa['data']
js = js.replace('http://maps.google.com','data')
js = js.replace('/mapfiles','')
file = open( os.path.join(RUN_FROM_DIR, 'data',
'mod_infowindow.js'), 'w' )
file.write( js )
file.close()


3] And finally I noticed that the html code still referred to some
files at google website instead of the local files. So one more line
need to added below

html = soup.prettify()
html = html.replace(mapfiles, './data')
html = html.replace('http://www.google.com/intl/en_us/mapfiles',
'./data')

add this:

html = html.replace('/intl/en_ALL/mapfiles/120/maps2', './data/')


After these changes, the gapp error is gone, and the ogmap.html file
will work. However, the tiles do not load and instead you will see the
"sorry we don't have maps for this zoom level". I suspect the problem
to be in the main.js. Not sure if this trick is still working:

js = js.replace('function rf(a,b){','function rf(a,b){b =
b.replace("tiles/mt?","tiles/mt_");')


ciao,

Dammie

axel

unread,
Jul 24, 2008, 1:21:17 PM7/24/08
to ogmaps-discuss
Does this work yet?
Reply all
Reply to author
Forward
0 new messages