[LRUG] Introduction and a request for JS help

Dan Webb dan at danwebb.net
Fri Jan 23 08:27:25 PST 2009


On Fri, Jan 23, 2009 at 4:12 PM, sole <listas at soledadpenades.com> wrote:

> if (GBrowserIsCompatible() && typeof gyms != 'undefined') {

This is the correct version.  typeof returns a string.

I suspect the problem is something to do with your setCenter calls.
The best way with debugging odd JS is often to remove all the code
until it you get something that works then add the code back in line
by line until you find the offending statement.  So in you case, pull
all the code out of your initialize function apart from the first two
lines:

var map = new GMap2(document.getElementById("map"));
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);


do you see a map now? if not, then there will be something wrong with
the coords or zoom level.

if you do, start adding the rest of the code in bit by bit until you
find the bit that makes it go wrong.

-- 
Dan Webb
http://www.danwebb.net

aim: danwrong123
skype: danwrong



More information about the Chat mailing list